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(
|
await client.handleSync(
|
||||||
SyncUpdate(nextBatch: '')
|
SyncUpdate(nextBatch: '')
|
||||||
..rooms = (RoomsUpdate()
|
..rooms = (RoomsUpdate()
|
||||||
..join = ({}..[id] = (JoinedRoomUpdate()
|
..join = membership == Membership.join
|
||||||
..state = resp.state
|
? ({}..[id] = ((JoinedRoomUpdate()
|
||||||
..timeline = (TimelineUpdate()
|
..state = resp.state
|
||||||
..limited = false
|
..timeline = (TimelineUpdate()
|
||||||
..events = resp.chunk
|
..limited = false
|
||||||
..prevBatch = resp.end)))),
|
..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);
|
sortAtTheEnd: true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue