mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Filter /members
, return members at given point (#2827)
Makes the tests ``` Can get rooms/{roomId}/members at a given point Can filter rooms/{roomId}/members ``` pass, by moving `/members` and `/joined_members` to the SyncAPI.
This commit is contained in:
parent
7506e3303e
commit
313cb3fd19
15 changed files with 243 additions and 72 deletions
|
@ -473,7 +473,13 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
|
|||
var prevBatch *types.TopologyToken
|
||||
if len(recentStreamEvents) > 0 {
|
||||
var backwardTopologyPos, backwardStreamPos types.StreamPosition
|
||||
backwardTopologyPos, backwardStreamPos, err = snapshot.PositionInTopology(ctx, recentStreamEvents[0].EventID())
|
||||
event := recentStreamEvents[0]
|
||||
// If this is the beginning of the room, we can't go back further. We're going to return
|
||||
// the TopologyToken from the last event instead. (Synapse returns the /sync next_Batch)
|
||||
if event.Type() == gomatrixserverlib.MRoomCreate && event.StateKeyEquals("") {
|
||||
event = recentStreamEvents[len(recentStreamEvents)-1]
|
||||
}
|
||||
backwardTopologyPos, backwardStreamPos, err = snapshot.PositionInTopology(ctx, event.EventID())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue