Tweak complete sync too

This commit is contained in:
Neil Alexander 2022-10-31 09:40:34 +00:00
parent 6c0c369286
commit b4294d082f
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -513,7 +513,6 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
// transaction IDs for complete syncs, but we do it anyway because Sytest demands it for:
// "Can sync a room with a message with a transaction id" - which does a complete sync to check.
recentEvents := snapshot.StreamEventsToEvents(device, recentStreamEvents)
stateEvents = removeDuplicates(stateEvents, recentEvents)
events := recentEvents
// Only apply history visibility checks if the response is for joined rooms
@ -547,7 +546,9 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
// If we are limited by the filter AND the history visibility filter
// didn't "remove" events, return that the response is limited.
jr.Timeline.Limited = limited && len(events) == len(recentEvents)
jr.State.Events = gomatrixserverlib.HeaderedToClientEvents(stateEvents, gomatrixserverlib.FormatSync)
jr.State.Events = gomatrixserverlib.HeaderedToClientEvents(
removeDuplicates(stateEvents, recentEvents), gomatrixserverlib.FormatSync,
)
return jr, nil
}