Don't temporarily set msg.channel to invalid values.

This causes issue when multiple command threads deal with the same message.
This commit is contained in:
Valentin Lorentz 2019-09-20 21:23:49 +02:00
parent 6c5072cfe0
commit 84c1f1572d

View File

@ -886,15 +886,15 @@ class Irc(IrcCommandDispatcher, log.Firewalled):
self._setMsgChannel(msg) self._setMsgChannel(msg)
def _setMsgChannel(self, msg): def _setMsgChannel(self, msg):
channel = None
if msg.args: if msg.args:
msg.channel = msg.args[0] channel = msg.args[0]
if msg.command in ('NOTICE', 'PRIVMSG') and \ if msg.command in ('NOTICE', 'PRIVMSG') and \
not conf.supybot.protocols.irc.strictRfc(): not conf.supybot.protocols.irc.strictRfc():
msg.channel = self.stripChannelPrefix(msg.channel) channel = self.stripChannelPrefix(channel)
if not self.isChannel(msg.channel): if not self.isChannel(channel):
msg.channel = None channel = None
else: msg.channel = channel
msg.channel = None
def stripChannelPrefix(self, channel): def stripChannelPrefix(self, channel):
statusmsg_chars = self.state.supported.get('statusmsg', '') statusmsg_chars = self.state.supported.get('statusmsg', '')