SendEventWithState events as new

This commit is contained in:
Neil Alexander 2020-09-08 18:54:30 +01:00
parent 35564dd73c
commit f6c4efd4c3
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -53,15 +53,20 @@ func SendEventWithState(
}
var ires []InputRoomEvent
var stateIDs []string
for _, outlier := range outliers {
if haveEventIDs[outlier.EventID()] {
continue
}
ires = append(ires, InputRoomEvent{
Kind: KindOutlier,
Event: outlier.Headered(event.RoomVersion),
AuthEventIDs: outlier.AuthEventIDs(),
Kind: KindNew,
Event: outlier.Headered(event.RoomVersion),
AuthEventIDs: outlier.AuthEventIDs(),
HasState: true,
StateEventIDs: stateIDs,
})
stateIDs = append(stateIDs, outlier.EventID())
}
stateEventIDs := make([]string, len(state.StateEvents))