From: dms Date: Sat, 3 Feb 2001 14:23:08 +0000 (+0000) Subject: looks like the final touches to fully exploit dynamic configuration have been made X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4edea0c0fdb65b21fe13486ad976606fcd4a4783;p=infobot.git looks like the final touches to fully exploit dynamic configuration have been made git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@319 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index edfa0aa..b590d0b 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -189,10 +189,10 @@ sub on_dcc { \*DCCGET ); } elsif ($type eq 'GET') { # SEND for us? - &DEBUG("starting get."); + &status("DCC: Initializing SEND for $nick."); $self->new_send($event->args); } elsif ($type eq 'CHAT') { - &DEBUG("starting chat."); + &status("DCC: Initializing CHAT for $nick."); $self->new_chat($event); } else { &WARN("${b_green}DCC $type$ob (1)"); @@ -370,19 +370,16 @@ sub on_init { sub on_invite { my ($self, $event) = @_; - my $chan = ($event->args)[0]; + my $chan = lc( ($event->args)[0] ); my $nick = $event->nick; - &DEBUG("on_invite: chan => '$chan', nick => '$nick'."); - - # chan + possible_key. - ### do we need to know the key if we're invited??? - ### grep the channel list? - foreach (split /[\s\t]+/, $param{'join_channels'}) { - next unless /^\Q$chan\E(,\S+)?$/i; - s/,/ /; + if ($nick =~ /^\Q$ident\E$/) { + &DEBUG("on_invite: self invite."); + return; + } - next if ($nick =~ /^\Q$ident\E$/); + ### TODO: join key. + if (exists $chanconf{$chan}) { if (&validChan($chan)) { &msg($who, "i'm already in \002$chan\002."); next; @@ -981,15 +978,17 @@ sub hookMsg { } # Determine floodwho. + my $c = "_default"; if ($msgType =~ /public/i) { # public. - $floodwho = lc $chan; + $floodwho = $c = lc $chan; } elsif ($msgType =~ /private/i) { # private. $floodwho = lc $who; } else { # dcc? &DEBUG("FIXME: floodwho = ???"); } - my ($count, $interval) = split(/:/, $param{'floodRepeat'} || "2:10"); + my $val = &getChanConfDefault("floodRepeat", "2:10", $c); + my ($count, $interval) = split /:/, $val; # flood repeat protection. if ($addressed) { @@ -1034,7 +1033,9 @@ sub hookMsg { $flood{$floodwho}{$message} = time(); } - ($count, $interval) = split(/:/, $param{'floodMessages'} || "5:30"); + $val = &getChanConfDefault("floodMessages", "5:30", $c); + ($count, $interval) = split /:/, $val; + # flood overflow protection. if ($addressed) { foreach (keys %{$flood{$floodwho}}) {