diff --git a/classes.py b/classes.py index 39dd7c3..4c72ce1 100644 --- a/classes.py +++ b/classes.py @@ -1087,6 +1087,8 @@ class Protocol(): self.irc.applyModes(channel, modes) our_ts = self.irc.channels[channel].ts + assert type(our_ts) == int, "Wrong type for our_ts (expected int, got %s)" % type(our_ts) + assert type(their_ts) == int, "Wrong type for our_ts (expected int, got %s)" % type(their_ts) if their_ts < our_ts: # Their TS is older than ours. We should clear our stored modes for the channel and diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 2804f5a..1391baa 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -106,6 +106,8 @@ class InspIRCdProtocol(TS6BaseProtocol): # Strip out list-modes, they shouldn't ever be sent in FJOIN (protocol rules). modes = modes or self.irc.channels[channel].modes + orig_ts = self.irc.channels[channel].ts + ts = ts or orig_ts banmodes = [] regularmodes = [] @@ -148,8 +150,6 @@ class InspIRCdProtocol(TS6BaseProtocol): self._send(server, "FMODE {channel} {ts} {modes} ".format( ts=ts, channel=channel, modes=self.irc.joinModes(banmodes))) - orig_ts = self.irc.channels[channel].ts - ts = ts or orig_ts self.updateTS(channel, ts, changedmodes) def _operUp(self, target, opertype=None): diff --git a/protocols/nefarious.py b/protocols/nefarious.py index 8cb3d7e..cb7266d 100644 --- a/protocols/nefarious.py +++ b/protocols/nefarious.py @@ -475,6 +475,8 @@ class P10Protocol(Protocol): # <- AB B #test2 1460743539 +l 10 ABAAA:vo :%*!*@bad.host # <- AB B #test 1460747615 ABAAA:o :% ~ *!*@test.host modes = modes or self.irc.channels[channel].modes + orig_ts = self.irc.channels[channel].ts + ts = ts or orig_ts bans = [] exempts = [] @@ -560,8 +562,6 @@ class P10Protocol(Protocol): self.irc.channels[channel].users.update(changedusers) - orig_ts = self.irc.channels[channel].ts - ts = ts or orig_ts self.updateTS(channel, ts, changedmodes) def spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0): diff --git a/protocols/ts6.py b/protocols/ts6.py index daba1d4..0164334 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -101,6 +101,8 @@ class TS6Protocol(TS6BaseProtocol): raise LookupError('No such PyLink client exists.') modes = set(modes or self.irc.channels[channel].modes) + orig_ts = self.irc.channels[channel].ts + ts = ts or orig_ts # Get all the ban modes in a separate list. These are bursted using a separate BMASK # command. @@ -151,8 +153,6 @@ class TS6Protocol(TS6BaseProtocol): self._send(server, "BMASK {ts} {channel} {bmode} :{bans}".format(ts=ts, channel=channel, bmode=bmode, bans=' '.join(bans))) - orig_ts = self.irc.channels[channel].ts - ts = ts or orig_ts self.updateTS(channel, ts, changedmodes) def mode(self, numeric, target, modes, ts=None): diff --git a/protocols/unreal.py b/protocols/unreal.py index 3417eb1..a78c4ec 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -148,6 +148,8 @@ class UnrealProtocol(TS6BaseProtocol): raise LookupError('No such PyLink server exists.') changedmodes = set(modes or self.irc.channels[channel].modes) + orig_ts = self.irc.channels[channel].ts + ts = ts or orig_ts uids = [] namelist = [] @@ -184,8 +186,6 @@ class UnrealProtocol(TS6BaseProtocol): self.irc.channels[channel].users.update(uids) - orig_ts = self.irc.channels[channel].ts - ts = ts or orig_ts self.updateTS(channel, ts, changedmodes) def ping(self, source=None, target=None):