]> git.donarmstrong.com Git - infobot.git/commitdiff
- better fix for on_disconnect.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 3 Jan 2002 14:22:46 +0000 (14:22 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 3 Jan 2002 14:22:46 +0000 (14:22 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@539 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/IrcHooks.pl

index 4a424dc58ab6659511919f86a078df58f34e5995..757a62be2d0c6f6a0d173c075fd6a5c8749c6aa6 100644 (file)
@@ -366,17 +366,19 @@ sub on_disconnect {
     &DEBUG("on_disconnect: 1");
     &clearIRCVars();
     &DEBUG("on_disconnect: 2");
-    if (defined $self and !$self->connect()) {
+
+    if (!defined $self) {
+       &WARN("on_disconnect: self is undefined! WTF");
+       &DEBUG("running function irc... lets hope this works.");
+       &irc();
+       return;
+    }
+
+    if (!$self->connect()) {
        &DEBUG("on_disconnect: 3");
        &WARN("not connected? help me. gonna call ircCheck() in 60s");
        &clearIRCVars();
        &ScheduleThis(1, "ircCheck");
-#      &ScheduleThis(10, "ircCheck");
-#      &ScheduleThis(30, "ircCheck");
-    } else {
-       &WARN("on_disconnect: self is undefined! WTF");
-       &DEBUG("running function irc... lets hope this works.");
-       &irc();
     }
 }