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

pr/: add prefixmodes in sjoinServer if TS <= theirs

The old comparison of our TS < theirs was wrong, because modes are merged (not dropped) when two channels of the same TS join.
This commit is contained in:
James Lu 2015-08-24 18:37:39 -07:00
parent af02af6b4a
commit 05be3e6c17
2 changed files with 4 additions and 4 deletions

View File

@ -101,8 +101,8 @@ def sjoinServer(irc, server, channel, users, ts=None):
irc.users[user].channels.add(channel)
except KeyError: # Not initialized yet?
log.debug("(%s) sjoinServer: KeyError trying to add %r to %r's channel list?", irc.name, channel, user)
if ts < orig_ts:
# Only save our prefix modes in the channel state if our TS is lower than theirs.
if ts <= orig_ts:
# Only save our prefix modes in the channel state if our TS is lower than or equal to theirs.
utils.applyModes(irc, channel, changedmodes)
namelist = ' '.join(namelist)
_send(irc, server, "FJOIN {channel} {ts} {modes} :{users}".format(

View File

@ -117,8 +117,8 @@ def sjoinServer(irc, server, channel, users, ts=None):
ts=ts, users=namelist, channel=channel,
modes=utils.joinModes(modes)))
irc.channels[channel].users.update(uids)
if ts < orig_ts:
# Only save our prefix modes in the channel state if our TS is lower than theirs.
if ts <= orig_ts:
# Only save our prefix modes in the channel state if our TS is lower than or equal to theirs.
utils.applyModes(irc, channel, changedmodes)
def _sendModes(irc, numeric, target, modes, ts=None):