don't pass is_avatar for avatars

This is because Gomuks will not give AVIFs back for avatars./
This commit is contained in:
Henry Hiles 2026-11-26 15:10:08 -05:00
commit f80ceb0736
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
3 changed files with 9 additions and 9 deletions

View file

@ -121,18 +121,20 @@ class UnifiedPushController extends AsyncNotifier<String?> {
final icon = notification.roomAvatar == null
? null
: await client.downloadMedia(
.new(mxc: notification.roomAvatar!, isAvatar: true),
);
: await client
.downloadMedia(.new(mxc: notification.roomAvatar!))
.then<File?>((file) => file)
.onError((_, _) => null);
final pmp = notification.perMessageProfile;
final senderAvatarUrl = pmp?.avatar ?? notification.sender.avatar;
// Only Android can show the sender's avatar
final senderAvatar = senderAvatarUrl == null || !Platform.isAndroid
? null
: await client.downloadMedia(
.new(mxc: senderAvatarUrl, isAvatar: true),
);
: await client
.downloadMedia(.new(mxc: senderAvatarUrl))
.then<File?>((file) => file)
.onError((_, _) => null);
await ref
.read(NotificationController.provider.notifier)

View file

@ -8,8 +8,6 @@ part "download_media.g.dart";
class const DownloadMediaRequest({
required final Uri mxc,
final bool encrypted = false,
final bool isAvatar = false,
final bool thumbnailAvatar = false,
}) with _$DownloadMediaRequest {
Map<String, Object?> toJson() => _$DownloadMediaRequestToJson(this);

View file

@ -37,7 +37,7 @@ final class const AvatarOrHash(
child: avatar == null
? fallback ?? box
: Image(
image: MxcImage(ref, .new(mxc: avatar!, isAvatar: true)),
image: MxcImage(ref, .new(mxc: avatar!)),
fit: .cover,
loadingBuilder: (_, child, loadingProgress) =>
loadingProgress == null ? child : fallback ?? box,