3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-02 15:44:06 +01:00

protocols: also validate TS on incoming SJOIN

This commit is contained in:
James Lu 2015-08-26 14:30:35 -07:00
parent 977b69b8e9
commit 80bebe3827
2 changed files with 4 additions and 2 deletions

View File

@ -407,7 +407,8 @@ def handle_fjoin(irc, servernumeric, command, args):
modeprefix, user = user.split(',', 1)
namelist.append(user)
irc.users[user].channels.add(channel)
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in modeprefix])
if their_ts <= our_ts:
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in modeprefix])
irc.channels[channel].users.add(user)
return {'channel': channel, 'users': namelist, 'modes': parsedmodes, 'ts': their_ts}

View File

@ -422,7 +422,8 @@ def handle_sjoin(irc, servernumeric, command, args):
finalprefix += char
namelist.append(user)
irc.users[user].channels.add(channel)
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in finalprefix])
if their_ts <= our_ts:
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in finalprefix])
irc.channels[channel].users.add(user)
return {'channel': channel, 'users': namelist, 'modes': parsedmodes, 'ts': their_ts}