diff --git a/lib/src/Store.dart b/lib/src/Store.dart index d8f69c2..e6ca444 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -436,11 +436,12 @@ class Store { return User.fromJson(res[0], room); } - /// Loads all Users in the database to provide a contact list. - Future> loadContacts() async { + /// Loads all Users in the database to provide a contact list + /// except users who are in the Room with the ID [exceptRoomID]. + Future> loadContacts({String exceptRoomID = ""}) async { List> res = await db.rawQuery( - "SELECT * FROM Users WHERE matrix_id!=? GROUP BY matrix_id ORDER BY displayname", - [client.userID]); + "SELECT * FROM Users WHERE matrix_id!=? AND chat_id!=? GROUP BY matrix_id ORDER BY displayname", + [client.userID, exceptRoomID]); List userList = []; for (int i = 0; i < res.length; i++) userList.add(User.fromJson(res[i], Room(id: "", client: client)));