3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 20:22:45 +01:00

relay_clientbot: fix @#channel messages not being treated as channel-specific

This is a lighter version of the more comprehensive fix in 2.0[1], which
depends on reworked STATUSMSG handling in relay.

[1]: https://github.com/GLolol/PyLink/commit/57334183
This commit is contained in:
James Lu 2018-03-30 11:14:56 -07:00
parent a24d4d5b9c
commit 597685d77c

View File

@ -59,7 +59,13 @@ def cb_relay_core(irc, source, command, args):
real_command = 'ACTION' real_command = 'ACTION'
elif not utils.isChannel(args['target']): # We only handle # channels - this skips utils.isChannel() so that
# @#channel messages aren't incorrectly interpreted as non-channel
# specific.
# A more thorough fix for this bug exists in 2.0[1] but depends on
# somewhat invasive changes to how relay handles STATUSMSG entirely.
# [1]: https://github.com/GLolol/PyLink/commit/57334183
elif '#' not in args['target']:
# Target is a user; handle this accordingly. # Target is a user; handle this accordingly.
if relay_conf.get('allow_clientbot_pms'): if relay_conf.get('allow_clientbot_pms'):
real_command = 'PNOTICE' if args.get('is_notice') else 'PM' real_command = 'PNOTICE' if args.get('is_notice') else 'PM'
@ -111,7 +117,7 @@ def cb_relay_core(irc, source, command, args):
# Figure out where the message is destined to. # Figure out where the message is destined to.
target = args.get('channel') or args.get('target') target = args.get('channel') or args.get('target')
if target is None or not (utils.isChannel(target) or private): if target is None or not ('#' in target or private):
# Non-channel specific message (e.g. QUIT or NICK). If this isn't a PM, figure out # Non-channel specific message (e.g. QUIT or NICK). If this isn't a PM, figure out
# all channels that the sender shares over the relay, and relay them to those # all channels that the sender shares over the relay, and relay them to those
# channels. # channels.