if (exists $netsplit{lc $who}) {
delete $netsplit{lc $who};
$netsplit = 1;
- &netsplitCheck() if (time() != $sched{netsplitCheck}{TIME});
+
+ if (!scalar keys %netsplit) {
+ &DEBUG("on_join: netsplit hash is now empty!");
+ undef %netsplitservers;
+ &netsplitCheck(); # any point in running this?
+ &chanlimitCheck();
+ }
}
if ($netsplit and !exists $cache{netsplit}) {
### on-join bans.
my @bans;
push(@bans, keys %{ $bans{$chan} }) if (exists $bans{$chan});
- push(@bans, keys %{ $bans{"*"} }) if (exists $bans{"*"});
+ push(@bans, keys %{ $bans{"*"} }) if (exists $bans{"*"});
+
foreach (@bans) {
my $ban = $_;
s/\?/./g;
}
### ROOTWARN:
- &rootWarn($who,$user,$host,$chan)
- if (&IsChanConf("rootWarn") &&
- $user =~ /^r(oo|ew|00)t$/i &&
- $channels{$chan}{'o'}{$ident});
+ &rootWarn($who,$user,$host,$chan) if (
+ &IsChanConf("rootWarn") &&
+ $user =~ /^r(oo|ew|00)t$/i
+ );
### NEWS:
if (&IsChanConf("news") && &IsChanConf("newsKeepRead")) {
sub on_modeis {
my ($self, $event) = @_;
- my $nick = $event->nick();
my ($myself, undef,@args) = $event->args();
+ my $nick = $event->nick();
$chan = ($event->args())[1];
&hookMode($nick, @args);
if ($check) {
&status("nickserv told us to register; doing it.");
+
if (&IsParam("nickServ_pass")) {
&status("NickServ: ==> Identifying.");
&rawout("PRIVMSG NickServ :IDENTIFY $param{'nickServ_pass'}");
}
} elsif ($nick =~ /^ChanServ$/i) { # chanserv.
&status("ChanServ: <== '$args'.");
+
} else {
if ($chan =~ /^$mask{chan}$/) { # channel notice.
&status("-$nick/$chan- $args");
$chanstats{$chan}{'Part'}++;
&delUserInfo($nick,$chan);
- &clearChanVars($chan) if ($nick eq $ident);
+ if ($nick eq $ident) {
+ &DEBUG("on_part: ok, I left $chan... clearChanVars...");
+ &clearChanVars($chan);
+ }
+
if (!&IsNickInAnyChan($nick) and &IsChanConf("seenStats")) {
delete $userstats{lc $nick};
}
$userstats{lc $nick}{'Time'} = time();
}
-# if (&IsChanConf("hehCounter")) {
-# #...
-# }
+ # would this slow things down?
+ if ($_ = &getChanConf("ircTextCounters")) {
+ foreach (split /[\s]+/) {
+ next unless ($msg =~ /^\Q$_\E$/i);
+ &status("textcounters: $_ matched for $who");
+
+ my $v = &dbGet("stats", "counter", "nick='$who' and type='$msg'");
+ $v++;
+
+ &dbReplace("stats", (nick => $who, type => $_, counter => $v) );
+ # does not work, atleast with old mysql!!! :(
+# &dbReplace("stats", (nick => $who, type => $_, -counter => "counter+1") );
+ }
+ }
&hookMsg('public', $chan, $nick, $msg);
$chanstats{$chan}{'PublicMsg'}++;
if (exists $nuh{lc $nick}) {
delete $nuh{lc $nick};
} else {
- &DEBUG("on_quit: nuh{lc $nick} does not exist! FIXME");
+ # well.. it's good but weird that this has happened - lets just
+ # be quiet about it.
}
delete $userstats{lc $nick} if (&IsChanConf("seenStats"));
delete $chanstats{lc $nick};
$reason = "NETSPLIT: $1 <=> $2";
# chanlimit code.
- if (&ChanConfList("chanlimitcheck") and !scalar keys %netsplit) {
- &DEBUG("on_quit: netsplit detected on $chan; disabling chan limit.");
- &rawout("MODE $chan -l");
+ my @l = &getNickInChans($nick);
+ &DEBUG("on_quit: l => ".scalar(@l) );
+
+ foreach $chan ( &getNickInChans($nick) ) {
+ next unless ( &IsChanConf("chanlimitcheck") );
+ next unless ( exists $channels{$_}{'l'} );
+
+ &DEBUG("on_quit: netsplit detected on $_; disabling chan limit.");
+ &rawout("MODE $_ -l");
}
$netsplit{lc $nick} = time();