~emersion/soju-dev

Fix labeled-response without downstream echo-message v1 APPLIED

Ember Sawady: 1
 Fix labeled-response without downstream echo-message

 1 files changed, 3 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/soju-dev/patches/34834/mbox | git am -3
Learn more about email & git

[PATCH] Fix labeled-response without downstream echo-message Export this patch

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.
---
Should fix the bug I mentioned in #soju last night
 upstream.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/upstream.go b/upstream.go
index 3c22173..0587dca 100644
--- a/upstream.go
+++ b/upstream.go
@@ -2164,7 +2164,9 @@ 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 && msg.Prefix.Name == uc.nick
		if !detached && (!echo || dc.caps.IsEnabled("echo-message")) {
			dc.sendMessageWithID(dc.marshalMessage(msg, uc.network), msgID)
		} else {
			dc.advanceMessageWithID(msg, msgID)
-- 
2.37.1