2 # IrcHooks.pl: IRC Hooks stuff.
5 # NOTE: Based on code by Kevin Lenzo & Patrick Cole (c) 1997
8 if (&IsParam("useStrict")) { use strict; }
14 my ($self, $event) = @_;
15 my $nick = $event->nick();
16 my $chan = ($event->to)[0];
18 &DEBUG("on_generic: nick => '$nick'.");
19 &DEBUG("on_generic: chan => '$chan'.");
21 foreach ($event->args) {
22 &DEBUG("on_generic: args => '$_'.");
27 my ($self, $event) = @_;
28 my ($nick, @args) = ($event->nick, $event->args);
29 my $chan = ($event->to)[0];
33 if ($chan eq $ident) {
34 &status("* [$nick] @args");
36 &status("* $nick/$chan @args");
41 my ($self, $event) = @_;
42 my $msg = ($event->args)[0];
43 my $sock = ($event->to)[0];
44 my $nick = $event->nick();
46 if (!exists $nuh{lc $nick}) {
47 &DEBUG("chat: nuh{$nick} doesn't exist; hrm should retry.");
53 $orig{message} = $msg;
55 $uh = (split /\!/, $nuh)[1];
60 if (!exists $dcc{'CHAT'}{$nick}) {
61 my $userHandle = &verifyUser($who, $nuh);
62 my $crypto = $userList{$userHandle}{'pass'};
65 if (!defined $crypto) {
66 &DEBUG("chat: no pass required.");
68 } elsif (&ckpasswd($msg, $crypto)) {
69 $self->privmsg($sock,"Authorized.");
70 $self->privmsg($sock,"I'll respond as if through /msg and addressed in public. Addition to that, access to 'user' commands will be allowed, like 'die' and 'jump'.");
71 # hrm... it's stupid to ask for factoids _within_ dcc chat.
72 # perhaps it should be default to commands, especially
73 # commands only authorized through DCC CHAT.
74 &status("DCC CHAT: passwd is ok.");
77 &status("DCC CHAT: incorrect pass; closing connection.");
78 &DEBUG("chat: sock => '$sock'.");
80 &DEBUG("chat: after closing sock. FIXME");
81 ### BUG: close seizes bot. why?
85 &status("DCC CHAT: user $nick is here!");
86 $dcc{'CHAT'}{$nick} = $sock;
87 &DCCBroadcast("$nick ($uh) has joined the chat arena.");
94 $userHandle = &verifyUser($who, $nuh);
95 &status("$b_red=$b_cyan$who$b_red=$ob $message");
96 if ($message =~ s/^\.//) { # dcc chat commands.
97 ### TODO: make use of &Forker(); here?
98 &loadMyModule($myModules{'ircdcc'});
99 return '$noreply from userD' if (&userDCC() eq $noreply);
100 $conn->privmsg($dcc{'CHAT'}{$who}, "Invalid command.");
102 } else { # dcc chat arena.
103 foreach (keys %{$dcc{'CHAT'}}) {
104 $conn->privmsg($dcc{'CHAT'}{$_}, "<$who> $orig{message}");
108 return 'DCC CHAT MESSAGE';
114 if (&IsParam("wingate")) {
115 my $file = "$bot_base_dir/$param{'ircUser'}.wingate";
119 next unless (/^(\S+)\*$/);
120 push(@wingateBad, $_);
125 ### TODO: move this to end of &joinNextChan()?
127 &DEBUG("on_EOM: calling sS in 60s.");
128 $conn->schedule(60, \&setupSchedulers, "");
132 if (&IsParam("ircUMode")) {
133 &status("Attempting change of user modes to $param{'ircUMode'}.");
134 &rawout("MODE $ident $param{'ircUMode'}");
137 &status("End of motd. Now lets join some channels...");
138 if (!scalar @joinchan) {
139 &WARN("joinchan array is empty!!!");
140 @joinchan = split /[\t\s]+/, $param{'join_channels'};
147 my ($self, $event) = @_;
148 my $type = uc( ($event->args)[1] );
149 my $nick = $event->nick();
151 # pity Net::IRC doesn't store nuh. Here's a hack :)
154 if ($type eq 'SEND') {
155 # incoming DCC SEND. we're receiving a file.
156 $self->new_get($event, \*FH);
157 } elsif ($type eq 'CHAT') {
158 $self->new_chat($event);
160 &status("${b_green}DCC $type$ob unknown ...");
165 my ($self, $event) = @_;
166 my $nick = $event->nick();
167 my $sock = ($event->to)[0];
169 # DCC CHAT close on fork exit workaround.
170 return if ($bot_pid != $$);
172 &DEBUG("dcc_close: nick => '$nick'.");
174 if (exists $dcc{'SEND'}{$nick} and -f "temp/$nick.txt") {
175 &status("${b_green}DCC SEND$ob close from $b_cyan$nick$ob");
177 &status("dcc_close: purging $nick.txt from Debian.pl");
178 unlink "temp/$nick.txt";
180 delete $dcc{'SEND'}{$nick};
181 } elsif (exists $dcc{'CHAT'}{$nick} and $dcc{'CHAT'}{$nick} eq $sock) {
182 &status("${b_green}DCC CHAT$ob close from $b_cyan$nick$ob");
183 delete $dcc{'CHAT'}{$nick};
185 &status("${b_green}DCC$ob UNKNOWN close from $b_cyan$nick$ob");
190 my ($self, $event) = @_;
191 my $type = uc( ($event->args)[0] );
192 my $nick = $event->nick();
193 my $sock = ($event->to)[0];
196 if ($type eq 'SEND') {
197 &status("${b_green}DCC lGET$ob established with $b_cyan$nick$ob");
198 } elsif ($type eq 'CHAT') {
199 &status("${b_green}DCC CHAT$ob established with $b_cyan$nick$ob ($nuh{$nick})");
200 my $userHandle = &verifyUser($nick, $nuh{lc $nick});
201 my $crypto = $userList{$userHandle}{'pass'};
202 if (defined $crypto) {
203 $self->privmsg($sock,"Enter Password, $userHandle.");
205 $self->privmsg($sock,"Welcome to blootbot DCC CHAT interface, $userHandle.");
208 &status("${b_green}DCC $type$ob unknown ...");
213 my ($self, $event) = @_;
214 my $from = $event->from();
215 my $what = ($event->args)[0];
217 &status("disconnect from $from ($what).");
218 $ircstats{'DisconnectTime'} = time();
219 $ircstats{'DisconnectReason'} = $what;
220 $ircstats{'DisconnectCount'}++;
222 # clear any variables on reconnection.
226 if (!$self->connect()) {
227 &WARN("not connected? help me. gonna call ircCheck() in 1800s");
228 $conn->schedule(1800, \&ircCheck(), "");
233 my ($self, $event) = @_;
234 my $chan = ($event->args)[1];
236 if (exists $jointime{$chan}) {
237 my $delta_time = sprintf("%.03f", &gettimeofday() - $jointime{$chan});
238 $delta_time = 0 if ($delta_time < 0);
240 &status("$b_blue$chan$ob: sync in ${delta_time}s.");
243 rawout("MODE $chan");
247 foreach ("o","v","") {
248 my $count = scalar(keys %{$channels{$chan}{$_}});
249 next unless ($count);
251 $txt = "total" if ($_ eq "");
252 $txt = "voice" if ($_ eq "v");
253 $txt = "ops" if ($_ eq "o");
255 push(@array, "$count $txt");
257 my $chanstats = join(' || ', @array);
258 &status("$b_blue$chan$ob: [$chanstats]");
260 if (scalar @joinchan) { # remaining channels to join.
263 ### chanserv support.
264 ### TODO: what if we rejoin a channel.. need to set a var that
265 ### we've done the request-for-ops-on-join.
266 return unless (&IsParam("chanServ_ops"));
267 return unless ($nickserv);
269 my @chans = split(/[\s\t]+/, $param{'chanServ_ops'});
271 foreach $chan (keys %channels) {
272 next unless (grep /^$chan$/i, @chans);
274 if (!exists $channels{$chan}{'o'}{$ident}) {
275 &status("ChanServ ==> Requesting ops for $chan.");
276 rawout("PRIVMSG ChanServ :OP $chan $ident");
284 my ($self, $event) = @_;
285 my (@args) = ($event->args);
292 my ($self, $event) = @_;
293 my $chan = ($event->args)[0];
294 my $nick = $event->nick;
296 &DEBUG("on_invite: chan => '$chan', nick => '$nick'.");
298 # chan + possible_key.
299 ### do we need to know the key if we're invited???
300 ### grep the channel list?
301 foreach (split /[\s\t]+/, $param{'join_channels'}) {
302 next unless /^\Q$chan\E(,\S+)?$/i;
305 next if ($nick =~ /^\Q$ident\E$/);
306 if (&validChan($chan)) {
307 &msg($who, "i'm already in \002$chan\002.");
311 &status("invited to $b_blue$_$ob by $b_cyan$who$ob");
312 &joinchan($self, $_);
317 my ($self, $event) = @_;
318 my ($user,$host) = split(/\@/, $event->userhost);
319 $chan = lc( ($event->to)[0] ); # CASING!!!!
320 $who = $event->nick();
322 $chanstats{$chan}{'Join'}++;
323 $userstats{lc $who}{'Join'} = time() if (&IsParam("seenStats"));
327 if (exists $netsplit{lc $who}) {
328 delete $netsplit{lc $who};
332 # how to tell if there's a netjoin???
334 my $netsplitstr = "";
335 $netsplitstr = " $b_yellow\[${ob}NETSPLIT VICTIM$b_yellow]$ob" if ($netsplit);
336 &status(">>> join/$b_blue$chan$ob $b_cyan$who$ob $b_yellow($ob$user\@$host$b_yellow)$ob$netsplitstr");
338 $channels{$chan}{''}{$who}++;
339 $nuh{lc $who} = $who."!".$user."\@".$host unless (exists $nuh{lc $who});
342 &rootWarn($who,$user,$host,$chan)
343 if (&IsParam("rootWarn") &&
344 $user =~ /^r(oo|ew|00)t$/i &&
345 $channels{$chan}{'o'}{$ident});
347 # used to determine sync time.
348 if ($who =~ /^$ident$/i) {
349 if (defined( my $whojoin = $joinverb{$chan} )) {
350 &msg($chan, "Okay, I'm here. (courtesy of $whojoin)");
351 delete $joinverb{$chan};
354 ### TODO: move this to &joinchan()?
355 $jointime{$chan} = &gettimeofday();
358 ### TODO: this may go wild on a netjoin :)
365 my ($self, $event) = @_;
366 my ($chan,$reason) = $event->args;
367 my $kicker = $event->nick;
368 my $kickee = ($event->to)[0];
369 my $uh = $event->userhost();
371 &status(">>> kick/$b_blue$chan$ob [$b$kickee!$uh$ob] by $b_cyan$kicker$ob $b_yellow($ob$reason$b_yellow)$ob");
373 $chanstats{$chan}{'Kick'}++;
375 if ($kickee eq $ident) {
376 &clearChanVars($chan);
378 &status("SELF attempting to rejoin lost channel $chan");
381 &DeleteUserInfo($kickee,$chan);
386 my ($self, $event) = @_;
387 my ($user, $host) = split(/\@/, $event->userhost);
388 my @args = $event->args();
389 my $nick = $event->nick();
390 my $chan = ($event->to)[0];
394 if ($nick eq $chan) { # UMODE
395 &status(">>> mode $b_yellow\[$ob$b@args$b_yellow\]$ob by $b_cyan$nick$ob");
397 &status(">>> mode/$b_blue$chan$ob $b_yellow\[$ob$b@args$b_yellow\]$ob by $b_cyan$nick$ob");
398 &hookMode($chan, @args);
403 my ($self, $event) = @_;
404 my $nick = $event->nick();
405 my ($myself,$chan,@args) = $event->args();
407 &hookMode(lc $chan, @args); # CASING.
411 my ($self, $event) = @_;
412 my $nick = $event->nick;
413 my $chan = lc ( ($event->to)[0] ); # CASING.
414 my $msg = ($event->args)[0];
416 ($user,$host) = split(/\@/, $event->userhost);
417 $uh = $event->userhost();
418 $nuh = $nick."!".$uh;
420 &hookMsg('private', $chan, $nick, $msg);
424 my ($self, $event) = @_;
425 my @args = $event->args;
426 my $chan = lc $args[2]; # CASING, the last of them!
428 foreach (split / /, @args[3..$#args]) {
429 $channels{$chan}{'o'}{$_}++ if s/\@//;
430 $channels{$chan}{'v'}{$_}++ if s/\+//;
431 $channels{$chan}{''}{$_}++;
436 my ($self, $event) = @_;
437 my $nick = $event->nick();
438 my $newnick = ($event->args)[0];
440 if (exists $netsplit{lc $newnick}) {
441 &DEBUG("on_nick: $newnick/$nick came back from netsplit and changed to original nick! removing from hash.");
442 delete $netsplit{lc $newnick};
446 foreach $chan (keys %channels) {
447 foreach $mode (keys %{$channels{$chan}}) {
448 next unless (exists $channels{$chan}{$mode}{$nick});
450 $channels{$chan}{$mode}{$newnick} = $channels{$chan}{$mode}{$nick};
453 &DeleteUserInfo($nick,keys %channels);
454 $nuh{lc $newnick} = $nuh{lc $nick};
455 delete $nuh{lc $nick};
457 # successful self-nick change.
458 if ($nick eq $ident) {
459 &status(">>> I materialized into $b_green$newnick$ob from $nick");
462 &status(">>> $b_cyan$nick$ob materializes into $b_green$newnick$ob");
468 my $nick = $self->nick;
469 my $newnick = substr($nick,0,7)."-";
471 &status("nick taken; changing to temporary nick.");
477 my ($self, $event) = @_;
478 my $nick = $event->nick();
479 my $chan = ($event->to)[0];
480 my $args = ($event->args)[0];
482 if ($nick =~ /^NickServ$/i) { # nickserv.
483 &status("NickServ: <== '$args'");
485 if ($args =~ /^This nickname is registered/i) {
486 &status("nickserv told us to register; doing it.");
487 if (&IsParam("nickServ_pass")) {
488 &status("NickServ: ==> Identifying.");
489 &rawout("PRIVMSG NickServ :IDENTIFY $param{'nickServ_pass'}");
492 &status("We can't tell nickserv a passwd ;(");
497 if ($args =~ /^Password a/i) {
500 } elsif ($nick =~ /^ChanServ$/i) { # chanserv.
501 &status("ChanServ: <== '$args'.");
503 if ($chan =~ /^$mask{chan}$/) { # channel notice.
504 &status("-$nick/$chan- $args");
506 $server = $nick unless (defined $server);
507 &status("-$nick- $args"); # private or server notice.
513 my ($self, $event) = @_;
514 my $chan = ($event->to)[0];
515 my $nick = $event->nick;
517 &status("!!! other called.");
518 &status("!!! $event->args");
522 my ($self, $event) = @_;
523 my $chan = lc( ($event->to)[0] ); # CASING!!!
524 my $nick = $event->nick;
525 my $userhost = $event->userhost;
527 $chanstats{$chan}{'Part'}++;
528 &DeleteUserInfo($nick,$chan);
529 &clearChanVars($chan) if ($nick eq $ident);
530 if (!&IsNickInAnyChan($nick) and &IsParam("seenStats")) {
531 delete $userstats{lc $nick};
534 &status(">>> part/$b_blue$chan$ob $b_cyan$nick$ob $b_yellow($ob$userhost$b_yellow)$ob");
538 my ($self, $event) = @_;
539 my $nick = $event->nick;
541 $self->ctcp_reply($nick, join(' ', ($event->args)));
542 &status(">>> ${b_green}CTCP PING$ob request from $b_cyan$nick$ob received.");
546 my ($self, $event) = @_;
547 my $nick = $event->nick;
548 my $lag = time() - ($event->args)[1];
550 &status(">>> ${b_green}CTCP PING$ob reply from $b_cyan$nick$ob: $lag sec.");
554 my ($self, $event) = @_;
555 my $msg = ($event->args)[0];
556 my $chan = lc( ($event->to)[0] ); # CASING.
557 my $nick = $event->nick;
558 $uh = $event->userhost();
559 $nuh = $nick."!".$uh;
560 ($user,$host) = split(/\@/, $uh);
563 if ($statcount < 200) {
564 foreach $chan (grep /[A-Z]/, keys %channels) {
565 &DEBUG("leak: chan => '$chan'.");
567 foreach $i (keys %{$channels{$chan}}) {
568 foreach (keys %{$channels{$chan}{$i}}) {
569 &DEBUG("leak: \$channels{$chan}{$i}{$_} ...");
577 $lastWho{$chan} = $nick;
578 ### TODO: use $nick or lc $nick?
579 if (&IsParam("seenStats")) {
580 $userstats{lc $nick}{'Count'}++;
581 $userstats{lc $nick}{'Time'} = time();
584 # if (&IsParam("hehCounter")) {
588 &hookMsg('public', $chan, $nick, $msg);
589 $chanstats{$chan}{'PublicMsg'}++;
593 my ($self, $event) = @_;
594 my $nick = $event->nick();
595 my $reason = ($event->args)[0];
597 foreach (keys %channels) {
598 # fixes inconsistent chanstats bug #1.
599 next unless (&IsNickInChan($nick,$_));
600 $chanstats{$_}{'SignOff'}++;
602 &DeleteUserInfo($nick, keys %channels);
603 if (exists $nuh{lc $nick}) {
604 delete $nuh{lc $nick};
606 &DEBUG("on_quit: nuh{lc $nick} does not exist! FIXME");
608 delete $userstats{lc $nick} if (&IsParam("seenStats"));
610 # should fix chanstats inconsistencies bug #2.
611 if ($reason=~/^($mask{host})\s($mask{host})$/) { # netsplit.
612 $reason = "NETSPLIT: $1 <=> $2";
614 $netsplit{lc $nick} = time();
615 if (!exists $netsplitservers{$1}{$2}) {
616 &status("netsplit detected between $1 and $2.");
617 $netsplitservers{$1}{$2} = time();
621 &status(">>> $b_cyan$nick$ob has signed off IRC $b_red($ob$reason$b_red)$ob");
622 if ($nick =~ /^\Q$ident\E$/) {
623 &DEBUG("!!! THIS SHOULD NEVER HAPPEN. FIXME HOPEFULLY");
625 if ($nick !~ /^\Q$ident\E$/ and $nick =~ /^\Q$param{'ircNick'}\E$/i) {
626 &status("own nickname became free; changing.");
627 &nick($param{'ircNick'});
631 sub on_targettoofast {
632 my ($self, $event) = @_;
633 my $nick = $event->nick();
634 my $chan = ($event->to)[0];
636 &DEBUG("on_targettoofast: nick => '$nick'.");
637 &DEBUG("on_targettoofast: chan => '$chan'.");
639 foreach ($event->args) {
640 &DEBUG("on_targettoofast: args => '$_'.");
643 ### .* wait (\d+) second/) {
647 &status("going to sleep for $sleep...");
654 my ($self, $event) = @_;
656 if (scalar($event->args) == 1) { # change.
657 my $topic = ($event->args)[0];
658 my $chan = ($event->to)[0];
659 my $nick = $event->nick();
663 # race condition here. To fix, change '1' to '0'.
664 # This will keep track of topics set by bot only.
667 # this may be fixed at a later date with topic queueing.
670 $topic{$chan}{'Current'} = $topic if (1 and &IsParam("topic") == 1);
671 $chanstats{$chan}{'Topic'}++;
673 &status(">>> topic/$b_blue$chan$ob by $b_cyan$nick$ob -> $topic");
675 my ($nick, $chan, $topic) = $event->args;
676 if (&IsParam("topic")) {
677 $topic{$chan}{'Current'} = $topic;
678 &topicAddHistory($chan,$topic);
681 $topic = &fixString($topic, 1);
682 &status(">>> topic/$b_blue$chan$ob is $topic");
687 my ($self, $event) = @_;
688 my ($myself,$chan,$setby,$time) = $event->args();
691 if (time() - $time > 60*60*24) {
692 $timestr = "at ". localtime $time;
694 $timestr = &Time2String(time() - $time) ." ago";
697 &status(">>> set by $b_cyan$setby$ob $timestr");
701 my ($self, $event) = @_;
702 my $nick = $event->nick;
704 &status(">>> ${b_green}CTCP VERSION$ob request from $b_cyan$nick$ob");
705 $self->ctcp_reply($nick, "VERSION $bot_version");
709 my ($self, $event) = @_;
710 my @args = $event->args;
712 $nuh{lc $args[5]} = $args[5]."!".$args[2]."\@".$args[3];
716 my ($self, $event) = @_;
717 my @args = $event->args;
719 $nuh{lc $args[1]} = $args[1]."!".$args[2]."\@".$args[3];
722 #######################################################################
723 ####### IRC HOOK HELPERS IRC HOOK HELPERS IRC HOOK HELPERS ########
724 #######################################################################
727 # Usage: &hookMode($chan, $modes, @targets);
729 my ($chan, $modes, @targets) = @_;
732 $chan = lc $chan; # !!!.
735 foreach $mode (split(//, $modes)) {
737 if ($mode =~ /[-+]/) {
738 $parity = 1 if ($mode eq "+");
739 $parity = 0 if ($mode eq "-");
744 if ($mode =~ /[bklov]/) {
745 my $target = shift @targets;
748 $chanstats{$chan}{'Op'}++ if ($mode eq "o");
749 $chanstats{$chan}{'Ban'}++ if ($mode eq "b");
751 $chanstats{$chan}{'Deop'}++ if ($mode eq "o");
752 $chanstats{$chan}{'Unban'}++ if ($mode eq "b");
755 # modes w/ target affecting nick => cache it.
756 if ($mode =~ /[ov]/) {
757 $channels{$chan}{$mode}{$target}++ if $parity;
758 delete $channels{$chan}{$mode}{$target} if !$parity;
761 if ($mode =~ /[l]/) {
762 $channels{$chan}{$mode} = $target if $parity;
763 delete $channels{$chan}{$mode} if !$parity;
767 # important channel modes, targetless.
768 if ($mode =~ /[mt]/) {
769 $channels{$chan}{$mode}++ if $parity;
770 delete $channels{$chan}{$mode} if !$parity;
776 ($msgType, $chan, $who, $message) = @_;
780 $orig{message} = $message;
784 $message =~ s/[\cA-\c_]//ig; # strip control characters
785 $message =~ s/^\s+//; # initial whitespaces.
786 $who =~ tr/A-Z/a-z/; # lowercase.
791 if ($msgType =~ /private/) {
796 # addressing revamped by the xk.
797 ### below needs to be fixed...
798 if (&IsParam("addressCharacter")) {
799 if ($message =~ s/^$param{'addressCharacter'}//) {
805 if ($message =~ /^($mask{nick})([\;\:\>\, ]+) */) {
807 if ($1 =~ /^\Q$ident\E$/i) {
808 $message = $newmessage;
811 # ignore messages addressed to other people or unaddressed.
812 $skipmessage++ if ($2 ne "" and $2 !~ /^ /);
817 # Determine floodwho.
818 if ($msgType =~ /public/i) { # public.
819 $floodwho = lc $chan;
820 } elsif ($msgType =~ /private/i) { # private.
823 &DEBUG("FIXME: floodwho = ???");
826 my ($count, $interval) = split(/:/, $param{'floodRepeat'} || "2:10");
828 # flood repeat protection.
830 my $time = $flood{$floodwho}{$message};
832 if (defined $time and (time - $time < $interval)) {
833 ### public != personal who so the below is kind of pointless.
835 foreach (keys %flood) {
836 next if (/^\Q$floodwho\E$/ or /^\Q$chan\E$/);
837 push(@who, grep /^\Q$message\E$/i, keys %{$flood{$_}});
840 &msg($who, "you already said what ".join(@who)." have said.");
842 &msg($who,"Someone already said that ". (time - $time) ." seconds ago" );
845 ### TODO: delete old floodwarn{} keys.
847 if (!exists $floodwarn{$floodwho}) {
850 $floodwarn++ if (time() - $floodwarn{$floodwho} > $interval);
854 &status("FLOOD repetition detected from $floodwho.");
855 $floodwarn{$floodwho} = time();
862 &status("$b_cyan$who$ob is short-addressing me");
864 &status("$b_cyan$who$ob is addressing me");
867 $flood{$floodwho}{$message} = time();
870 ($count, $interval) = split(/:/, $param{'floodMessages'} || "5:30");
871 # flood overflow protection.
873 foreach (keys %{$flood{$floodwho}}) {
874 next unless (time() - $flood{$floodwho}{$_} > $interval);
875 delete $flood{$floodwho}{$_};
878 my $i = scalar keys %{$flood{$floodwho}};
880 &msg($who,"overflow of messages ($i > $count)");
881 &status("FLOOD overflow detected from $floodwho; ignoring");
883 my $expire = $param{'ignoreAutoExpire'} || 5;
884 $ignoreList{"*!$uh"} = time() + ($expire * 60);
888 $flood{$floodwho}{$message} = time();
892 if ($msgType =~ /public/i) {
893 $talkchannel = $chan;
894 &status("<$orig{who}/$chan> $orig{message}");
898 if ($msgType =~ /private/i) {
899 &status("[$orig{who}] $orig{message}");
902 if ((!$skipmessage or &IsParam("seenStoreAll")) and
906 $seencache{$who}{'time'} = time();
907 $seencache{$who}{'nick'} = $orig{who};
908 $seencache{$who}{'host'} = $uh;
909 $seencache{$who}{'chan'} = $talkchannel;
910 $seencache{$who}{'msg'} = $orig{message};
911 $seencache{$who}{'msgcount'}++;
914 return if ($skipmessage);
915 return unless (&IsParam("minVolunteerLength") or $addressed);
918 foreach (keys %ignoreList) {
920 my @parts = split /\*/, "a${ignoreRE}a";
921 my $recast = join '\S*', map quotemeta($_), @parts;
922 $recast =~ s/^a(.*)a$/$1/;
923 if ($nuh =~ /^$recast$/) {
930 $userHandle = &verifyUser($who, $nuh);
932 &DEBUG("hookMsg: 'nuh' not defined?");
935 ### For extra debugging purposes...
936 if ($_ = &process()) {
937 # &DEBUG("IrcHooks: process returned '$_'.");