### TODO: prevent users without CRYPT chatting.
if (!defined $crypto) {
- &DEBUG("todo: dcc close chat");
+ &TODO("dcc close chat");
&msg($who, "nope, no guest logins allowed...");
return;
}
&DEBUG("chat: sock => '$sock'.");
### $sock->close();
delete $dcc{'CHAT'}{$nick};
- &DEBUG("chat: after closing sock. FIXME");
+ &FIXME("chat: after closing sock.");
### BUG: close seizes bot. why?
}
$ircstats{'ConnectTime'} = time();
$ircstats{'ConnectCount'}++;
if (defined $ircstats{'DisconnectTime'}) {
- ircstats{'OffTime'} += time() - $ircstats{'DisconnectTime'};
+ $ircstats{'OffTime'} += time() - $ircstats{'DisconnectTime'};
}
# first time run.
my(undef, $nick, $sock) = @_;
if ($nuh{$nick} eq "GETTING-NOW") {
- &DEBUG("getting nuh for $nick failed. FIXME.");
+ &FIXME("getting nuh for $nick failed.");
return;
}
my $crypto = $users{$userHandle}{PASS};
$dcc{'CHAT'}{$nick} = $sock;
- # todo: don't make DCC CHAT established in the first place.
+ # TODO: don't make DCC CHAT established in the first place.
if ($userHandle eq "_default") {
&dccsay($nick, "_default/guest not allowed");
$sock->close();
# clear any variables on reconnection.
$nickserv = 0;
- &DEBUG("on_disconnect: 1");
&clearIRCVars();
- &DEBUG("on_disconnect: 2");
if (!defined $self) {
&WARN("on_disconnect: self is undefined! WTF");
}
$chanstats{$chan}{'Join'}++;
- $userstats{lc $who}{'Join'} = time() if (&IsChanConf("seenStats"));
+ $userstats{lc $who}{'Join'} = time() if (&IsChanConf("seenStats") > 0);
$cache{maxpeeps}{$chan} = $i if ($i > $j);
&joinfloodCheck($who, $chan, $event->userhost);
$channels{$chan}{$mode}{$newnick} = $channels{$chan}{$mode}{$nick};
}
}
- # todo: do %flood* aswell.
+ # TODO: do %flood* aswell.
&delUserInfo($nick, keys %channels);
$nuh{lc $newnick} = $nuh{lc $nick};
sub on_notice {
my ($self, $event) = @_;
+ #$conn = $self; <- ugly hack or elegant solution?
my $nick = $event->nick();
my $chan = ($event->to)[0];
my $args = ($event->args)[0];
&clearChanVars($chan);
}
- if (!&IsNickInAnyChan($nick) and &IsChanConf("seenStats")) {
+ if (!&IsNickInAnyChan($nick) and &IsChanConf("seenStats") > 0) {
delete $userstats{lc $nick};
}
$uh = $event->userhost();
$nuh = $nick."!".$uh;
$msgType = "public";
- # todo: move this out of hookMsg to here?
+ # TODO: move this out of hookMsg to here?
($user,$host) = split(/\@/, $uh);
$h = $host;
$msgtime = time();
$lastWho{$chan} = $nick;
### TODO: use $nick or lc $nick?
- if (&IsChanConf("seenStats")) {
+ if (&IsChanConf("seenStats") > 0) {
$userstats{lc $nick}{'Count'}++;
$userstats{lc $nick}{'Time'} = time();
}
$v++;
# don't allow ppl to cheat the stats :-)
- if (defined $t && $time - $t > 60) {
+ if (defined $t && $time - $t > 60) {
&sqlReplace("stats", {
nick => $who,
type => $x,
# well.. it's good but weird that this has happened - lets just
# be quiet about it.
}
- delete $userstats{lc $nick} if (&IsChanConf("seenStats"));
+ delete $userstats{lc $nick} if (&IsChanConf("seenStats") > 0);
delete $chanstats{lc $nick};
###