Merge branch 'roomlist-fix-asyncmethod' into 'master'

[RoomList] Make async method real time again.

See merge request famedly/famedlysdk!58
This commit is contained in:
Christian 2019-07-30 05:53:35 +00:00
commit 3094b73b02

View file

@ -134,18 +134,13 @@ class RoomList {
rooms[j].timeCreated) return;*/ rooms[j].timeCreated) return;*/
if (eventUpdate.type == "timeline") { if (eventUpdate.type == "timeline") {
User user = await client?.store?.getUser(
matrixID: eventUpdate.content["sender"],
room: Room(id: eventUpdate.roomID, client: client));
User stateKey = null; User stateKey = null;
if (eventUpdate.content.containsKey("state_key")) if (eventUpdate.content["state_key"] is String)
stateKey = await client?.store?.getUser( stateKey = User(eventUpdate.content["state_key"]);
matrixID: eventUpdate.content["state_key"],
room: Room(id: eventUpdate.roomID, client: client));
// Update the last message preview // Update the last message preview
rooms[j].lastEvent = Event( rooms[j].lastEvent = Event(
eventUpdate.content["id"], eventUpdate.content["id"],
user ?? User(eventUpdate.content["sender"]), User(eventUpdate.content["sender"]),
ChatTime(eventUpdate.content["origin_server_ts"]), ChatTime(eventUpdate.content["origin_server_ts"]),
room: rooms[j], room: rooms[j],
stateKey: stateKey, stateKey: stateKey,