summaryrefslogtreecommitdiffstats
path: root/lib/ASM/Event.pm
diff options
context:
space:
mode:
authorLibravatarJanik Kleinhoff <ilbelkyr@shalture.org>2016-10-28 13:48:16 +0000
committerLibravatarJanik Kleinhoff <ilbelkyr@shalture.org>2016-10-28 14:12:19 +0000
commit3dda2775b73b29ca72f3996eb5788124950f9e70 (patch)
tree0a02aeffbfee3392c1d38e79338291cfea7cd771 /lib/ASM/Event.pm
parent546df459147cf5842724d88428794eaf296cb879 (diff)
Use DBIx::Class
For now this is a relatively quick-and-dirty transition, but this enables us to reuse ASM::DB from the website. Yay
Diffstat (limited to 'lib/ASM/Event.pm')
-rw-r--r--lib/ASM/Event.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ASM/Event.pm b/lib/ASM/Event.pm
index fac5c06..5e0435c 100644
--- a/lib/ASM/Event.pm
+++ b/lib/ASM/Event.pm
@@ -222,8 +222,8 @@ sub on_part
my $nick = lc $event->{nick};
my $chan = lc $event->{to}->[0];
# Ignore channels that are +s and not monitored
- if (defined $::db and $event->{args}->[0] =~ /^requested by/ and (not ((grep { /^s$/ } @{$::sc{$chan}{modes}} ) && ($::channels->{channel}->{$chan}->{monitor} eq "no"))) ) {
- my $idx = $::db->actionlog( $event);
+ if ($event->{args}->[0] =~ /^requested by/ and (not ((grep { /^s$/ } @{$::sc{$chan}{modes}} ) && ($::channels->{channel}->{$chan}->{monitor} eq "no"))) ) {
+ my $idx = $::log->actionlog( $event);
$::log->sqlIncident($chan, $idx) if $idx;
}
if (defined($::sn{$nick}) && defined($::sn{$nick}->{mship})) {
@@ -299,7 +299,7 @@ sub on_quit
}
$event->{to} = \@channels;
if (defined $::db) {
- my $idx = $::db->actionlog($event);
+ my $idx = $::log->actionlog($event);
# Ignore channels that are +s and not monitored
my @actionlog_channels = grep { not ((grep { /^s$/ } @{$::sc{$_}{modes}}) && ($::channels->{channel}->{$_}->{monitor} eq "no")) } @channels;
$::log->sqlIncident( join(',', @actionlog_channels), $idx ) if $idx;
@@ -425,7 +425,7 @@ sub on_kick {
if (defined $::db) {
# Ignore channels that are +s and not monitored
if ( not ((grep { /^s$/ } @{$::sc{$chan}{modes}}) && ($::channels->{channel}->{$chan}->{monitor} eq "no")) ) {
- my $idx = $::db->actionlog($event);
+ my $idx = $::log->actionlog($event);
$::log->sqlIncident($chan, $idx) if $idx;
}
}
@@ -567,7 +567,7 @@ sub on_mode
foreach my $victim (@affected) {
# Ignore channels that are +s and not monitored
if ( not ((grep { /^s$/ } @{$::sc{$chan}{modes}}) && ($::channels->{channel}->{$chan}->{monitor} eq "no")) ) {
- my $idx = $::db->actionlog($event, 'ban', $victim);
+ my $idx = $::log->actionlog($event, 'ban', $victim);
$::log->sqlIncident( $chan, $idx ) if $idx;
}
}
@@ -594,7 +594,7 @@ sub on_mode
foreach my $victim (@affected) {
# Ignore channels that are +s and not monitored
if ( not ((grep { /^s$/ } @{$::sc{$chan}{modes}}) && ($::channels->{channel}->{$chan}->{monitor} eq "no")) ) {
- my $idx = $::db->actionlog($event, 'quiet', $victim);
+ my $idx = $::log->actionlog($event, 'quiet', $victim);
$::log->sqlIncident( $chan, $idx ) if $idx;
}
}