mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-23 06:43:09 -06:00
Send cumulative state with new events
This commit is contained in:
parent
9c6d1eb54e
commit
17a5d84f30
|
|
@ -54,20 +54,23 @@ func SendEventWithState(
|
||||||
}
|
}
|
||||||
|
|
||||||
var ires []InputRoomEvent
|
var ires []InputRoomEvent
|
||||||
|
var stateEventIDs []string
|
||||||
|
|
||||||
for _, outlier := range outliers {
|
for _, outlier := range outliers {
|
||||||
if haveEventIDs[outlier.EventID()] {
|
if haveEventIDs[outlier.EventID()] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ires = append(ires, InputRoomEvent{
|
in := InputRoomEvent{
|
||||||
Kind: stateKind,
|
Kind: stateKind,
|
||||||
Event: outlier.Headered(event.RoomVersion),
|
Event: outlier.Headered(event.RoomVersion),
|
||||||
AuthEventIDs: outlier.AuthEventIDs(),
|
AuthEventIDs: outlier.AuthEventIDs(),
|
||||||
})
|
}
|
||||||
}
|
if stateKind == KindNew {
|
||||||
|
in.HasState = true
|
||||||
stateEventIDs := make([]string, len(state.StateEvents))
|
in.StateEventIDs = stateEventIDs
|
||||||
for i := range state.StateEvents {
|
}
|
||||||
stateEventIDs[i] = state.StateEvents[i].EventID()
|
ires = append(ires, in)
|
||||||
|
stateEventIDs = append(stateEventIDs, outlier.EventID())
|
||||||
}
|
}
|
||||||
|
|
||||||
ires = append(ires, InputRoomEvent{
|
ires = append(ires, InputRoomEvent{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue