From 990a928602785b186d9757650de5d3f9b21c1ea0 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 2 Jul 2017 22:06:50 -0700 Subject: [PATCH 1/4] relay: re-add 'CLAIM #channel -' This was mistakenly removed in d51c39935118223a3e7087c821af50e52ff152fd due to a merge conflict, oops... (cherry picked from commit 62669c085dad8b6e9ea057fe2b130535af1b0a52) --- plugins/relay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/relay.py b/plugins/relay.py index e0ebf0d..c63ddc3 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -2081,7 +2081,10 @@ def claim(irc, source, args): irc.reply('Channel \x02%s\x02 is claimed by: %s' % (channel, ', '.join(claimed) or '\x1D(none)\x1D')) else: - claimed = set(nets.split(',')) + if nets == '-' or not nets: + claimed = set() + else: + claimed = set(nets.split(',')) db[relay]["claim"] = claimed irc.reply('CLAIM for channel \x02%s\x02 set to: %s' % (channel, ', '.join(claimed) or '\x1D(none)\x1D')) From d2d176b6f97579eb2541832a2e4278f54a9a594e Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 5 Jul 2017 02:07:49 -0700 Subject: [PATCH 2/4] IRCS2SProtocol: fix UnboundLocalError in "message coming from wrong way" warning This fixes a regression from 69cf21c04e7fed2e3c3eff27e012f1b76e6a174b. --- protocols/ircs2s_common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/protocols/ircs2s_common.py b/protocols/ircs2s_common.py index d636cc6..83c37a2 100644 --- a/protocols/ircs2s_common.py +++ b/protocols/ircs2s_common.py @@ -48,10 +48,6 @@ class IRCS2SProtocol(Protocol): sender = self.irc.uplink args.insert(0, sender) - if self.irc.isInternalClient(sender) or self.irc.isInternalServer(sender): - log.warning("(%s) Received command %s being routed the wrong way!", self.irc.name, command) - return - raw_command = args[1].upper() args = args[2:] @@ -62,6 +58,10 @@ class IRCS2SProtocol(Protocol): if command != raw_command: log.debug('(%s) Translating token %s to command %s', self.irc.name, raw_command, command) + if self.irc.isInternalClient(sender) or self.irc.isInternalServer(sender): + log.warning("(%s) Received command %s being routed the wrong way!", self.irc.name, command) + return + if command == 'ENCAP': # Special case for TS6 encapsulated commands (ENCAP), in forms like this: # <- :00A ENCAP * SU 42XAAAAAC :GLolol From 69f3ae52ec1d63a5982373ff614034961ee33936 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 5 Jul 2017 02:09:55 -0700 Subject: [PATCH 3/4] ts6: fix wrong argument count when parsing INVITE ts (cherry picked from commit 7cfc63d6edcd218da82d75e2032359b50cc9891a) --- protocols/ts6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/ts6.py b/protocols/ts6.py index 8249e28..44925ad 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -638,7 +638,7 @@ class TS6Protocol(TS6BaseProtocol): target = args[0] channel = self.irc.toLower(args[1]) try: - ts = args[3] + ts = args[2] except IndexError: ts = int(time.time()) # We don't actually need to process this; it's just something plugins/hooks can use From 1acd654e6e491fdae3bd0974e7dd2467901b4724 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 5 Jul 2017 02:10:24 -0700 Subject: [PATCH 4/4] ts6: fix 'ts' value type in handle_invite --- protocols/ts6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/ts6.py b/protocols/ts6.py index 44925ad..9128b33 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -638,7 +638,7 @@ class TS6Protocol(TS6BaseProtocol): target = args[0] channel = self.irc.toLower(args[1]) try: - ts = args[2] + ts = int(args[2]) except IndexError: ts = int(time.time()) # We don't actually need to process this; it's just something plugins/hooks can use