summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2016-01-14 15:00:46 -0700
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2016-01-14 15:00:46 -0700
commit5d92725043195ba4ad9831b3489d65738b794d29 (patch)
tree64ba59b6c676f21f3ea9aa3572badda00626e811 /lib
parent8ff9ba40fcbfc00260466509c4cbb95d43f8b682 (diff)
Register services-processing handler inside the services module, rather than having it be called by the Event module
Diffstat (limited to 'lib')
-rw-r--r--lib/ASM/Event.pm1
-rw-r--r--lib/ASM/Services.pm6
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/ASM/Event.pm b/lib/ASM/Event.pm
index 3d7beb6..ca48f7e 100644
--- a/lib/ASM/Event.pm
+++ b/lib/ASM/Event.pm
@@ -365,7 +365,6 @@ sub on_notice
$::log->logg( $event );
$::db->logg( $event ) if defined $::db;
$::inspector->inspect( $conn, $event );
- $::services->doServices($conn, $event);
}
sub on_errnickinuse
diff --git a/lib/ASM/Services.pm b/lib/ASM/Services.pm
index 7e1df9d..b44b194 100644
--- a/lib/ASM/Services.pm
+++ b/lib/ASM/Services.pm
@@ -9,13 +9,17 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
sub new
{
+ my $module = shift;
+ my ($conn) = @_;
my $self = {};
+ $self->{CONN} = $conn;
bless($self);
+ $conn->add_handler('notice', \&doServices, "after");
return $self;
}
sub doServices {
- my ($self, $conn, $event) = @_;
+ my ($conn, $event) = @_;
my $i = 1;
if ($event->{from} eq 'NickServ!NickServ@services.')
{