3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

Merge branch 'master' into devel

This commit is contained in:
James Lu 2016-07-29 14:44:54 -07:00
commit 891039dba2
2 changed files with 13 additions and 8 deletions

View File

@ -1242,20 +1242,26 @@ class Protocol():
log.debug("(%s/%s) our_ts: %s; their_ts: %s; is the mode origin us? %s", self.irc.name,
channel, our_ts, their_ts, our_mode)
if our_mode:
# If the source is us, the TS being used by sjoin() should be considered our TS.
log.debug('(%s) Resetting channel TS of %s from %s to %s (outgoing)',
self.irc.name, channel, self.irc.channels[channel].ts, their_ts)
self.irc.channels[channel].ts = our_ts = their_ts
if their_ts == our_ts:
log.debug("(%s/%s) remote TS of %s is equal to our %s; mode query %s",
self.irc.name, channel, their_ts, our_ts, modes)
# Their TS is equal to ours. Merge modes.
_apply()
elif ((their_ts < our_ts) and (not our_mode)) or ((our_ts < their_ts) and our_mode):
winning_ts = min(our_ts, their_ts)
log.debug('(%s) Resetting channel TS of %s from %s to %s',
self.irc.name, channel, self.irc.channels[channel].ts, winning_ts)
self.irc.channels[channel].ts = winning_ts
elif (their_ts < our_ts) and (not our_mode):
log.debug('(%s) Resetting channel TS of %s from %s to %s (incoming)',
self.irc.name, channel, self.irc.channels[channel].ts, their_ts)
self.irc.channels[channel].ts = their_ts
if not our_mode: # Skip clearing if we're the one setting the mode.
_clear()
# Remote TS was lower and we're receiving modes. Clear the modelist an apply theirs.
_clear()
_apply()
def _getSid(self, sname):

View File

@ -428,7 +428,6 @@ class TS6Protocol(TS6BaseProtocol):
modestring = args[2:-1] or args[2]
parsedmodes = self.irc.parseModes(channel, modestring)
self.irc.applyModes(channel, parsedmodes)
namelist = []
# Keep track of other modes that are added due to prefix modes being joined too.