From 0b695d73168af6a8444e1c0a0f4e6b0f85506fc4 Mon Sep 17 00:00:00 2001 From: Brian Sherson Date: Tue, 11 Mar 2014 18:48:59 -0700 Subject: Major changes --- autoexec.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'autoexec.py') diff --git a/autoexec.py b/autoexec.py index a699099..501ec2c 100644 --- a/autoexec.py +++ b/autoexec.py @@ -26,11 +26,12 @@ class Autoexec(object): if context in self.networks.keys(): raise BaseException, "Network already exists" self.networks[context] = irc.Config( - label=label, onconnect=onconnect, onregister=onregister, autojoin=irc.ChanList( + self, label=label, onconnect=onconnect, onregister=onregister, autojoin=irc.ChanList( autojoin, context=context), usermodes=usermodes, nsautojoin=irc.ChanList(nsautojoin, context=context), nsmatch=nsmatch, wallet=wallet, opername=opername, opermodes=opermodes, snomasks=snomasks, operexec=operexec, operjoin=irc.ChanList(operjoin, context=context), autorejoin=autorejoin) self._rejoinchannels[context] = None + return self.networks[context] def onDisconnect(self, context, expected): conf = self.networks[context] @@ -38,6 +39,11 @@ class Autoexec(object): self._rejoinchannels[context] = irc.ChanList( context.identity.channels, context=context) # Store a *copy* of the list of channels + def onQuit(self, context, user, quitmsg): + if user == context.identity and not context._quitexpected: + # Bot received a QUIT message for itself, and was not expected. + self.onDisconnect(context, False) + def onAddonRem(self, context): del self.networks[context], self._rejoinchannels[context] -- cgit v1.2.3