From 7e21e79eaba0a574a14e58b76bf0d8b1f55bb44e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 8 Jul 2022 15:17:30 +0200 Subject: [PATCH] downstream: fix MARKREAD/READ command name in broadcast We wouldn't send a MARKREAD message to draft/read-marker downstreams when receiving a READ command. --- downstream.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index 1b9aae9..f0e9c61 100644 --- a/downstream.go +++ b/downstream.go @@ -2983,9 +2983,13 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. } network.forEachDownstream(func(d *downstreamConn) { if broadcast || dc.id == d.id { + cmd := "MARKREAD" + if !dc.caps.IsEnabled("draft/read-marker") { + cmd = "READ" + } d.SendMessage(&irc.Message{ Prefix: d.prefix(), - Command: msg.Command, + Command: cmd, Params: []string{d.marshalEntity(network, entity), timestampStr}, }) }