From f70e771000decebf1c4837ac0d98bdde5ef44fbd Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 5 Feb 2017 22:23:20 -0800 Subject: [PATCH] unreal: ignore userpairs with only a prefix and no user How is this even possible?! Reported by @koaxirc. (cherry picked from commit 9fac7cb1f321e154f3b99038b5bc2c66fef15e31) --- protocols/unreal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/protocols/unreal.py b/protocols/unreal.py index 1486c6d..06e5174 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -617,12 +617,18 @@ class UnrealProtocol(TS6BaseProtocol): else: r = re.search(r'([^\w]*)(.*)', userpair) user = r.group(2) + + if not user: + # Userpair with no user? Ignore. XXX: find out how this is even possible... + # <- :002 SJOIN 1486361658 #idlerpg :@ + continue + user = self._getUid(user) # Normalize nicks to UIDs for Unreal 3.2 links # Unreal uses slightly different prefixes in SJOIN. +q is * instead of ~, # and +a is ~ instead of &. modeprefix = (r.group(1) or '').replace("~", "&").replace("*", "~") finalprefix = '' - assert user, 'Failed to get the UID from %r; our regex needs updating?' % userpair + log.debug('(%s) handle_sjoin: got modeprefix %r for user %r', self.irc.name, modeprefix, user) for m in modeprefix: # Iterate over the mapping of prefix chars to prefixes, and