mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
unreal: ignore userpairs with only a prefix and no user
How is this even possible?! Reported by @koaxirc.
This commit is contained in:
parent
0b0efbaf9f
commit
9fac7cb1f3
@ -617,12 +617,18 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
else:
|
else:
|
||||||
r = re.search(r'([^\w]*)(.*)', userpair)
|
r = re.search(r'([^\w]*)(.*)', userpair)
|
||||||
user = r.group(2)
|
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
|
user = self._getUid(user) # Normalize nicks to UIDs for Unreal 3.2 links
|
||||||
# Unreal uses slightly different prefixes in SJOIN. +q is * instead of ~,
|
# Unreal uses slightly different prefixes in SJOIN. +q is * instead of ~,
|
||||||
# and +a is ~ instead of &.
|
# and +a is ~ instead of &.
|
||||||
modeprefix = (r.group(1) or '').replace("~", "&").replace("*", "~")
|
modeprefix = (r.group(1) or '').replace("~", "&").replace("*", "~")
|
||||||
finalprefix = ''
|
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)
|
log.debug('(%s) handle_sjoin: got modeprefix %r for user %r', self.irc.name, modeprefix, user)
|
||||||
for m in modeprefix:
|
for m in modeprefix:
|
||||||
# Iterate over the mapping of prefix chars to prefixes, and
|
# Iterate over the mapping of prefix chars to prefixes, and
|
||||||
|
Loading…
Reference in New Issue
Block a user