summaryrefslogtreecommitdiffstats
path: root/modules/inspect.pl
diff options
context:
space:
mode:
authorLibravataricxcnika <icxcnika@antispammeta.net>2014-04-22 23:46:10 +0400
committerLibravataricxcnika <icxcnika@antispammeta.net>2014-04-22 23:46:10 +0400
commitac56812a5a79b5187a89cb7dcd9078c11ffed54e (patch)
tree8b0cd4718ec93d76127793c2ee2dc2914253b9c0 /modules/inspect.pl
parent02ce9f49538d6a89c6562708a0ac2871b2d46dc3 (diff)
added some things in gitignore,
added connection tx/rx info to status reports, added exit, sync, and ping commands, bot says which channel a restricted person tries to use ops command on, blacklist system is more intelligent (reason, person adding, can be removed), added functionality for working with URLs, automatically retries to join channels that are throttled, make sure we send passwords to NickServ@services., fixed a scheduling loophole that was exploitable, greatly reduced startup warnings due to slow syncing
Diffstat (limited to 'modules/inspect.pl')
-rw-r--r--modules/inspect.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/inspect.pl b/modules/inspect.pl
index 3b72a3a..f5914cb 100644
--- a/modules/inspect.pl
+++ b/modules/inspect.pl
@@ -17,7 +17,7 @@ sub new
}
sub inspect {
- our ($self, $conn, $event) = @_;
+ our ($self, $conn, $event, $response) = @_;
my (%aonx, %dct, $rev, $chan, $id);
%aonx=(); %dct=(); $chan=""; $id="";
my (@dnsbl, @uniq);
@@ -43,7 +43,14 @@ sub inspect {
foreach $id (keys %aonx) {
next unless ( grep { $event->{type} eq $_ } split(/[,:; ]+/, $aonx{$id}{type}) );
next if ($aonx{$id}{class} eq 'dnsbl') && ($event->{host} =~ /(fastwebnet\.it|fastres\.net)$/); #this is a bad hack
- $xresult = $::classes->check($aonx{$id}{class}, $aonx{$id}, $id, $event, $chan, $rev); # this is another bad hack done for dnsbl-related stuff
+ if (defined($response)) {
+ print Dumper($response);
+ if ($aonx{$id}{class} ne 'urlcrunch') { next; } #don't run our regular checks if this is being called from a URL checking function
+ else { $xresult = $::classes->check($aonx{$id}{class}, $aonx{$id}, $id, $event, $chan, $response); }
+ }
+ else {
+ $xresult = $::classes->check($aonx{$id}{class}, $aonx{$id}, $id, $event, $chan, $rev); # this is another bad hack done for dnsbl-related stuff
+ }
next unless (defined($xresult)) && ($xresult ne 0);
ASM::Util->dprint(Dumper($xresult), 'inspector');
$dct{$id} = $aonx{$id};
@@ -81,10 +88,10 @@ sub inspect {
) {
my @tgts = ASM::Util->getAlert($chan, $dct{$id}{risk}, 'msgs');
ASM::Util->sendLongMsg($conn, \@tgts, $txtz);
+ $conn->schedule(45, sub { delete($::ignored{$chan})}) unless defined($::ignored{$chan});
$::ignored{$chan} = $::RISKS{$dct{$id}{risk}};
- $conn->schedule(45, sub { delete($::ignored{$chan})});
}
- $::log->incident($chan, "$chan: $dct{$id}{risk} risk: $event->{nick} - $nicereason\n");
+# $::log->incident($chan, "$chan: $dct{$id}{risk} risk: $event->{nick} - $nicereason\n");
delete $dct{$id}{xresult};
}
}