Merge pull request #2141 from matrix-org/bwindels/fixdmavatar

Fix DM avatar
This commit is contained in:
David Baker 2018-08-30 11:45:54 +01:00 committed by GitHub
commit 75a2668e42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 10 deletions

View file

@ -119,15 +119,7 @@ module.exports = React.createClass({
} else {
// 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)
const totalMemberCount = room.getJoinedMemberCount() +
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];
}
otherMember = room.getAvatarFallbackMember();
}
if (otherMember) {
return otherMember.getAvatarUrl(