[Room]/[Store] Load sender user when loading event by id
Took 5 minutes
This commit is contained in:
parent
29c677e5ba
commit
90a5f32e20
|
@ -503,6 +503,8 @@ class Room {
|
||||||
final dynamic resp = await client.connection.jsonRequest(
|
final dynamic resp = await client.connection.jsonRequest(
|
||||||
type: HTTPType.GET, action: "/client/r0/rooms/$id/event/$eventID");
|
type: HTTPType.GET, action: "/client/r0/rooms/$id/event/$eventID");
|
||||||
if (resp is ErrorResponse) return null;
|
if (resp is ErrorResponse) return null;
|
||||||
return Event.fromJson(resp, this);
|
return Event.fromJson(resp, this,
|
||||||
|
senderUser:
|
||||||
|
(await client.store.getUser(matrixID: resp["sender"], room: this)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,7 +650,9 @@ class Store {
|
||||||
List<Map<String, dynamic>> res = await db.rawQuery(
|
List<Map<String, dynamic>> res = await db.rawQuery(
|
||||||
"SELECT * FROM Events WHERE id=? AND chat_id=?", [eventID, room.id]);
|
"SELECT * FROM Events WHERE id=? AND chat_id=?", [eventID, room.id]);
|
||||||
if (res.length == 0) return null;
|
if (res.length == 0) return null;
|
||||||
return Event.fromJson(res[0], room);
|
return Event.fromJson(res[0], room,
|
||||||
|
senderUser:
|
||||||
|
(await this.getUser(matrixID: res[0]["sender"], room: room)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future forgetNotification(String roomID) async {
|
Future forgetNotification(String roomID) async {
|
||||||
|
|
Loading…
Reference in a new issue