fix: apply state event before decryption on leaved room
This commit is contained in:
parent
61c89ae45a
commit
c38cbbc8dc
|
|
@ -947,6 +947,21 @@ class Client extends MatrixApi {
|
||||||
.toList() ??
|
.toList() ??
|
||||||
[]));
|
[]));
|
||||||
|
|
||||||
|
leftRoom.prev_batch = room.timeline?.prevBatch;
|
||||||
|
room.state?.forEach((event) {
|
||||||
|
leftRoom.setState(Event.fromMatrixEvent(
|
||||||
|
event,
|
||||||
|
leftRoom,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
|
||||||
|
room.timeline?.events?.forEach((event) {
|
||||||
|
leftRoom.setState(Event.fromMatrixEvent(
|
||||||
|
event,
|
||||||
|
leftRoom,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
|
||||||
for (var i = 0; i < timeline.events.length; i++) {
|
for (var i = 0; i < timeline.events.length; i++) {
|
||||||
// Try to decrypt encrypted events but don't update the database.
|
// Try to decrypt encrypted events but don't update the database.
|
||||||
if (leftRoom.encrypted && leftRoom.client.encryptionEnabled) {
|
if (leftRoom.encrypted && leftRoom.client.encryptionEnabled) {
|
||||||
|
|
@ -960,21 +975,6 @@ class Client extends MatrixApi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
room.timeline?.events?.forEach((event) {
|
|
||||||
leftRoom.setState(Event.fromMatrixEvent(
|
|
||||||
event,
|
|
||||||
leftRoom,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
|
|
||||||
leftRoom.prev_batch = room.timeline?.prevBatch;
|
|
||||||
room.state?.forEach((event) {
|
|
||||||
leftRoom.setState(Event.fromMatrixEvent(
|
|
||||||
event,
|
|
||||||
leftRoom,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
|
|
||||||
_archivedRooms.add(ArchivedRoom(room: leftRoom, timeline: timeline));
|
_archivedRooms.add(ArchivedRoom(room: leftRoom, timeline: timeline));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue