From 67c2bacd693759be9580c5e95271974197918e51 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 8 Sep 2019 21:35:35 +0200 Subject: [PATCH] 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. --- src/callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index e88147de7..8a41dee67 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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__):