Skip to content

Commit

Permalink
chore: Do not request thousands of users on invite page
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Oct 26, 2024
1 parent 41782c4 commit a422d47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pages/invitation_selection/invitation_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
Expand Down

0 comments on commit a422d47

Please sign in to comment.