Merge branch 'krille/do-not-request-users-invite-rooms' into 'main'

fix: Do not request users in not joined rooms

See merge request famedly/company/frontend/famedlysdk!1159
This commit is contained in:
td 2022-11-07 11:37:00 +00:00
commit 79378714b9
1 changed files with 8 additions and 1 deletions

View File

@ -1458,9 +1458,16 @@ class Room {
setState(user);
}
}
if (_requestedParticipants || participantListComplete) {
// Do not request users from the server if we have already done it
// in this session, have a complete list locally or are not a joined
// member of this room.
if (_requestedParticipants ||
participantListComplete ||
membership != Membership.join) {
return getParticipants();
}
final matrixEvents = await client.getMembersByRoom(id);
final users = matrixEvents
?.map((e) => Event.fromMatrixEvent(e, this).asUser)