Set msg.channel in ReplyIrcProxy and NestedCommandsIrcProxy.

Needed when plugins use a self.Proxy with a crafted message;
else the called commands will assume the message was sent in
private.
This commit is contained in:
Valentin Lorentz 2019-09-08 21:35:35 +02:00
parent de9cea89cf
commit 67c2bacd69
1 changed files with 2 additions and 2 deletions

View File

@ -585,6 +585,7 @@ class ReplyIrcProxy(RichReplyMethods):
def __init__(self, irc, msg):
self.irc = irc
self.msg = msg
self.getRealIrc()._setMsgChannel(self.msg)
def getRealIrc(self):
"""Returns the real irclib.Irc object underlying this proxy chain."""
@ -636,8 +637,7 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
_mores = ircutils.IrcDict()
def __init__(self, irc, msg, args, nested=0):
assert isinstance(args, list), 'Args should be a list, not a string.'
self.irc = irc
self.msg = msg
super(NestedCommandsIrcProxy, self).__init__(irc, msg)
self.nested = nested
self.repliedTo = False
if not self.nested and isinstance(irc, self.__class__):