]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHelpers.pl
- berkeley dbm support now works! thanks to tim riker.
[infobot.git] / src / IRC / IrcHelpers.pl
index 0bc344d982fe048e7ccc5e127f5c9197d944b1f2..53d3db7f71b19895f7b43d2b44ce607ba15c7a8f 100644 (file)
@@ -244,7 +244,7 @@ sub hookMsg {
        # better to ignore an extra message than to allow one to get
        # through, although it would be better to go through ignore
        # checking again.
-       if (time() - $cache{ignoreCheckTime} > 60) {
+       if (time() - ($cache{ignoreCheckTime} || 0) > 60) {
            &ignoreCheck();
        }
 
@@ -321,7 +321,7 @@ sub chanLimitVerify {
 sub chanServCheck {
     ($chan) = @_;
 
-    if (!defined $chan or $chan =~ /^$/) {
+    if (!defined $chan or $chan =~ /^\s*$/) {
        &WARN("chanServCheck: chan == NULL.");
        return 0;
     }
@@ -341,7 +341,11 @@ sub chanServCheck {
        &rawout("WHO NickServ");
        return 0;
     }
-    return 0 if (exists $channels{$chan}{'o'}{$ident});
+    # check for first hash then for next hash.
+    # todo: a function for &ischanop()? &isvoice()?
+    if (exists $channels{$chan} and exists $channels{$chan}{'o'}{$ident}) {
+       return 0;
+    }
 
     &status("ChanServ ==> Requesting ops for $chan. (chanServCheck)");
     &rawout("PRIVMSG ChanServ :OP $chan $ident");