From 160bcc8b6befe40b62c1dadc835aa0a2edf83a8d Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 22 Oct 2020 20:01:30 +0200 Subject: [PATCH] Revert "irclib: Fill the nick and prefix of simulated echo messages." This reverts commit 1fe414764c0c2fa291b7d10d663b52c069013058. I initially wrote that commit so that plugins with echoMessage=True can get the nick/prefix from the message (eg. the SkypeRelay plugin in my personal repo). Unfortunately, this breaks any test that does equality comparison on between the result of getMsg()/takeMsg() and an IrcMsg object they crafted themselves. Additionally, the filled in nick and prefix might be inaccurate if the bot changes nick/host at the same time. So instead plugins should check for the None value. (Also, editing IrcMsgs on the fly like this isn't great, and the commit forgot to reset the `_str` attribute.) --- src/irclib.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/irclib.py b/src/irclib.py index b7317685f..c7d497e4e 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -1305,8 +1305,6 @@ class Irc(IrcCommandDispatcher, log.Firewalled): # echo-message is not implemented by server; let's emulate it # here, just before sending it to the driver. assert not msg.tagged('receivedAt') - msg.nick = self.nick - msg.prefix = self.prefix self.feedMsg(msg, tag=False) else: # I don't think we should do this. Why should it matter? If it's