3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

relay: send RELAY_RAW_MODE payloads to the *remote* channel name

This commit is contained in:
James Lu 2017-08-18 13:30:17 -07:00
parent 8563556850
commit 15be760b19

View File

@ -1435,6 +1435,8 @@ def handle_mode(irc, numeric, command, args):
if check_claim(irc, target, numeric, chanobj=oldchan): if check_claim(irc, target, numeric, chanobj=oldchan):
remotechan = get_remote_channel(irc, remoteirc, target) remotechan = get_remote_channel(irc, remoteirc, target)
if not remotechan:
return
supported_modes = get_supported_cmodes(irc, remoteirc, target, modes) supported_modes = get_supported_cmodes(irc, remoteirc, target, modes)
# Check if the sender is a user with a relay client; otherwise relay the mode # Check if the sender is a user with a relay client; otherwise relay the mode
@ -1457,7 +1459,7 @@ def handle_mode(irc, numeric, command, args):
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': target, '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)