From 3ccf7e5ad6a36c72398ee6d310b2b4b2a2264ed8 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 30 Jul 2019 05:53:35 +0000 Subject: [PATCH] [RoomList] Make async method real time again. --- lib/src/RoomList.dart | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/src/RoomList.dart b/lib/src/RoomList.dart index 9b78784..ca5fcae 100644 --- a/lib/src/RoomList.dart +++ b/lib/src/RoomList.dart @@ -134,18 +134,13 @@ class RoomList { rooms[j].timeCreated) return;*/ if (eventUpdate.type == "timeline") { - User user = await client?.store?.getUser( - matrixID: eventUpdate.content["sender"], - room: Room(id: eventUpdate.roomID, client: client)); User stateKey = null; - if (eventUpdate.content.containsKey("state_key")) - stateKey = await client?.store?.getUser( - matrixID: eventUpdate.content["state_key"], - room: Room(id: eventUpdate.roomID, client: client)); + if (eventUpdate.content["state_key"] is String) + stateKey = User(eventUpdate.content["state_key"]); // Update the last message preview rooms[j].lastEvent = Event( eventUpdate.content["id"], - user ?? User(eventUpdate.content["sender"]), + User(eventUpdate.content["sender"]), ChatTime(eventUpdate.content["origin_server_ts"]), room: rooms[j], stateKey: stateKey,