mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-30 10:51:13 +02:00
delegate avatar selection to room for rooms with two members (but not in m.direct)
This commit is contained in:
parent
5afb3bfb29
commit
d7868dbe33
@ -119,15 +119,7 @@ module.exports = React.createClass({
|
|||||||
} else {
|
} else {
|
||||||
// if the room is not marked as a 1:1, but only has max 2 members
|
// if the room is not marked as a 1:1, but only has max 2 members
|
||||||
// then still try to show any avatar (pref. other member)
|
// then still try to show any avatar (pref. other member)
|
||||||
const totalMemberCount = room.getJoinedMemberCount() +
|
otherMember = room.getAvatarFallbackMember();
|
||||||
room.getInvitedMemberCount();
|
|
||||||
const members = room.currentState.getMembers();
|
|
||||||
if (totalMemberCount == 2) {
|
|
||||||
const myUserId = MatrixClientPeg.get().getUserId();
|
|
||||||
otherMember = members.find(m => m.userId !== myUserId);
|
|
||||||
} else if (totalMemberCount == 1) {
|
|
||||||
otherMember = members[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (otherMember) {
|
if (otherMember) {
|
||||||
return otherMember.getAvatarUrl(
|
return otherMember.getAvatarUrl(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user