]> git.donarmstrong.com Git - infobot.git/blobdiff - src/DynaConfig.pl
- irctextcounters: add percentage to top3
[infobot.git] / src / DynaConfig.pl
index 29a5c978a24c9d015ed1037b5f6a87ed94d8e423..b64ba0b24183f182d12ccd97d5dbc2426bfdd815 100644 (file)
@@ -349,7 +349,7 @@ sub writeChanFile {
        }
 
        foreach (keys %opts) {
-           next unless ($opts{$_} > 1);
+           next unless ($opts{$_} > 2);
            &DEBUG("  opts{$_} => $opts{$_}");
        }
 
@@ -773,6 +773,35 @@ sub chanSet {
     return;
 }
 
+sub rehashConfVars {
+    # this is an attempt to fix where an option is loaded but the module
+    # has not loaded. it also can be used for other things.
+
+    foreach (keys %{ $cache{confvars} }) {
+       my $i = $cache{confvars}{$_};
+       &DEBUG("rehashConfVars: _ => $_");
+
+       if (/^news$/ and $i) {
+           &loadMyModule("news");
+           delete $cache{confvars}{$_};
+       }
+
+       if (/^uptime$/ and $i) {
+           &loadMyModule("uptime");
+           delete $cache{confvars}{$_};
+       }
+
+       if (/^rootwarn$/i and $i) {
+           &loadMyModule($_);
+           delete $cache{confvars}{$_};
+       }
+    }
+
+    &DEBUG("end of rehashConfVars");
+
+    delete $cache{confvars};
+}
+
 my @regFlagsChan = (
        "autojoin",
        "freshmeat",