Allow m.read.private to clear notifications

This commit is contained in:
Neil Alexander 2022-10-19 12:41:50 +01:00
parent 8cbe14bd6d
commit b2c6e7d4fe
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -81,7 +81,12 @@ func (s *OutputReceiptEventConsumer) onMessage(ctx context.Context, msgs []*nats
readPos := msg.Header.Get(jetstream.EventID) readPos := msg.Header.Get(jetstream.EventID)
evType := msg.Header.Get("type") evType := msg.Header.Get("type")
if readPos == "" || evType != "m.read" { switch {
case readPos == "":
return true
case evType == "m.read": // allowed
case evType == "m.read.private": // allowed
default:
return true return true
} }