From 14bd999ada56e20ffc355ef32d7a8a0bbf9d1032 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Tue, 26 Jun 2007 09:17:21 +0000 Subject: new commands, users, hilights, rules, bugfixes, and all sorts of other good stuff --- modules/inspect.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'modules/inspect.pl') diff --git a/modules/inspect.pl b/modules/inspect.pl index 3837ba9..76b520f 100644 --- a/modules/inspect.pl +++ b/modules/inspect.pl @@ -4,16 +4,18 @@ use strict; use List::Util qw(first); #my @ignored = (); +@::ignored = (); sub inspect { our ($conn, $event) = @_; my (%conx, %monx); our (%aonx, %dct, $rev, $chan, $id); - %aonx=(); %dct=(); $rev=""; $chan=""; $id=""; + %aonx=(); %dct=(); $rev; $chan=""; $id=""; my (@dnsbl, @unpakt, @uniq, @cut); my ($match, $txtz, $iaddr); my @override = []; our $unmode=''; + my $nick = lc $event->{nick}; return if (defined(first { ( lc $event->{nick} eq lc $_ ) } @::eline)); return if (defined(first { ( lc $event->{user} eq lc $_ ) } @::eline)); return if (defined(first { ( lc $event->{host} eq lc $_ ) } @::eline)); @@ -21,9 +23,9 @@ sub inspect { $rev = join('.', reverse(unpack('C4', $iaddr))).'.' if (defined $iaddr); %monx = defined($::channels->{channel}->{master}->{event}) ? %{$::channels->{channel}->{master}->{event}} : (); ## NB: isn't there a better way to do this with grep, somehow? -# foreach ( @ignored ) { -# return if (lc $event->{nick} eq $_); -# } + foreach ( @::ignored ) { + return if (lc $event->{nick} eq $_); + } foreach $chan ( @{$event->{to}} ) { next unless $chan =~ /^#/; %conx = defined($::channels->{channel}->{lc $chan}->{event}) ? %{$::channels->{channel}->{lc $chan}->{event}} : (); @@ -42,6 +44,7 @@ sub inspect { delete $dct{$_} foreach @override; foreach $chan (@{$event->{to}}) { foreach $id ( keys %dct ) { + sql_record($chan, $event->{nick}, $event->{user}, $event->{host}, $dct{$id}{risk}, $id, $dct{$id}{reason}); $txtz = "$dct{$id}{risk} risk threat: ". "Detected $event->{nick} $dct{$id}{reason} in $chan "; $txtz = $txtz . commaAndify(getAlert(lc $chan, $dct{$id}{risk}, 'hilights')) if (getAlert(lc $chan, $dct{$id}{risk}, 'hilights')); @@ -59,8 +62,8 @@ sub inspect { } } $conn->privmsg($_, $txtz) foreach getAlert($chan, $dct{$id}{risk}, 'msgs'); -# push(@ignored, lc $event->{nick}); -# $conn->schedule(10, sub { @ignored = grep { $_ ne lc $event->{nick} } @ignored; }); + push(@::ignored, lc $event->{nick}); + $conn->schedule(15, sub { @::ignored = grep { lc $_ ne lc $nick } @::ignored; }); } } } -- cgit v1.2.3