mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-25 03:34:05 +01:00
relay_cb: bandaid fix to prevent STATUSMSG messages from being interpreted as non-channel specific
This commit is contained in:
parent
b6bac994c6
commit
5733418380
@ -60,7 +60,7 @@ def cb_relay_core(irc, source, command, args):
|
|||||||
|
|
||||||
real_command = 'ACTION'
|
real_command = 'ACTION'
|
||||||
|
|
||||||
elif not irc.is_channel(args['target']):
|
elif not irc.is_channel(args['target'].lstrip(''.join(irc.prefixmodes.values()))):
|
||||||
# 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'
|
||||||
@ -113,8 +113,12 @@ def cb_relay_core(irc, source, command, args):
|
|||||||
netname = sourcenet
|
netname = sourcenet
|
||||||
|
|
||||||
# Figure out where the message is destined to.
|
# Figure out where the message is destined to.
|
||||||
target = args.get('channel') or args.get('target')
|
stripped_target = target = args.get('channel') or args.get('target')
|
||||||
if target is None or not (irc.is_channel(target) or private):
|
if target is not None:
|
||||||
|
# HACK: cheap fix to prevent @#channel messages from interpreted as non-channel specific
|
||||||
|
stripped_target = target.lstrip(''.join(irc.prefixmodes.values()))
|
||||||
|
|
||||||
|
if target is None or not (irc.is_channel(stripped_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.
|
||||||
@ -127,7 +131,7 @@ def cb_relay_core(irc, source, command, args):
|
|||||||
else:
|
else:
|
||||||
# Pluralize the channel so that we can iterate over it.
|
# Pluralize the channel so that we can iterate over it.
|
||||||
targets = [target]
|
targets = [target]
|
||||||
args['channel'] = target
|
args['channel'] = stripped_target
|
||||||
log.debug('(%s) relay_cb_core: Relaying event %s to channels: %s', irc.name, real_command, targets)
|
log.debug('(%s) relay_cb_core: Relaying event %s to channels: %s', irc.name, real_command, targets)
|
||||||
|
|
||||||
identhost = ''
|
identhost = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user