delegate avatar selection to room for rooms with two members (but not in m.direct)

pull/21833/head
Bruno Windels 2018-08-30 10:54:01 +02:00
parent 5afb3bfb29
commit d7868dbe33
1 changed files with 1 additions and 9 deletions

View File

@ -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(