3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-02 23:54:08 +01:00

relay: block sending STATUSMSG messages to IRCds not supporting them

This commit is contained in:
James Lu 2017-12-21 01:41:01 -08:00
parent 16b491fdab
commit 2df608307d

View File

@ -1393,6 +1393,12 @@ def handle_messages(irc, numeric, command, args):
log.debug('(%s) relay.handle_messages: sending message to %s from %s on behalf of %s',
irc.name, real_target, user, numeric)
if real_target.startswith(tuple(irc.prefixmodes.values())) and not \
remoteirc.has_cap('has-statusmsg'):
log.debug("(%s) Not sending message destined to %s/%s because "
"the remote does not support STATUSMSG.", irc.name,
remoteirc.name, real_target)
return
try:
if notice:
remoteirc.notice(user, real_target, real_text)