~emersion/soju-dev

Keep batch tag for downstreams with batch cap v1 APPLIED

delthas: 1
 Keep batch tag for downstreams with batch cap

 1 files changed, 2 insertions(+), 0 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/31039/mbox | git am -3
Learn more about email & git

[PATCH] Keep batch tag for downstreams with batch cap Export this patch

On upstreams without message-tags support, we do not advertise
message-tags anymore. Still, we want to send the batch tag when the
client explicitly requested it.

This fixes a critical issue where we drop the batch tag on chathistory
messages for upstreams that do not support message-tags.
---
 downstream.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/downstream.go b/downstream.go
index eae4cdd..ebe73d0 100644
--- a/downstream.go
+++ b/downstream.go
@@ -557,6 +557,8 @@ func (dc *downstreamConn) SendMessage(msg *irc.Message) {
				supported = dc.caps.IsEnabled("server-time")
			case "account":
				supported = dc.caps.IsEnabled("account")
			case "batch":
				supported = dc.caps.IsEnabled("batch")
			}
			if !supported {
				delete(msg.Tags, name)

base-commit: b67b9b3cd209dede87317c83ca00e8425896962d
-- 
2.17.1
Pushed, thanks for the fix!