summaryrefslogtreecommitdiff
path: root/autoexec.py
diff options
context:
space:
mode:
authorBrian Sherson <caretaker82@euclid.shersonb.net>2014-03-22 20:52:05 -0700
committerBrian Sherson <caretaker82@euclid.shersonb.net>2014-03-22 20:52:05 -0700
commit5c66d93f0ca04c06f3ed122772b9751b3dcc3f6e (patch)
tree0ec0aa59f5afb7588fe35c95d3d3495ec5b0d503 /autoexec.py
parent0b695d73168af6a8444e1c0a0f4e6b0f85506fc4 (diff)
Adding CAP support, ircapp.py with sample config, speeding up channel and user cache lookup.
Diffstat (limited to 'autoexec.py')
-rw-r--r--autoexec.py7
1 files changed, 3 insertions, 4 deletions
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