From c87450dafb072b559cb1be06c873cec3dfbde9a2 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 2 Jul 2020 10:41:23 +0000 Subject: [PATCH] Remove deprecated contactlist method --- lib/src/client.dart | 23 ----------------------- test/client_test.dart | 7 ------- 2 files changed, 30 deletions(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index 9b82014..2b959cf 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -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> loadFamedlyContacts() async { - var contacts = []; - var contactDiscoveryRoom = - getRoomByAlias('#famedlyContactDiscovery:${userID.domain}'); - if (contactDiscoveryRoom != null) { - contacts = await contactDiscoveryRoom.requestParticipants(); - } else { - var userMap = {}; - 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 setDisplayname(String displayname) => api.setDisplayname(userID, displayname); diff --git a/test/client_test.dart b/test/client_test.dart index 98caadc..41a9fab 100644 --- a/test/client_test.dart +++ b/test/client_test.dart @@ -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 {