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.
This commit is contained in:
Simon Ser 2022-07-08 15:17:30 +02:00
parent 0d44413e85
commit 7e21e79eab
1 changed files with 5 additions and 1 deletions

View File

@ -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},
})
}