From fae8b988081660456f1940a3f7b1efa9556c2acd Mon Sep 17 00:00:00 2001 From: dms Date: Sun, 22 Apr 2001 12:17:02 +0000 Subject: [PATCH] part now warns if we're on a channel - allow it anyway. added "reset" to DCC CHAT git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@457 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Factoids/Question.pl | 2 +- src/Factoids/Reply.pl | 2 +- src/IRC/Irc.pl | 7 ++++--- src/Modules/UserDCC.pl | 23 +++++++++++++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index f838b92..51686a8 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -26,7 +26,7 @@ sub doQuestion { $query =~ s/^\s+|\s+$//g; if (!defined $query or $query =~ /^\s*$/) { - &FIXME("doQ: query == NULL"); + &FIXME("doQ: query == NULL (message => $message)"); return ''; } diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index 1c470c4..dec2a12 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -305,7 +305,7 @@ sub smart_replace { } if ($old eq $string) { - &WARN("smart_replace: no subst made."); + &WARN("smart_replace: no subst made. (string => $string)"); } return $string; diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index 6fd4f07..8d09e0a 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -425,8 +425,8 @@ sub part { &status("parting $chan"); if (!&validChan($chan)) { - &status("part: not on $chan"); - next; + &WARN("part: not on $chan; doing anyway"); +# next; } rawout("PART $chan"); @@ -580,6 +580,7 @@ sub joinNextChan { } # chanserv check: channel specific. + ### what the hell is this for... &chanServCheck($chan); } else { @@ -791,7 +792,7 @@ sub joinfloodCheck { sub getHostMask { my($n) = @_; - &FIXME("getHostMask..."); + &FIXME("getHostMask($n) called..."); } 1; diff --git a/src/Modules/UserDCC.pl b/src/Modules/UserDCC.pl index 4be0e86..f8a309c 100644 --- a/src/Modules/UserDCC.pl +++ b/src/Modules/UserDCC.pl @@ -424,6 +424,29 @@ sub userDCC { return; } + # reset. + if ($message =~ /^reset$/i) { + return unless (&hasFlag("n")); + + &msg($who,"resetting..."); + my @done; + foreach ( keys %channels, keys %chanconf ) { + next if (grep /^\Q$_\E$/i, @done); + + &part($_); + + push(@done, $_); + sleep 1; + } + &clearIRCVars(); + &joinNextChan(); + + &status("USER reset $who"); + &msg($who,"resetted"); + + return; + } + # rehash. if ($message =~ /^rehash$/) { return unless (&hasFlag("n")); -- 2.39.2