From e2b3a5a26851083faf25dd433e723d192bca317b Mon Sep 17 00:00:00 2001 From: dms Date: Thu, 3 Jan 2002 14:22:46 +0000 Subject: [PATCH] - better fix for on_disconnect. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@539 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/IRC/IrcHooks.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index 4a424dc..757a62b 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -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(); } } -- 2.39.2