mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-12 21:22:36 +01:00
protoocols.sjoinServer: only add prefix modes to channel state if our TS < theirs
This commit is contained in:
parent
3fc5896f82
commit
1d245bf001
@ -74,6 +74,8 @@ def sjoinServer(irc, server, channel, users, ts=None):
|
|||||||
orig_ts = irc.channels[channel].ts
|
orig_ts = irc.channels[channel].ts
|
||||||
ts = ts or orig_ts
|
ts = ts or orig_ts
|
||||||
if ts < orig_ts:
|
if ts < orig_ts:
|
||||||
|
# If the TS we're sending is lower than the one that existing, clear the
|
||||||
|
# mode lists from our channel state and reset the timestamp.
|
||||||
log.debug('(%s) sjoinServer: resetting TS of %r from %s to %s (clearing modes)',
|
log.debug('(%s) sjoinServer: resetting TS of %r from %s to %s (clearing modes)',
|
||||||
irc.name, channel, orig_ts, ts)
|
irc.name, channel, orig_ts, ts)
|
||||||
irc.channels[channel].ts = ts
|
irc.channels[channel].ts = ts
|
||||||
@ -99,7 +101,9 @@ def sjoinServer(irc, server, channel, users, ts=None):
|
|||||||
irc.users[user].channels.add(channel)
|
irc.users[user].channels.add(channel)
|
||||||
except KeyError: # Not initialized yet?
|
except KeyError: # Not initialized yet?
|
||||||
log.debug("(%s) sjoinServer: KeyError trying to add %r to %r's channel list?", irc.name, channel, user)
|
log.debug("(%s) sjoinServer: KeyError trying to add %r to %r's channel list?", irc.name, channel, user)
|
||||||
utils.applyModes(irc, channel, changedmodes)
|
if ts < orig_ts:
|
||||||
|
# Only save our prefix modes in the channel state if our TS is lower than theirs.
|
||||||
|
utils.applyModes(irc, channel, changedmodes)
|
||||||
namelist = ' '.join(namelist)
|
namelist = ' '.join(namelist)
|
||||||
_send(irc, server, "FJOIN {channel} {ts} {modes} :{users}".format(
|
_send(irc, server, "FJOIN {channel} {ts} {modes} :{users}".format(
|
||||||
ts=ts, users=namelist, channel=channel,
|
ts=ts, users=namelist, channel=channel,
|
||||||
|
@ -80,6 +80,8 @@ def sjoinServer(irc, server, channel, users, ts=None):
|
|||||||
orig_ts = irc.channels[channel].ts
|
orig_ts = irc.channels[channel].ts
|
||||||
ts = ts or orig_ts
|
ts = ts or orig_ts
|
||||||
if ts < orig_ts:
|
if ts < orig_ts:
|
||||||
|
# If the TS we're sending is lower than the one that existing, clear the
|
||||||
|
# mode lists from our channel state and reset the timestamp.
|
||||||
log.debug('(%s) sjoinServer: resetting TS of %r from %s to %s (clearing modes)',
|
log.debug('(%s) sjoinServer: resetting TS of %r from %s to %s (clearing modes)',
|
||||||
irc.name, channel, orig_ts, ts)
|
irc.name, channel, orig_ts, ts)
|
||||||
irc.channels[channel].ts = ts
|
irc.channels[channel].ts = ts
|
||||||
@ -115,7 +117,9 @@ def sjoinServer(irc, server, channel, users, ts=None):
|
|||||||
ts=ts, users=namelist, channel=channel,
|
ts=ts, users=namelist, channel=channel,
|
||||||
modes=utils.joinModes(modes)))
|
modes=utils.joinModes(modes)))
|
||||||
irc.channels[channel].users.update(uids)
|
irc.channels[channel].users.update(uids)
|
||||||
utils.applyModes(irc, channel, changedmodes)
|
if ts < orig_ts:
|
||||||
|
# Only save our prefix modes in the channel state if our TS is lower than theirs.
|
||||||
|
utils.applyModes(irc, channel, changedmodes)
|
||||||
|
|
||||||
def _sendModes(irc, numeric, target, modes, ts=None):
|
def _sendModes(irc, numeric, target, modes, ts=None):
|
||||||
utils.applyModes(irc, target, modes)
|
utils.applyModes(irc, target, modes)
|
||||||
|
Loading…
Reference in New Issue
Block a user