[ContactList] Fallback with old loadContacts
This commit is contained in:
parent
20a189ecd8
commit
dd5814cd58
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue