MSC2946: Allow redactions/updates for space state events (#1712)

This commit is contained in:
Kegsay 2021-01-15 11:44:36 +00:00 committed by GitHub
parent ef24ea2678
commit 2626525c65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 3 deletions

View file

@ -333,7 +333,12 @@ func (w *walker) references(roomID string) (eventLookup, error) {
}
el := make(eventLookup)
for _, ev := range events {
el.set(ev)
// only return events that have a `via` key as per MSC1772
// else we'll incorrectly walk redacted events (as the link
// is in the state_key)
if gjson.GetBytes(ev.Content(), "via").Exists() {
el.set(ev)
}
}
return el, nil
}