diff --git a/lib/src/Store.dart b/lib/src/Store.dart index 1ddbd868..a307e712 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -601,7 +601,8 @@ class Store { /// the user [userID]. Returns null if there is none. Future getDirectChatRoomID(String userID) async { List> res = await db.rawQuery( - "SELECT id FROM Rooms WHERE direct_chat_matrix_id=?", [userID]); + "SELECT id FROM Rooms WHERE direct_chat_matrix_id=? WHERE membership='join' LIMIT 1", + [userID]); if (res.length != 1) return null; return res[0]["id"]; }