diff options
| author | 2015-09-04 03:44:40 +0000 | |
|---|---|---|
| committer | 2015-09-04 03:44:40 +0000 | |
| commit | acdcedfa7099659be22df3dd57ec4926809dc1a6 (patch) | |
| tree | 0c1c03c2e0a6c98ef9f7a8f934f2d56a86b1f46e /modules/inspect.pl | |
| parent | 266be47956ae2ad397c52f26d00b88b5dc713da6 (diff) | |
Allow running without a database
This is mostly a workaround for the DB being a bit of a PITA to set up,
but not all we do requires a DB so we might as well offer to run without
one.
Diffstat (limited to 'modules/inspect.pl')
| -rw-r--r-- | modules/inspect.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/inspect.pl b/modules/inspect.pl index ea287ff..df515dc 100644 --- a/modules/inspect.pl +++ b/modules/inspect.pl @@ -74,7 +74,9 @@ sub inspect { return unless (ASM::Util->notRestricted($nick, "notrigger") && ASM::Util->notRestricted($nick, "no$id")); $xresult = $dct{$id}{xresult}; my $nicereason = interpolate($dct{$id}{reason}); - $::db->record($chan, $event->{nick}, $event->{user}, $event->{host}, $::sn{lc $event->{nick}}->{gecos}, $dct{$id}{risk}, $id, $nicereason); + if (defined $::db) { + $::db->record($chan, $event->{nick}, $event->{user}, $event->{host}, $::sn{lc $event->{nick}}->{gecos}, $dct{$id}{risk}, $id, $nicereason); + } $txtz = "\x03" . $::RCOLOR{$::RISKS{$dct{$id}{risk}}} . "\u$dct{$id}{risk}\x03 risk threat [\x02$chan\x02] - ". "\x02$event->{nick}\x02 - ${nicereason}; ping "; $txtz = $txtz . ASM::Util->commaAndify(ASM::Util->getAlert(lc $chan, $dct{$id}{risk}, 'hilights')) if (ASM::Util->getAlert(lc $chan, $dct{$id}{risk}, 'hilights')); |
