From 4c60cc97c62302f644247520c24b915bd022c73e Mon Sep 17 00:00:00 2001 From: djmcgrath Date: Fri, 19 Oct 2007 11:27:21 +0000 Subject: [PATCH] * Accept Don's patch for automatic nick recovery git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1575 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/IRC/Schedulers.pl | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/IRC/Schedulers.pl b/src/IRC/Schedulers.pl index 7c3044d..b4f9614 100644 --- a/src/IRC/Schedulers.pl +++ b/src/IRC/Schedulers.pl @@ -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..."); } } -- 2.39.5