fix: Do not request users in not joined rooms

This commit is contained in:
Christian Pauly 2022-11-07 08:41:15 +01:00
parent 70af77b3ac
commit f8140866ae
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)