cinny icon indicating copy to clipboard operation
cinny copied to clipboard

Fix avatar in room header on bridge-created rooms

Open SebSK3 opened this issue 1 year ago • 4 comments

Description

This would always fallback to default avatar when usercount is more than 3 in direct message. It is not always the case, as the bridge created rooms have 3 people: You, the bridge, and the puppet that's sending the message.

let avatarSrc = room.getAvatarUrl(mx.baseUrl, 36, 36, 'crop');
  avatarSrc = isDM
    ? room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 36, 36, 'crop')
    : avatarSrc;

I've replaced it to

let avatarSrc = room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 24, 24, 'crop') || null;
if (avatarSrc === null) avatarSrc = room.getAvatarUrl(mx.baseUrl, 36, 36, 'crop') || null;

Which is how avatar source is determined in drawer, where it is correct.

Fixes #1619

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings

SebSK3 avatar Jan 15 '24 19:01 SebSK3

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Jan 15 '24 19:01 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

SebSK3 avatar Jan 15 '24 19:01 SebSK3

Is this the same as https://github.com/cinnyapp/cinny/pull/1076?

aceArt-GmbH avatar Jan 16 '24 07:01 aceArt-GmbH

Is this the same as #1076?

It is not, i am changing it in RoomHeader, not drawer.

SebSK3 avatar Jan 16 '24 13:01 SebSK3