chore: Do not request thousands of users on invite page
This commit is contained in:
parent
41782c497e
commit
a422d470da
1 changed files with 4 additions and 1 deletions
|
|
@ -34,7 +34,10 @@ class InvitationSelectionController extends State<InvitationSelection> {
|
||||||
Future<List<User>> getContacts(BuildContext context) async {
|
Future<List<User>> getContacts(BuildContext context) async {
|
||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
final room = client.getRoomById(roomId!)!;
|
final room = client.getRoomById(roomId!)!;
|
||||||
final participants = await room.requestParticipants();
|
|
||||||
|
final participants = (room.summary.mJoinedMemberCount ?? 0) > 100
|
||||||
|
? room.getParticipants()
|
||||||
|
: await room.requestParticipants();
|
||||||
participants.removeWhere(
|
participants.removeWhere(
|
||||||
(u) => ![Membership.join, Membership.invite].contains(u.membership),
|
(u) => ![Membership.join, Membership.invite].contains(u.membership),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue