Fix m.receipts causing notifications (#2893)

Fixes https://github.com/matrix-org/dendrite/issues/2353
This commit is contained in:
Till 2022-11-29 15:46:28 +01:00 committed by GitHub
parent 1990c154e9
commit f8d1dc521d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 108 additions and 2 deletions

View file

@ -480,6 +480,13 @@ func (jr JoinResponse) MarshalJSON() ([]byte, error) {
if jr.Ephemeral != nil && len(jr.Ephemeral.Events) == 0 {
a.Ephemeral = nil
}
if jr.Ephemeral != nil {
// Remove the room_id from EDUs, as this seems to cause Element Web
// to trigger notifications - https://github.com/vector-im/element-web/issues/17263
for i := range jr.Ephemeral.Events {
jr.Ephemeral.Events[i].RoomID = ""
}
}
if jr.AccountData != nil && len(jr.AccountData.Events) == 0 {
a.AccountData = nil
}