chore: Do not request thousands of users on invite page

pull/1437/head
Krille 12 months ago
parent 41782c497e
commit a422d470da
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -34,7 +34,10 @@ class InvitationSelectionController extends State<InvitationSelection> {
Future<List<User>> getContacts(BuildContext context) async {
final client = Matrix.of(context).client;
final room = client.getRoomById(roomId!)!;
final participants = await room.requestParticipants();
final participants = (room.summary.mJoinedMemberCount ?? 0) > 100
? room.getParticipants()
: await room.requestParticipants();
participants.removeWhere(
(u) => ![Membership.join, Membership.invite].contains(u.membership),
);

Loading…
Cancel
Save