]> git.donarmstrong.com Git - infobot.git/blobdiff - src/DynaConfig.pl
- added top3 irctextcounter stats
[infobot.git] / src / DynaConfig.pl
index d121937995b8280e1f10f5c9f1de2b3ac30cf895..9fa01ddd57fe6ca88eb9ad7a21c1a081c28b4600 100644 (file)
@@ -15,6 +15,11 @@ if (&IsParam("useStrict")) { use strict; }
 sub readUserFile {
     my $f = "$bot_misc_dir/blootbot.users";
 
+    if (! -f $f) {
+       &DEBUG("userfile not found; new fresh run detected.");
+       return;
+    }
+
     if ( -f $f and -f "$f~") {
        my $s1 = -s $f;
        my $s2 = -s "$f~";
@@ -417,7 +422,7 @@ sub verifyUser {
     foreach $user (keys %users) {
        next if ($user eq "_default");
 
-       foreach $m (keys %{$users{$user}{HOSTS}}) {
+       foreach $m (keys %{ $users{$user}{HOSTS} }) {
            $m =~ s/\?/./g;
            $m =~ s/\*/.*?/g;
            $m =~ s/([\@\(\)\[\]])/\\$1/g;
@@ -712,8 +717,14 @@ sub chanSet {
            $val        = 0;
        }
 
-       $chanconf{$chan}{$what} = $val;
-       &pSReply("Setting $what for $chan to '$val'$was.");
+       if ($val eq "0") {
+           &pSReply("Unsetting $what for $chan$was.");
+           delete $chanconf{$chan}{$what};
+       } else {
+           &pSReply("Setting $what for $chan to '$val'$was.");
+           $chanconf{$chan}{$what}     = $val;
+       }
+
        $update++;
 
     ### ".chanset blah testing"
@@ -770,3 +781,12 @@ my @regFlagsUser = (
 );     # todo...
 
 1;
+
+#####
+# Userflags
+#      +r      - ability to remove factoids
+#      +t      - ability to teach factoids
+#      +m      - ability to modify factoids
+#      +n      - bot owner
+#      +o      - authorised user of bot (like +m on eggdrop)
+#####