From f466f579a1cac52fd877e12a9bcd8363181a991b Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 4 Jan 2020 16:10:59 +0000 Subject: [PATCH] Fix room account data in store --- lib/utils/sqflite_store.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/utils/sqflite_store.dart b/lib/utils/sqflite_store.dart index 0cf8a1e..cb6f9a6 100644 --- a/lib/utils/sqflite_store.dart +++ b/lib/utils/sqflite_store.dart @@ -253,7 +253,7 @@ class Store extends StoreAPI { /// Stores an EventUpdate object in the database. Must be called inside of /// [transaction]. Future storeEventUpdate(EventUpdate eventUpdate) { - if (txn == null) return null; + if (txn == null || eventUpdate.type == "ephemeral") return null; Map eventContent = eventUpdate.content; String type = eventUpdate.type; String chatId = eventUpdate.roomID; @@ -327,7 +327,7 @@ class Store extends StoreAPI { eventContent["type"], json.encode(eventContent["content"]), ]); - } else { + } else if (type == "account_data") { txn.rawInsert("INSERT OR REPLACE INTO RoomAccountData VALUES(?, ?, ?)", [ eventContent["type"], chatId, @@ -413,7 +413,6 @@ class Store extends StoreAPI { states: getStatesFromRoomId(res[i]["room_id"]), roomAccountData: getAccountDataFromRoomId(res[i]["room_id"]), ); - roomList.add(room); } return roomList; }