Relay: Set msg.channel before passing it to _sendToOthers.

_sendToOthers expects msg.channel to be 'in otherIrc.state.channels',
but IrcMsg objects don't have their 'channel' attribute set until they
are passed through irclib, so it was left unset, which means messages
were never sent at all.

Regression introduced in c1ae3f5c81.
This commit is contained in:
Valentin Lorentz 2021-01-15 21:24:23 +01:00
parent aceb7baeb2
commit 7110b8f74e

View File

@ -299,9 +299,13 @@ class Relay(callbacks.Plugin):
msg = dynamic.msg
if self.registryValue('noticeNonPrivmsgs', target, network) and \
msg.command != 'PRIVMSG':
return ircmsgs.notice(target, s)
m = ircmsgs.notice(target, s)
else:
return ircmsgs.privmsg(target, s)
m = ircmsgs.privmsg(target, s)
m.channel = target
return m
def doJoin(self, irc, msg):
irc = self._getRealIrc(irc)