]> git.donarmstrong.com Git - infobot.git/commitdiff
* Accept Don's patch for automatic nick recovery
authordjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 19 Oct 2007 11:27:21 +0000 (11:27 +0000)
committerdjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 19 Oct 2007 11:27:21 +0000 (11:27 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1575 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/Schedulers.pl

index 7c3044dddc15099775586216e15c67acafdf2af4..b4f9614bd7af3f6195b3225fd899d8b9e30f3a4b 100644 (file)
@@ -703,13 +703,22 @@ sub ircCheck {
            }
        }
 
-       if (grep /^\s*$/, keys %channels) {
-           &WARN('ircCheck: we have a NULL chan in hash channels? removing!');
-           if (!exists $channels{''}) {
-               &DEBUG('ircCheck: this should never happen!');
-           }
-
-           delete $channels{''};
+        if (grep /^\s*$/, keys %channels) {
+            &WARN('ircCheck: we have a NULL chan in hash channels? removing!');
+            if (!exists $channels{''}) {
+                &DEBUG('ircCheck: this should never happen!');
+            }
+       }
+     if ($ident !~ /^\Q$param{ircNick}\E$/) {
+       # this does not work unfortunately.
+       &WARN("ircCheck: ident($ident) != param{ircNick}($param{ircNick}).");
+
+       # this check is misleading... perhaps we should do a notify.
+       if (! &IsNickInAnyChan( $param{ircNick} ) ) {
+           &DEBUG("$param{ircNick} not in use... changing!");
+           &nick( $param{ircNick} );
+       } else {
+           &WARN("$param{ircNick} is still in use...");
        }
     }