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.)
This commit is contained in:
Valentin Lorentz 2020-10-22 20:01:30 +02:00
parent 5ee63ebe96
commit 160bcc8b6b

View File

@ -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