From 7f829ba0ec22ffcf85a3389d9e0cf7adc7982bd1 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 24 Jun 2016 13:15:26 -0700 Subject: [PATCH] updateTS: apply TS on channel regardless of whether mode changes pass --- classes.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/classes.py b/classes.py index 9e421be..248f4e9 100644 --- a/classes.py +++ b/classes.py @@ -1069,15 +1069,15 @@ class Protocol(): """ def _clear(): - log.debug('(%s) Setting channel TS of %s to %s from %s', - self.irc.name, channel, their_ts, our_ts) - self.irc.channels[channel].ts = their_ts - + log.debug("(%s) Clearing modes from channel %s due to TS change", self.irc.name, + channel) self.irc.channels[channel].modes.clear() for p in self.irc.channels[channel].prefixmodes.values(): p.clear() def _apply(): + log.debug("(%s) Applying modes on channel %s (TS ok)", self.irc.name, + channel) self.irc.applyModes(channel, modes) our_ts = self.irc.channels[channel].ts @@ -1088,6 +1088,12 @@ class Protocol(): # the one setting modes, just drop them. log.debug("(%s/%s) remote TS of %s is lower than ours %s; outbound mode: %s; setting modes %s", self.irc.name, channel, their_ts, our_ts, outbound, modes) + + # Update the channel TS to theirs regardless of whether the mode setting passes. + log.debug('(%s) Setting channel TS of %s to %s from %s', + self.irc.name, channel, their_ts, our_ts) + self.irc.channels[channel].ts = their_ts + if not outbound: _clear() _apply()