3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

unreal: normalize whitespace in SJOIN as well

Sometimes there is an extra space after the mode list, so the query looks like

<- :000 SJOIN 1234567890 #channel +ntf [10t]:5  :000AAAAAA 000AAAAAB

instead of

<- :000 SJOIN 1234567890 #channel +ntf [10t]:5 :000AAAAAA 000AAAAAB
This commit is contained in:
James Lu 2017-01-01 19:53:41 -08:00
parent 4a519832e0
commit 945fc8f0f9

View File

@ -578,7 +578,11 @@ class UnrealProtocol(TS6BaseProtocol):
parsedmodes = []
try:
if args[2].startswith('+'):
parsedmodes = self.irc.parseModes(channel, args[2:-1] or args[2])
modestring = args[2:-1] or args[2]
# Strip extra spaces between the mode argument and the user list, if
# there are any. XXX: report this as a bug in unreal's s2s protocol?
modestring = [m for m in modestring if m]
parsedmodes = self.irc.parseModes(channel, modestring)
changedmodes = set(parsedmodes)
except IndexError:
pass
@ -679,7 +683,7 @@ class UnrealProtocol(TS6BaseProtocol):
channel = self.irc.toLower(args[0])
oldobj = self.irc.channels[channel].deepcopy()
modes = list(filter(None, args[1:])) # normalize whitespace
modes = [arg for arg in args[1:] if arg] # normalize whitespace
parsedmodes = self.irc.parseModes(channel, modes)
if parsedmodes: