From 5d92725043195ba4ad9831b3489d65738b794d29 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Thu, 14 Jan 2016 15:00:46 -0700 Subject: Register services-processing handler inside the services module, rather than having it be called by the Event module --- lib/ASM/Event.pm | 1 - lib/ASM/Services.pm | 6 +++++- meta.pl | 2 +- 3 files changed, 6 insertions(+), 3 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.') { diff --git a/meta.pl b/meta.pl index 4591417..dd42b83 100755 --- a/meta.pl +++ b/meta.pl @@ -132,9 +132,9 @@ sub init { $conn->debugsock(1); } $::inspector = ASM::Inspect->new(); - $::services = ASM::Services->new(); $::event = ASM::Event->new($conn, $::inspector); $::commander = ASM::Commander->new($conn); + $::services = ASM::Services->new($conn); $::classes = ASM::Classes->new(); $::fifo = ASM::Fifo->new($irc, $conn); my @nickbl = io('nick_blacklist.txt')->getlines; -- cgit v1.2.3