]> git.donarmstrong.com Git - infobot.git/blobdiff - src/DynaConfig.pl
major re-organisation of the different SQL files; cleanup and fixing of the postgres...
[infobot.git] / src / DynaConfig.pl
index 59badae9a80d776b2c475362a01b885c19152715..f4ba9c3f207fd3d489a62a3672921fa5b480e471 100644 (file)
@@ -271,12 +271,10 @@ sub readChanFile {
            $chanconf{$chan}{$1} = 1;
 
        } elsif (/^[\s\t]+\-(\S+)$/) {          # bool, false.
-           &DEBUG("deprecated support of negative options.") unless ($cache{negative});
            # although this is supported in run-time configuration.
-           $cache{negative} = 1;
-#          $chanconf{$chan}{$1} = 0;
+           $chanconf{$chan}{$1} = 0;
 
-       } elsif (/^[\s\t]+(\S+)[\ss\t]+(.*)$/) {# what = val.
+       } elsif (/^[\s\t]+(\S+)[\s\t]+(.*)$/) {# what = val.
            $chanconf{$chan}{$1} = $2;
 
        } else {
@@ -297,8 +295,6 @@ sub readChanFile {
        }
     }
 
-    delete $cache{negative};
-
     &status("CHANFILE: Loaded: ".(scalar(keys %chanconf)-1)." chans");
 }
 
@@ -722,10 +718,10 @@ sub chanSet {
        ### ".chanset +blah"
        ### ".chanset +blah 10"         -- error.
 
-       my $state       = ($1 eq "+") ? 1 : 0;
+       my $set = ($1 eq "+") ? 1 : 0;
        my $was         = $chanconf{$chan}{$what};
 
-       if ($state) {                   # add/set.
+       if ($set) {                     # add/set.
            if (defined $was and $was eq "1") {
                &performStrictReply("setting $what for $chan already 1.");
                return;
@@ -739,16 +735,11 @@ sub chanSet {
                return;
            }
 
-           if ($was eq "0") {
-               &performStrictReply("setting $what for $chan already 0.");
-               return;
-           }
-
            $val        = 0;
        }
 
        # alter for cosmetic (print out) reasons only.
-       $was    = ($was) ? "; was '$was'" : "";
+       $was    = (defined $was) ? "; was '$was'" : "";
 
        if ($val eq "0") {
            &performStrictReply("Unsetting $what for $chan$was.");
@@ -821,6 +812,11 @@ sub rehashConfVars {
            &loadMyModule('RootWarn');
            delete $cache{confvars}{$_};
        }
+
+       if (/^onjoin$/i and $i) {
+           &loadMyModule('OnJoin');
+           delete $cache{confvars}{$_};
+       }
     }
 
     &DEBUG("end of rehashConfVars");