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.
This commit is contained in:
Ember Sawady 2022-08-21 20:08:10 +00:00 committed by Simon Ser
parent f4af7975d3
commit aee65cd269

View File

@ -2172,7 +2172,8 @@ func (uc *upstreamConn) produce(target string, msg *irc.Message, originID uint64
detached := ch != nil && ch.Detached detached := ch != nil && ch.Detached
uc.forEachDownstream(func(dc *downstreamConn) { 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) dc.sendMessageWithID(dc.marshalMessage(msg, uc.network), msgID)
} else { } else {
dc.advanceMessageWithID(msg, msgID) dc.advanceMessageWithID(msg, msgID)