From 5c66d93f0ca04c06f3ed122772b9751b3dcc3f6e Mon Sep 17 00:00:00 2001 From: Brian Sherson Date: Sat, 22 Mar 2014 20:52:05 -0700 Subject: Adding CAP support, ircapp.py with sample config, speeding up channel and user cache lookup. --- autoexec.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'autoexec.py') diff --git a/autoexec.py b/autoexec.py index 501ec2c..0b30894 100644 --- a/autoexec.py +++ b/autoexec.py @@ -19,15 +19,14 @@ class Autoexec(object): self._rejoinchannels = {} # Saved channels for when a connection is lost - def onAddonAdd(self, context, label, onconnect=None, onregister=None, autojoin=None, usermodes=None, nsautojoin=None, nsmatch=None, wallet=None, opername=None, opermodes=None, snomasks=None, operexec=None, operjoin=None, autorejoin=True): + def onAddonAdd(self, context, label, onconnect=[], onregister=[], autojoin=[], usermodes=None, nsautojoin=[], nsmatch=None, wallet=None, opername=None, opermodes=None, snomasks=None, operexec=None, operjoin=[], autorejoin=True): labels = [v.label for v in self.networks.values()] if label in labels: raise BaseException, "Label already exists" if context in self.networks.keys(): raise BaseException, "Network already exists" self.networks[context] = irc.Config( - self, label=label, onconnect=onconnect, onregister=onregister, autojoin=irc.ChanList( - autojoin, context=context), + self, label=label, onconnect=list(onconnect), onregister=list(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 @@ -35,7 +34,7 @@ class Autoexec(object): def onDisconnect(self, context, expected): conf = self.networks[context] - if conf.autorejoin and not expected and context.identity: + if conf.autorejoin and not expected and context.identity and context.identity.channels: self._rejoinchannels[context] = irc.ChanList( context.identity.channels, context=context) # Store a *copy* of the list of channels -- cgit v1.2.3