mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-23 18:54:05 +01:00
relay: only send RAW_MODES payloads to networks without can-spawn-clients
This commit is contained in:
parent
15be760b19
commit
ffc734d8e2
@ -1444,22 +1444,23 @@ def handle_mode(irc, numeric, command, args):
|
|||||||
remotesender = get_remote_user(irc, remoteirc, numeric, spawn_if_missing=False) or \
|
remotesender = get_remote_user(irc, remoteirc, numeric, spawn_if_missing=False) or \
|
||||||
get_remote_sid(remoteirc, irc) or remoteirc.sid
|
get_remote_sid(remoteirc, irc) or remoteirc.sid
|
||||||
|
|
||||||
friendly_modes = []
|
if not remoteirc.has_cap('can-spawn-clients'):
|
||||||
for modepair in modes:
|
friendly_modes = []
|
||||||
if modepair[0][-1] in irc.prefixmodes:
|
for modepair in modes:
|
||||||
orig_user = get_orig_user(irc, modepair[1])
|
if modepair[0][-1] in irc.prefixmodes:
|
||||||
if orig_user and orig_user[0] == remoteirc.name:
|
orig_user = get_orig_user(irc, modepair[1])
|
||||||
# Don't display prefix mode changes for someone on the target clientbot
|
if orig_user and orig_user[0] == remoteirc.name:
|
||||||
# link; this will either be relayed via modesync or ignored.
|
# Don't display prefix mode changes for someone on the target clientbot
|
||||||
continue
|
# link; this will either be relayed via modesync or ignored.
|
||||||
|
continue
|
||||||
|
|
||||||
# Convert UIDs to nicks when relaying this to clientbot.
|
# Convert UIDs to nicks when relaying this to clientbot.
|
||||||
modepair = (modepair[0], irc.get_friendly_name(modepair[1]))
|
modepair = (modepair[0], irc.get_friendly_name(modepair[1]))
|
||||||
friendly_modes.append(modepair)
|
friendly_modes.append(modepair)
|
||||||
|
|
||||||
if friendly_modes:
|
if friendly_modes:
|
||||||
# Call hooks, this is used for clientbot relay.
|
# Call hooks, this is used for clientbot relay.
|
||||||
remoteirc.call_hooks([remotesender, 'RELAY_RAW_MODE', {'channel': remotechan, 'modes': friendly_modes}])
|
remoteirc.call_hooks([remotesender, 'RELAY_RAW_MODE', {'channel': remotechan, 'modes': friendly_modes}])
|
||||||
|
|
||||||
if supported_modes:
|
if supported_modes:
|
||||||
remoteirc.mode(remotesender, remotechan, supported_modes)
|
remoteirc.mode(remotesender, remotechan, supported_modes)
|
||||||
|
Loading…
Reference in New Issue
Block a user