Remove deprecated contactlist method

This commit is contained in:
Christian Pauly 2020-07-02 10:41:23 +00:00
parent ac720df3d2
commit c87450dafb
2 changed files with 0 additions and 30 deletions

View file

@ -446,29 +446,6 @@ class Client {
return archiveList;
}
/// Loads the contact list for this user excluding the user itself.
/// Currently the contacts are found by discovering the contacts of
/// the famedlyContactDiscovery room, which is
/// defined by the autojoin room feature in Synapse.
Future<List<User>> loadFamedlyContacts() async {
var contacts = <User>[];
var contactDiscoveryRoom =
getRoomByAlias('#famedlyContactDiscovery:${userID.domain}');
if (contactDiscoveryRoom != null) {
contacts = await contactDiscoveryRoom.requestParticipants();
} else {
var userMap = <String, bool>{};
for (var i = 0; i < rooms.length; i++) {
var roomUsers = rooms[i].getParticipants();
for (var j = 0; j < roomUsers.length; j++) {
if (userMap[roomUsers[j].id] != true) contacts.add(roomUsers[j]);
userMap[roomUsers[j].id] = true;
}
}
}
return contacts;
}
/// Changes the user's displayname.
Future<void> setDisplayname(String displayname) =>
api.setDisplayname(userID, displayname);

View file

@ -151,9 +151,6 @@ void main() {
expect(matrix.rooms.length, 2);
expect(matrix.rooms[1].canonicalAlias,
"#famedlyContactDiscovery:${matrix.userID.split(":")[1]}");
final contacts = await matrix.loadFamedlyContacts();
expect(contacts.length, 2);
expect(contacts[0].senderId, '@alice:example.com');
expect(matrix.presences['@alice:example.com'].presence.presence,
PresenceType.online);
expect(presenceCounter, 1);
@ -207,10 +204,6 @@ void main() {
matrix.getRoomByAlias(
"#famedlyContactDiscovery:${matrix.userID.split(":")[1]}"),
null);
final altContacts = await matrix.loadFamedlyContacts();
altContacts.forEach((u) => print(u.id));
expect(altContacts.length, 2);
expect(altContacts[0].senderId, '@alice:example.com');
});
test('Logout', () async {