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("Changing 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{'DisconnectReason'} = $what;
220 # clear any variables on reconnection.
224 if (!$self->connect()) {
225 &WARN("not connected? help me. gonna call ircCheck() in 1800s");
226 $conn->schedule(1800, \&ircCheck(), "");
231 my ($self, $event) = @_;
232 my $chan = ($event->args)[1];
234 if (exists $jointime{$chan}) {
235 my $delta_time = sprintf("%.03f", &gettimeofday() - $jointime{$chan});
236 $delta_time = 0 if ($delta_time < 0);
238 &status("$b_blue$chan$ob: sync in ${delta_time}s.");
241 rawout("MODE $chan");
245 foreach ("o","v","") {
246 my $count = scalar(keys %{$channels{$chan}{$_}});
247 next unless ($count);
249 $txt = "total" if ($_ eq "");
250 $txt = "voice" if ($_ eq "v");
251 $txt = "ops" if ($_ eq "o");
253 push(@array, "$count $txt");
255 my $chanstats = join(' || ', @array);
256 &status("$b_blue$chan$ob: [$chanstats]");
258 if (scalar @joinchan) { # remaining channels to join.
261 ### chanserv support.
262 ### TODO: what if we rejoin a channel.. need to set a var that
263 ### we've done the request-for-ops-on-join.
264 return unless (&IsParam("chanServ_ops"));
265 return unless ($nickserv);
267 my @chans = split(/[\s\t]+/, $param{'chanServ_ops'});
269 foreach $chan (keys %channels) {
270 next unless (grep /^$chan$/i, @chans);
272 if (!exists $channels{$chan}{'o'}{$ident}) {
273 &status("ChanServ ==> Requesting ops for $chan.");
274 rawout("PRIVMSG ChanServ :OP $chan $ident");
282 my ($self, $event) = @_;
283 my (@args) = ($event->args);
290 my ($self, $event) = @_;
291 my $chan = ($event->args)[0];
292 my $nick = $event->nick;
294 &DEBUG("on_invite: chan => '$chan', nick => '$nick'.");
296 # chan + possible_key.
297 ### do we need to know the key if we're invited???
298 ### grep the channel list?
299 foreach (split /[\s\t]+/, $param{'join_channels'}) {
300 next unless /^\Q$chan\E(,\S+)?$/i;
303 next if ($nick =~ /^\Q$ident\E$/);
304 if (&validChan($chan)) {
305 &msg($who, "i'm already in \002$chan\002.");
309 &status("invited to $b_blue$_$ob by $b_cyan$who$ob");
310 &joinchan($self, $_);
315 my ($self, $event) = @_;
316 my ($user,$host) = split(/\@/, $event->userhost);
317 $chan = lc( ($event->to)[0] ); # CASING!!!!
318 $who = $event->nick();
320 $chanstats{$chan}{'Join'}++;
321 $userstats{lc $who}{'Join'} = time() if (&IsParam("seenStats"));
325 if (exists $netsplit{lc $who}) {
326 delete $netsplit{lc $who};
330 # how to tell if there's a netjoin???
332 my $netsplitstr = "";
333 $netsplitstr = " $b_yellow\[${ob}NETSPLIT VICTIM$b_yellow]$ob" if ($netsplit);
334 &status(">>> join/$b_blue$chan$ob $b_cyan$who$ob $b_yellow($ob$user\@$host$b_yellow)$ob$netsplitstr");
336 $channels{$chan}{''}{$who}++;
337 $nuh{lc $who} = $who."!".$user."\@".$host unless (exists $nuh{lc $who});
340 &rootWarn($who,$user,$host,$chan)
341 if (&IsParam("rootWarn") &&
342 $user =~ /^r(oo|ew|00)t$/i &&
343 $channels{$chan}{'o'}{$ident});
345 # used to determine sync time.
346 if ($who =~ /^$ident$/i) {
347 if (defined( my $whojoin = $joinverb{$chan} )) {
348 &msg($chan, "Okay, I'm here. (courtesy of $whojoin)");
349 delete $joinverb{$chan};
352 ### TODO: move this to &joinchan()?
353 $jointime{$chan} = &gettimeofday();
356 ### TODO: this may go wild on a netjoin :)
363 my ($self, $event) = @_;
364 my ($chan,$reason) = $event->args;
365 my $kicker = $event->nick;
366 my $kickee = ($event->to)[0];
367 my $uh = $event->userhost();
369 &status(">>> kick/$b_blue$chan$ob [$b$kickee!$uh$ob] by $b_cyan$kicker$ob $b_yellow($ob$reason$b_yellow)$ob");
371 $chanstats{$chan}{'Kick'}++;
373 if ($kickee eq $ident) {
374 &clearChanVars($chan);
376 &status("SELF attempting to rejoin lost channel $chan");
379 &DeleteUserInfo($kickee,$chan);
384 my ($self, $event) = @_;
385 my ($user, $host) = split(/\@/, $event->userhost);
386 my @args = $event->args();
387 my $nick = $event->nick();
388 my $chan = ($event->to)[0];
392 if ($nick eq $chan) { # UMODE
393 &status(">>> mode $b_yellow\[$ob$b@args$b_yellow\]$ob by $b_cyan$nick$ob");
395 &status(">>> mode/$b_blue$chan$ob $b_yellow\[$ob$b@args$b_yellow\]$ob by $b_cyan$nick$ob");
396 &hookMode($chan, @args);
401 my ($self, $event) = @_;
402 my $nick = $event->nick();
403 my ($myself,$chan,@args) = $event->args();
405 &hookMode(lc $chan, @args); # CASING.
409 my ($self, $event) = @_;
410 my $nick = $event->nick;
411 my $chan = lc ( ($event->to)[0] ); # CASING.
412 my $msg = ($event->args)[0];
414 ($user,$host) = split(/\@/, $event->userhost);
415 $uh = $event->userhost();
416 $nuh = $nick."!".$uh;
418 &hookMsg('private', $chan, $nick, $msg);
422 my ($self, $event) = @_;
423 my @args = $event->args;
424 my $chan = lc $args[2]; # CASING, the last of them!
426 foreach (split / /, @args[3..$#args]) {
427 $channels{$chan}{'o'}{$_}++ if s/\@//;
428 $channels{$chan}{'v'}{$_}++ if s/\+//;
429 $channels{$chan}{''}{$_}++;
434 my ($self, $event) = @_;
435 my $nick = $event->nick();
436 my $newnick = ($event->args)[0];
438 if (exists $netsplit{lc $newnick}) {
439 &DEBUG("on_nick: $newnick/$nick came back from netsplit and changed to original nick! removing from hash.");
440 delete $netsplit{lc $newnick};
444 foreach $chan (keys %channels) {
445 foreach $mode (keys %{$channels{$chan}}) {
446 next unless (exists $channels{$chan}{$mode}{$nick});
448 $channels{$chan}{$mode}{$newnick} = $channels{$chan}{$mode}{$nick};
451 &DeleteUserInfo($nick,keys %channels);
452 $nuh{lc $newnick} = $nuh{lc $nick};
453 delete $nuh{lc $nick};
455 # successful self-nick change.
456 if ($nick eq $ident) {
457 &status(">>> I materialized into $b_green$newnick$ob from $nick");
460 &status(">>> $b_cyan$nick$ob materializes into $b_green$newnick$ob");
466 my $nick = $self->nick;
467 my $newnick = substr($nick,0,7)."-";
469 &status("nick taken; changing to temporary nick.");
475 my ($self, $event) = @_;
476 my $nick = $event->nick();
477 my $chan = ($event->to)[0];
478 my $args = ($event->args)[0];
480 if ($nick =~ /^NickServ$/i) { # nickserv.
481 &status("NickServ: <== '$args'");
483 if ($args =~ /^This nickname is registered/i) {
484 &status("nickserv told us to register; doing it.");
485 if (&IsParam("nickServ_pass")) {
486 &status("NickServ: ==> Identifying.");
487 &rawout("PRIVMSG NickServ :IDENTIFY $param{'nickServ_pass'}");
490 &status("We can't tell nickserv a passwd ;(");
495 if ($args =~ /^Password a/i) {
498 } elsif ($nick =~ /^ChanServ$/i) { # chanserv.
499 &status("ChanServ: <== '$args'.");
501 if ($chan =~ /^$mask{chan}$/) { # channel notice.
502 &status("-$nick/$chan- $args");
504 $server = $nick unless (defined $server);
505 &status("-$nick- $args"); # private or server notice.
511 my ($self, $event) = @_;
512 my $chan = ($event->to)[0];
513 my $nick = $event->nick;
515 &status("!!! other called.");
516 &status("!!! $event->args");
520 my ($self, $event) = @_;
521 my $chan = lc( ($event->to)[0] ); # CASING!!!
522 my $nick = $event->nick;
523 my $userhost = $event->userhost;
525 $chanstats{$chan}{'Part'}++;
526 &DeleteUserInfo($nick,$chan);
527 &clearChanVars($chan) if ($nick eq $ident);
528 if (!&IsNickInAnyChan($nick) and &IsParam("seenStats")) {
529 delete $userstats{lc $nick};
532 &status(">>> part/$b_blue$chan$ob $b_cyan$nick$ob $b_yellow($ob$userhost$b_yellow)$ob");
536 my ($self, $event) = @_;
537 my $nick = $event->nick;
539 $self->ctcp_reply($nick, join(' ', ($event->args)));
540 &status(">>> ${b_green}CTCP PING$ob request from $b_cyan$nick$ob received.");
544 my ($self, $event) = @_;
545 my $nick = $event->nick;
546 my $lag = time() - ($event->args)[1];
548 &status(">>> ${b_green}CTCP PING$ob reply from $b_cyan$nick$ob: $lag sec.");
552 my ($self, $event) = @_;
553 my $msg = ($event->args)[0];
554 my $chan = lc( ($event->to)[0] ); # CASING.
555 my $nick = $event->nick;
556 $uh = $event->userhost();
557 $nuh = $nick."!".$uh;
558 ($user,$host) = split(/\@/, $uh);
561 if ($statcount < 200) {
562 foreach $chan (grep /[A-Z]/, keys %channels) {
563 &DEBUG("leak: chan => '$chan'.");
565 foreach $i (keys %{$channels{$chan}}) {
566 foreach (keys %{$channels{$chan}{$i}}) {
567 &DEBUG("leak: \$channels{$chan}{$i}{$_} ...");
575 $lastWho{$chan} = $nick;
576 ### TODO: use $nick or lc $nick?
577 if (&IsParam("seenStats")) {
578 $userstats{lc $nick}{'Count'}++;
579 $userstats{lc $nick}{'Time'} = time();
582 # if (&IsParam("hehCounter")) {
586 &hookMsg('public', $chan, $nick, $msg);
587 $chanstats{$chan}{'PublicMsg'}++;
591 my ($self, $event) = @_;
592 my $nick = $event->nick();
593 my $reason = ($event->args)[0];
595 foreach (keys %channels) {
596 # fixes inconsistent chanstats bug #1.
597 next unless (&IsNickInChan($nick,$_));
598 $chanstats{$_}{'SignOff'}++;
600 &DeleteUserInfo($nick, keys %channels);
601 if (exists $nuh{lc $nick}) {
602 delete $nuh{lc $nick};
604 &DEBUG("on_quit: nuh{lc $nick} does not exist! FIXME");
606 delete $userstats{lc $nick} if (&IsParam("seenStats"));
608 # should fix chanstats inconsistencies bug #2.
609 if ($reason=~/^($mask{host})\s($mask{host})$/) { # netsplit.
610 $reason = "NETSPLIT: $1 <=> $2";
612 $netsplit{lc $nick} = time();
613 if (!exists $netsplitservers{$1}{$2}) {
614 &status("netsplit detected between $1 and $2.");
615 $netsplitservers{$1}{$2} = time();
619 &status(">>> $b_cyan$nick$ob has signed off IRC $b_red($ob$reason$b_red)$ob");
620 if ($nick =~ /^\Q$ident\E$/) {
621 &DEBUG("!!! THIS SHOULD NEVER HAPPEN. FIXME HOPEFULLY");
623 if ($nick !~ /^\Q$ident\E$/ and $nick =~ /^\Q$param{'ircNick'}\E$/i) {
624 &status("own nickname became free; changing.");
625 &nick($param{'ircNick'});
629 sub on_targettoofast {
630 my ($self, $event) = @_;
631 my $nick = $event->nick();
632 my $chan = ($event->to)[0];
634 &DEBUG("on_targettoofast: nick => '$nick'.");
635 &DEBUG("on_targettoofast: chan => '$chan'.");
637 foreach ($event->args) {
638 &DEBUG("on_targettoofast: args => '$_'.");
641 ### .* wait (\d+) second/) {
645 &status("going to sleep for $sleep...");
652 my ($self, $event) = @_;
654 if (scalar($event->args) == 1) { # change.
655 my $topic = ($event->args)[0];
656 my $chan = ($event->to)[0];
657 my $nick = $event->nick();
661 # race condition here. To fix, change '1' to '0'.
662 # This will keep track of topics set by bot only.
665 # this may be fixed at a later date with topic queueing.
668 $topic{$chan}{'Current'} = $topic if (1 and &IsParam("topic") == 1);
669 $chanstats{$chan}{'Topic'}++;
671 &status(">>> topic/$b_blue$chan$ob by $b_cyan$nick$ob -> $topic");
673 my ($nick, $chan, $topic) = $event->args;
674 if (&IsParam("topic")) {
675 $topic{$chan}{'Current'} = $topic;
676 &topicAddHistory($chan,$topic);
679 $topic = &fixString($topic, 1);
680 &status(">>> topic/$b_blue$chan$ob is $topic");
685 my ($self, $event) = @_;
686 my ($myself,$chan,$setby,$time) = $event->args();
689 if (time() - $time > 60*60*24) {
690 $timestr = "at ". localtime $time;
692 $timestr = &Time2String(time() - $time) ." ago";
695 &status(">>> set by $b_cyan$setby$ob $timestr");
699 my ($self, $event) = @_;
700 my $nick = $event->nick;
702 &status(">>> ${b_green}CTCP VERSION$ob request from $b_cyan$nick$ob");
703 $self->ctcp_reply($nick, "VERSION $bot_version");
707 my ($self, $event) = @_;
708 my @args = $event->args;
710 $nuh{lc $args[5]} = $args[5]."!".$args[2]."\@".$args[3];
714 my ($self, $event) = @_;
715 my @args = $event->args;
717 $nuh{lc $args[1]} = $args[1]."!".$args[2]."\@".$args[3];
720 #######################################################################
721 ####### IRC HOOK HELPERS IRC HOOK HELPERS IRC HOOK HELPERS ########
722 #######################################################################
725 # Usage: &hookMode($chan, $modes, @targets);
727 my ($chan, $modes, @targets) = @_;
730 $chan = lc $chan; # !!!.
733 foreach $mode (split(//, $modes)) {
735 if ($mode =~ /[-+]/) {
736 $parity = 1 if ($mode eq "+");
737 $parity = 0 if ($mode eq "-");
742 if ($mode =~ /[bklov]/) {
743 my $target = shift @targets;
746 $chanstats{$chan}{'Op'}++ if ($mode eq "o");
747 $chanstats{$chan}{'Ban'}++ if ($mode eq "b");
749 $chanstats{$chan}{'Deop'}++ if ($mode eq "o");
750 $chanstats{$chan}{'Unban'}++ if ($mode eq "b");
753 # modes w/ target affecting nick => cache it.
754 if ($mode =~ /[ov]/) {
755 $channels{$chan}{$mode}{$target}++ if $parity;
756 delete $channels{$chan}{$mode}{$target} if !$parity;
759 if ($mode =~ /[l]/) {
760 $channels{$chan}{$mode} = $target if $parity;
761 delete $channels{$chan}{$mode} if !$parity;
765 # important channel modes, targetless.
766 if ($mode =~ /[mt]/) {
767 $channels{$chan}{$mode}++ if $parity;
768 delete $channels{$chan}{$mode} if !$parity;
774 ($msgType, $chan, $who, $message) = @_;
778 $orig{message} = $message;
782 $message =~ s/[\cA-\c_]//ig; # strip control characters
783 $message =~ s/^\s+//; # initial whitespaces.
784 $who =~ tr/A-Z/a-z/; # lowercase.
789 if ($msgType =~ /private/) {
794 # addressing revamped by the xk.
795 ### below needs to be fixed...
796 if (&IsParam("addressCharacter")) {
797 if ($message =~ s/^$param{'addressCharacter'}//) {
803 if ($message =~ /^($mask{nick})([\;\:\>\, ]+) */) {
805 if ($1 =~ /^\Q$ident\E$/i) {
806 $message = $newmessage;
809 # ignore messages addressed to other people or unaddressed.
810 $skipmessage++ if ($2 ne "" and $2 !~ /^ /);
815 # Determine floodwho.
816 if ($msgType =~ /public/i) { # public.
817 $floodwho = lc $chan;
818 } elsif ($msgType =~ /private/i) { # private.
821 &DEBUG("FIXME: floodwho = ???");
824 my ($count, $interval) = split(/:/, $param{'floodRepeat'} || "2:10");
826 # flood repeat protection.
828 my $time = $flood{$floodwho}{$message};
830 if (defined $time and (time - $time < $interval)) {
831 ### public != personal who so the below is kind of pointless.
833 foreach (keys %flood) {
834 next if (/^\Q$floodwho\E$/ or /^\Q$chan\E$/);
835 push(@who, grep /^\Q$message\E$/i, keys %{$flood{$_}});
838 &msg($who, "you already said what ".join(@who)." have said.");
840 &msg($who,"Someone already said that ". (time - $time) ." seconds ago" );
843 ### TODO: delete old floodwarn{} keys.
845 if (!exists $floodwarn{$floodwho}) {
848 $floodwarn++ if (time() - $floodwarn{$floodwho} > $interval);
852 &status("FLOOD repetition detected from $floodwho.");
853 $floodwarn{$floodwho} = time();
860 &status("$b_cyan$who$ob is short-addressing me");
862 &status("$b_cyan$who$ob is addressing me");
865 $flood{$floodwho}{$message} = time();
868 ($count, $interval) = split(/:/, $param{'floodMessages'} || "5:30");
869 # flood overflow protection.
871 foreach (keys %{$flood{$floodwho}}) {
872 next unless (time() - $flood{$floodwho}{$_} > $interval);
873 delete $flood{$floodwho}{$_};
876 my $i = scalar keys %{$flood{$floodwho}};
878 &msg($who,"overflow of messages ($i > $count)");
879 &status("FLOOD overflow detected from $floodwho; ignoring");
881 my $expire = $param{'ignoreAutoExpire'} || 5;
882 $ignoreList{"*!$uh"} = time() + ($expire * 60);
886 $flood{$floodwho}{$message} = time();
890 if ($msgType =~ /public/i) {
891 $talkchannel = $chan;
892 &status("<$orig{who}/$chan> $orig{message}");
896 if ($msgType =~ /private/i) {
897 &status("[$orig{who}] $orig{message}");
900 if ((!$skipmessage or &IsParam("seenStoreAll")) and
904 $seencache{$who}{'time'} = time();
905 $seencache{$who}{'nick'} = $orig{who};
906 $seencache{$who}{'host'} = $uh;
907 $seencache{$who}{'chan'} = $talkchannel;
908 $seencache{$who}{'msg'} = $orig{message};
909 $seencache{$who}{'msgcount'}++;
912 return if ($skipmessage);
913 return unless (&IsParam("minVolunteerLength") or $addressed);
916 foreach (keys %ignoreList) {
918 my @parts = split /\*/, "a${ignoreRE}a";
919 my $recast = join '\S*', map quotemeta($_), @parts;
920 $recast =~ s/^a(.*)a$/$1/;
921 if ($nuh =~ /^$recast$/) {
928 $userHandle = &verifyUser($who, $nuh);
930 &DEBUG("hookMsg: 'nuh' not defined?");
933 ### For extra debugging purposes...
934 if ($_ = &process()) {
935 # &DEBUG("IrcHooks: process returned '$_'.");