From a73ccb8276861dab3fcba34c2783122655947844 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Thu, 21 Jan 2016 16:46:34 -0700 Subject: Have the Inspect/opalert routines print a backlog to an incident-specific logfile, rather than a single file, and include a shortlink to this logfile when generating alerts --- lib/ASM/Commander.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/ASM/Commander.pm') diff --git a/lib/ASM/Commander.pm b/lib/ASM/Commander.pm index 6d194d2..0098d32 100644 --- a/lib/ASM/Commander.pm +++ b/lib/ASM/Commander.pm @@ -7,6 +7,8 @@ use IO::All; use POSIX qw(strftime); use Data::Dumper; use URI::Escape; +use ASM::Shortener; + no if $] >= 5.017011, warnings => 'experimental::smartmatch'; my $cmdtbl = { @@ -880,9 +882,10 @@ sub cmd_ops { if ((time-$::sc{$tgt}{users}{lc $event->{nick}}{jointime}) > 90) { $txtz .= " ($msg) $hilite !att-$tgt-opalert"; } + my $uuid = $::log->incident($tgt, "$tgt: $event->{nick} requested op attention\n"); + $txtz = $txtz . ' ' . ASM::Shortener->shorturl($::settings->{web}->{detectdir} . $uuid . '.txt'); my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); ASM::Util->sendLongMsg($conn, \@tgts, $txtz); - $::log->incident($tgt, "$tgt: $event->{nick} requested op attention\n"); } else { unless (defined($::ignored{$tgt}) && ($::ignored{$tgt} >= $::RISKS{'opalert'})) { my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); -- cgit v1.2.3