From c268f27308db3b028f41ce8897dd78437b7706b7 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Wed, 2 Mar 2011 22:02:46 -0700 Subject: [PATCH] Include this as well. --- lib/API/IRC.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/API/IRC.pm b/lib/API/IRC.pm index e2006df..d779704 100644 --- a/lib/API/IRC.pm +++ b/lib/API/IRC.pm @@ -11,6 +11,8 @@ our @ISA = qw(Exporter); our @EXPORT_OK = qw(ban cjoin cpart cmode umode kick privmsg notice quit nick names topic who usrc match_mask); +# Create the on_disconnect event. +API::Std::event_add('on_disconnect'); # Set a ban, based on config bantype value. sub ban @@ -188,12 +190,12 @@ sub quit { Auto::socksnd($svr, "QUIT :$reason"); } else { - Auto::socksnd($svr, "QUIT :Leaving"); + Auto::socksnd($svr, 'QUIT :Leaving'); } - - delete $Proto::IRC::got_001{$svr} if (defined $Proto::IRC::got_001{$svr}); - delete $Proto::IRC::botinfo{$svr} if (defined $Proto::IRC::botinfo{$svr}); - + + # Trigger on_disconnect. + API::Std::event_run('on_disconnect', $svr); + return 1; }