From 8878f776366386111434d4c9c871f0a89b211208 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 6 Jan 2017 21:56:22 -0800 Subject: [PATCH] updateTS: don't save any broken TS values lower than 750000 Workaround for #385, and other related timestamp issues caused by the TS value getting cut off in mode messages (#283) (cherry picked from commit ba330bbfac5c542bb2fc0661d01e1fd203253308) --- classes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/classes.py b/classes.py index 1320ea4..0ef809a 100644 --- a/classes.py +++ b/classes.py @@ -1295,9 +1295,12 @@ class Protocol(): _apply() elif (their_ts < our_ts): - log.debug('(%s) Resetting channel TS of %s from %s to %s (remote has lower TS)', - self.irc.name, channel, our_ts, their_ts) - self.irc.channels[channel].ts = their_ts + if their_ts < 750000: + log.warning('(%s) Possible desync? Not setting bogus TS %s on channel %s', self.irc.name, their_ts, channel) + else: + log.debug('(%s) Resetting channel TS of %s from %s to %s (remote has lower TS)', + self.irc.name, channel, our_ts, their_ts) + self.irc.channels[channel].ts = their_ts # Remote TS was lower and we're receiving modes. Clear the modelist and apply theirs.