[Store] Fix another query bug
This commit is contained in:
parent
f2bbe978a8
commit
5abd5065fa
|
@ -340,7 +340,11 @@ class Store {
|
||||||
/// Returns a list of events for the given room and sets all participants.
|
/// Returns a list of events for the given room and sets all participants.
|
||||||
Future<List<Event>> getEventList(Room room) async {
|
Future<List<Event>> getEventList(Room room) async {
|
||||||
List<Map<String, dynamic>> eventRes = await db.rawQuery(
|
List<Map<String, dynamic>> eventRes = await db.rawQuery(
|
||||||
"SELECT * " + " FROM Events " + " WHERE room_id=?" + " GROUP BY id",
|
"SELECT * " +
|
||||||
|
" FROM Events " +
|
||||||
|
" WHERE room_id=?" +
|
||||||
|
" GROUP BY id " +
|
||||||
|
" ORDER BY origin_server_ts DESC",
|
||||||
[room.id]);
|
[room.id]);
|
||||||
|
|
||||||
List<Event> eventList = [];
|
List<Event> eventList = [];
|
||||||
|
@ -362,8 +366,7 @@ class Store {
|
||||||
" WHERE rooms.membership" +
|
" WHERE rooms.membership" +
|
||||||
(onlyLeft ? "=" : "!=") +
|
(onlyLeft ? "=" : "!=") +
|
||||||
"'leave' " +
|
"'leave' " +
|
||||||
" GROUP BY rooms.id " +
|
" GROUP BY rooms.id ");
|
||||||
" ORDER BY origin_server_ts DESC ");
|
|
||||||
List<Room> roomList = [];
|
List<Room> roomList = [];
|
||||||
for (num i = 0; i < res.length; i++) {
|
for (num i = 0; i < res.length; i++) {
|
||||||
Room room = await Room.getRoomFromTableRow(res[i], client,
|
Room room = await Room.getRoomFromTableRow(res[i], client,
|
||||||
|
|
Loading…
Reference in a new issue