From be8544aa48e0c1c05e2ea2f41cbfe5d0bbb46e9a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Sat, 16 Feb 2019 02:55:24 +0100 Subject: [PATCH] also persist state events in timeline --- src/matrix/room/persister.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/matrix/room/persister.js b/src/matrix/room/persister.js index e97b451e..5c896b6b 100644 --- a/src/matrix/room/persister.js +++ b/src/matrix/room/persister.js @@ -51,5 +51,15 @@ export default class RoomPersister { txn.roomState.setStateEvent(this._roomId, event) } } + + if (timeline.events) { + if (state.events) { + for (const event of timeline.events) { + if (typeof event.state_key === "string") { + txn.roomState.setStateEvent(this._roomId, event); + } + } + } + } } } \ No newline at end of file