mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 12:12:54 +01:00
irclib: Copy messages before echoing them
Fixes a bug triggered by Relay when it relays between three or more networks.
This commit is contained in:
parent
f390ade16d
commit
8b90884fa0
@ -1406,8 +1406,16 @@ class Irc(IrcCommandDispatcher, log.Firewalled):
|
|||||||
assert not msg.tagged('receivedAt')
|
assert not msg.tagged('receivedAt')
|
||||||
if not world.testing:
|
if not world.testing:
|
||||||
assert not msg.tagged('emulatedEcho')
|
assert not msg.tagged('emulatedEcho')
|
||||||
msg.tag('emulatedEcho', True)
|
|
||||||
self.feedMsg(msg, tag=False)
|
# Copy the msg before echoing it back. Without a copy, it
|
||||||
|
# can cause all sorts of issues if the msg is reused (eg. Relay
|
||||||
|
# sends the same message object to the same network, so when
|
||||||
|
# sending the msg for the second time, it would already be
|
||||||
|
# tagged with emulatedEcho and fail the assertion above)
|
||||||
|
echo_msg = ircmsgs.IrcMsg(msg=msg)
|
||||||
|
|
||||||
|
echo_msg.tag('emulatedEcho', True)
|
||||||
|
self.feedMsg(echo_msg, tag=False)
|
||||||
else:
|
else:
|
||||||
# I don't think we should do this. Why should it matter? If it's
|
# I don't think we should do this. Why should it matter? If it's
|
||||||
# something important, then the server will send it back to us,
|
# something important, then the server will send it back to us,
|
||||||
|
Loading…
Reference in New Issue
Block a user