summaryrefslogtreecommitdiff
path: root/autoexec.py
diff options
context:
space:
mode:
Diffstat (limited to 'autoexec.py')
-rw-r--r--autoexec.py8
1 files changed, 7 insertions, 1 deletions
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]