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)
def _setMsgChannel(self, msg):
channel = None
if msg.args:
msg.channel = msg.args[0]
channel = msg.args[0]
if msg.command in ('NOTICE', 'PRIVMSG') and \
not conf.supybot.protocols.irc.strictRfc():
msg.channel = self.stripChannelPrefix(msg.channel)
if not self.isChannel(msg.channel):
msg.channel = None
else:
msg.channel = None
channel = self.stripChannelPrefix(channel)
if not self.isChannel(channel):
channel = None
msg.channel = channel
def stripChannelPrefix(self, channel):
statusmsg_chars = self.state.supported.get('statusmsg', '')