summaryrefslogtreecommitdiffstats
path: root/modules/inspect.pl
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2007-06-26 09:17:21 +0000
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2007-06-26 09:17:21 +0000
commit14bd999ada56e20ffc355ef32d7a8a0bbf9d1032 (patch)
tree05e8351b5dca645e6fd6eaf86db5813227af4083 /modules/inspect.pl
parent7e08e2e87e3de903b8810a0bd357a45a65cc3b49 (diff)
new commands, users, hilights, rules, bugfixes, and all sorts of other good stuff
Diffstat (limited to 'modules/inspect.pl')
-rw-r--r--modules/inspect.pl15
1 files changed, 9 insertions, 6 deletions
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; });
}
}
}