[ContactList] Fallback with old loadContacts

This commit is contained in:
Christian 2019-07-26 14:07:29 +00:00 committed by Marcel
parent 20a189ecd8
commit dd5814cd58
2 changed files with 5 additions and 2 deletions

View file

@ -224,9 +224,13 @@ class Client {
/// the famedlyContactDiscovery room, which is /// the famedlyContactDiscovery room, which is
/// defined by the autojoin room feature in Synapse. /// defined by the autojoin room feature in Synapse.
Future<List<User>> loadFamedlyContacts() async { Future<List<User>> loadFamedlyContacts() async {
List<User> contacts = [];
Room contactDiscoveryRoom = await store Room contactDiscoveryRoom = await store
.getRoomByAlias("#famedlyContactDiscovery:${userID.split(":")[1]}"); .getRoomByAlias("#famedlyContactDiscovery:${userID.split(":")[1]}");
List<User> contacts = await contactDiscoveryRoom.requestParticipants(); if (contactDiscoveryRoom != null)
contacts = await contactDiscoveryRoom.requestParticipants();
else
contacts = await store.loadContacts();
return contacts; return contacts;
} }

View file

@ -458,7 +458,6 @@ class Store {
/// Loads all Users in the database to provide a contact list /// Loads all Users in the database to provide a contact list
/// except users who are in the Room with the ID [exceptRoomID]. /// except users who are in the Room with the ID [exceptRoomID].
@deprecated
Future<List<User>> loadContacts({String exceptRoomID = ""}) async { Future<List<User>> loadContacts({String exceptRoomID = ""}) async {
List<Map<String, dynamic>> res = await db.rawQuery( List<Map<String, dynamic>> res = await db.rawQuery(
"SELECT * FROM Users WHERE matrix_id!=? AND chat_id!=? GROUP BY matrix_id ORDER BY displayname", "SELECT * FROM Users WHERE matrix_id!=? AND chat_id!=? GROUP BY matrix_id ORDER BY displayname",