You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
move the fact that we're prototyping only with joined members up the stack to client
only MatrixClient really needs to know that for now we only load joined members, the rest of the code can be generic for other membership types as that is the eventual plan, to also support invites at least.
This commit is contained in:
@@ -767,7 +767,18 @@ MatrixClient.prototype.loadRoomMembersIfNeeded = async function(roomId) {
|
||||
if (!room || !room.membersNeedLoading()) {
|
||||
return;
|
||||
}
|
||||
const membersPromise = this.joinedMembers(roomId);
|
||||
const joinedMembersPromise = this.joinedMembers(roomId);
|
||||
const membersPromise = joinedMembersPromise.then((profiles) => {
|
||||
return Object.entries(profiles).map(([userId, profile]) => {
|
||||
return {
|
||||
userId: userId,
|
||||
avatarUrl: profile.avatar_url,
|
||||
displayName: profile.display_name,
|
||||
membership: "join", // as we need to support invitees as well
|
||||
// in the future, already include but hardcode it
|
||||
};
|
||||
});
|
||||
});
|
||||
await room.setLazilyLoadedMembers(membersPromise);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user