3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

unreal: warn about mode bounces instead of fighting with the uplink

This commit is contained in:
James Lu 2016-06-22 22:33:09 -07:00
parent f2b139c828
commit 2936e94f50

View File

@ -652,10 +652,21 @@ class UnrealProtocol(TS6BaseProtocol):
if utils.isChannel(args[0]):
channel = self.irc.toLower(args[0])
oldobj = self.irc.channels[channel].deepcopy()
modes = list(filter(None, args[1:])) # normalize whitespace
parsedmodes = self.irc.parseModes(channel, modes)
if parsedmodes:
if parsedmodes[0][0] == '+&':
# UnrealIRCd uses a & virtual mode to denote mode bounces, meaning that an attempt to set modes
# by us was rejected for some reason (usually due to timestamps). Warn about this and drop the
# mode change to prevent mode floods.
log.warning("(%s) Received mode bounce %s in channel %s! Our TS: %s",
self.irc.name, modes, channel, self.irc.channels[channel].ts)
return
self.irc.applyModes(channel, parsedmodes)
if numeric in self.irc.servers and args[-1].isdigit():
# Sender is a server AND last arg is number. Perform TS updates.
their_ts = int(args[-1])