sub on_dcc_open_chat {
my(undef, $nick,$sock) = @_;
- &DEBUG("nuh{$nick} => $nuh{$nick}.");
- if ($nuh{$nick} =~ /^(\S+)(\d+)$/) {
- my $i = $2;
- $i++;
- $nuh{$nick} = $1.$i;
+ if ($nuh{$nick} eq "GETTING-NOW") {
&DEBUG("getting nuh for $nick failed. FIXME.");
return;
}
&status(">>> join/$b_blue$chan$ob $b_cyan$who$ob $b_yellow($ob$user\@$host$b_yellow)$ob$netsplitstr");
$channels{$chan}{''}{$who}++;
- $nuh{lc $who} = $who."!".$user."\@".$host unless (exists $nuh{lc $who});
-
- ### on-join ban. (TODO: kick)
- if (exists $bans{$chan}) {
- ### TODO: need to do $chan and _default
- foreach (keys %{ $bans{$chan} }) {
- s/\*/\\S*/g;
- next unless /^\Q$nuh\E$/i;
-
- foreach (keys %{ $channels{$chan}{'b'} }) {
- &DEBUG(" bans_on_chan($chan) => $_");
- }
-
- ### TODO: check $channels{$chan}{'b'} if ban already exists.
- &ban( "*!*@".&makeHostMask($host), $chan);
- last;
+ $nuh = $who."!".$user."\@".$host;
+ $nuh{lc $who} = $nuh unless (exists $nuh{lc $who});
+
+ ### on-join bans.
+ my @bans = keys %{ $bans{$chan} };
+ push(@bans, keys %{ $bans{"*"} });
+ foreach (@bans) {
+ s/\*/\\S*/g;
+ next unless /^\Q$nuh\E$/i;
+
+ ### TODO: check $channels{$chan}{'b'} if ban already exists.
+ foreach (keys %{ $channels{$chan}{'b'} }) {
+ &DEBUG(" bans_on_chan($chan) => $_");
}
+
+ ### TODO: kick
+ &ban( "*!*@".&makeHostMask($host), $chan);
+ last;
}
### ROOTWARN:
my $nick = $event->nick();
my $reason = ($event->args)[0];
+ my $count = 0;
foreach (keys %channels) {
# fixes inconsistent chanstats bug #1.
if (!&IsNickInChan($nick,$_)) {
- &DEBUG("on_quit: nick $nick was not in chan $_.");
+ $count++;
next;
}
$chanstats{$_}{'SignOff'}++;
}
+ if ($count == scalar keys %channels) {
+ &DEBUG("on_quit: nick $nick was not found in any chan.");
+ }
+
&DeleteUserInfo($nick, keys %channels);
if (exists $nuh{lc $nick}) {
my $nick = $event->nick();
my($me,$chan,$why) = $event->args();
+ ### TODO: incomplete.
### .* wait (\d+) second/) {
- &status("X1 $msg");
+ &status("on_ttf: X1 $msg") if (defined $msg);
my $sleep = 5;
&status("going to sleep for $sleep...");
sleep $sleep;
$flood{$floodwho}{$message} = time();
}
+ my @ignore;
if ($msgType =~ /public/i) { # public.
$talkchannel = $chan;
&status("<$orig{who}/$chan> $orig{message}");
+ @ignore = keys %{ $ignore{$chan} };
} elsif ($msgType =~ /private/i) { # private.
&status("[$orig{who}] $orig{message}");
$talkchannel = undef;
} else {
&DEBUG("unknown msgType => $msgType.");
}
+ push(@ignore, keys %{ $ignore{"*"} });
if ((!$skipmessage or &IsChanConf("seenStoreAll")) and
&IsChanConf("seen") and
return if ($skipmessage);
return unless (&IsParam("minVolunteerLength") or $addressed);
- local $ignore = 0;
- if (exists $ignore{lc $chan}) {
- foreach (keys %{ $ignore{lc $chan} }) {
- s/\*/\\S*/g;
+ foreach (@ignore) {
+ s/\*/\\S*/g;
- next unless ($nuh =~ /^\Q$_\E$/i);
- $ignore++;
- last;
- }
+ next unless (eval { $nuh =~ /^$_$/i });
+
+ &status("IGNORE <$who> $message");
+ return;
}
if (defined $nuh) {