]> git.donarmstrong.com Git - infobot.git/commitdiff
- fixed when chan (msgType = private) is undefined.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 5 Feb 2001 14:31:33 +0000 (14:31 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 5 Feb 2001 14:31:33 +0000 (14:31 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@337 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/IrcHooks.pl

index 0054a08a289eee404c9d94f899917ffea1f4c677..382d745f781a5c58152984d5aeb12ac0cc7f4353 100644 (file)
@@ -747,19 +747,11 @@ sub on_quit {
 sub on_targettoofast {
     my ($self, $event) = @_;
     my $nick = $event->nick();
-    my $chan = ($event->to)[0];
-
-    &DEBUG("on_targettoofast: nick => '$nick'.");
-    &DEBUG("on_targettoofast: chan => '$chan'.");
-
-    foreach ($event->args) {
-       &DEBUG("on_targettoofast: args => '$_'.");
-    }
+    my($me,$chan,$why) = $event->args();
 
 ###    .* wait (\d+) second/) {
        &status("X1 $msg");
-       my $sleep = $3 + 10;
-
+       my $sleep = 5;
        &status("going to sleep for $sleep...");
        sleep $sleep;
        &joinNextChan();
@@ -998,9 +990,12 @@ sub hookMsg {
            ### public != personal who so the below is kind of pointless.
            my @who;
            foreach (keys %flood) {
-               next if (/^\Q$floodwho\E$/ or /^\Q$chan\E$/);
+               next if (/^\Q$floodwho\E$/);
+               next if (defined $chan and /^\Q$chan\E$/);
+
                push(@who, grep /^\Q$message\E$/i, keys %{$flood{$_}});
            }
+
            if (scalar @who) {
                &msg($who, "you already said what ".
                                join(' ', @who)." have said.");