Add the initial event into the set

This commit is contained in:
Neil Alexander 2022-05-09 15:04:04 +01:00
parent 74baae0669
commit 5d9fd35ee9
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -161,7 +161,12 @@ func (s *OutputRoomEventConsumer) onNewRoomEvent(
// in the sync API database or we'll need to ask the roomserver.
knownEventIDs := make(map[string]bool, len(msg.AddsStateEventIDs))
for _, eventID := range msg.AddsStateEventIDs {
knownEventIDs[eventID] = eventID == ev.EventID()
if eventID == ev.EventID() {
knownEventIDs[eventID] = true
addsStateEvents = append(addsStateEvents, ev)
} else {
knownEventIDs[eventID] = false
}
}
// Work out which events we want to look up in the sync API database.