mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-11 20:52:42 +01:00
unreal: warn about mode bounces instead of fighting with the uplink
This commit is contained in:
parent
f2b139c828
commit
2936e94f50
@ -652,10 +652,21 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
if utils.isChannel(args[0]):
|
if utils.isChannel(args[0]):
|
||||||
channel = self.irc.toLower(args[0])
|
channel = self.irc.toLower(args[0])
|
||||||
oldobj = self.irc.channels[channel].deepcopy()
|
oldobj = self.irc.channels[channel].deepcopy()
|
||||||
|
|
||||||
modes = list(filter(None, args[1:])) # normalize whitespace
|
modes = list(filter(None, args[1:])) # normalize whitespace
|
||||||
parsedmodes = self.irc.parseModes(channel, modes)
|
parsedmodes = self.irc.parseModes(channel, modes)
|
||||||
|
|
||||||
if parsedmodes:
|
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)
|
self.irc.applyModes(channel, parsedmodes)
|
||||||
|
|
||||||
if numeric in self.irc.servers and args[-1].isdigit():
|
if numeric in self.irc.servers and args[-1].isdigit():
|
||||||
# Sender is a server AND last arg is number. Perform TS updates.
|
# Sender is a server AND last arg is number. Perform TS updates.
|
||||||
their_ts = int(args[-1])
|
their_ts = int(args[-1])
|
||||||
|
Loading…
Reference in New Issue
Block a user