From aee65cd269d0551553e0562698706b4344673c4f Mon Sep 17 00:00:00 2001 From: Ember Sawady Date: Sun, 21 Aug 2022 20:08:10 +0000 Subject: [PATCH] Fix labeled-response without downstream echo-message Previously, receiving labeled responses to messages sent from a downstream without echo-message would fail, because soju would filter out the responses under the assumption that it was an echoed message. Only do this filtering when msg.Prefix.Name != uc.nick in order to avoid this issue. --- upstream.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upstream.go b/upstream.go index d0b0e10..79fea4e 100644 --- a/upstream.go +++ b/upstream.go @@ -2172,7 +2172,8 @@ func (uc *upstreamConn) produce(target string, msg *irc.Message, originID uint64 detached := ch != nil && ch.Detached uc.forEachDownstream(func(dc *downstreamConn) { - if !detached && (dc.id != originID || dc.caps.IsEnabled("echo-message")) { + echo := dc.id == originID && msg.Prefix != nil && uc.isOurNick(msg.Prefix.Name) + if !detached && (!echo || dc.caps.IsEnabled("echo-message")) { dc.sendMessageWithID(dc.marshalMessage(msg, uc.network), msgID) } else { dc.advanceMessageWithID(msg, msgID)