fix: requestHistory() for archived rooms
Using JoinedRoomUpdate() in a fake sync for archived rooms when requesting the history leads to the problem that the room is stored as a joined room in the store which is wrong.
This commit is contained in:
parent
2f35277e47
commit
e1343e9c83
|
|
@ -959,12 +959,22 @@ class Room {
|
|||
await client.handleSync(
|
||||
SyncUpdate(nextBatch: '')
|
||||
..rooms = (RoomsUpdate()
|
||||
..join = ({}..[id] = (JoinedRoomUpdate()
|
||||
..state = resp.state
|
||||
..timeline = (TimelineUpdate()
|
||||
..limited = false
|
||||
..events = resp.chunk
|
||||
..prevBatch = resp.end)))),
|
||||
..join = membership == Membership.join
|
||||
? ({}..[id] = ((JoinedRoomUpdate()
|
||||
..state = resp.state
|
||||
..timeline = (TimelineUpdate()
|
||||
..limited = false
|
||||
..events = resp.chunk
|
||||
..prevBatch = resp.end))))
|
||||
: null
|
||||
..leave = membership != Membership.join
|
||||
? ({}..[id] = ((LeftRoomUpdate()
|
||||
..state = resp.state
|
||||
..timeline = (TimelineUpdate()
|
||||
..limited = false
|
||||
..events = resp.chunk
|
||||
..prevBatch = resp.end))))
|
||||
: null),
|
||||
sortAtTheEnd: true);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue