forked from Nexus/nexus
don't pass is_avatar for avatars
This is because Gomuks will not give AVIFs back for avatars./
This commit is contained in:
parent
6e3bc596fd
commit
f80ceb0736
3 changed files with 9 additions and 9 deletions
|
|
@ -121,18 +121,20 @@ class UnifiedPushController extends AsyncNotifier<String?> {
|
||||||
|
|
||||||
final icon = notification.roomAvatar == null
|
final icon = notification.roomAvatar == null
|
||||||
? null
|
? null
|
||||||
: await client.downloadMedia(
|
: await client
|
||||||
.new(mxc: notification.roomAvatar!, isAvatar: true),
|
.downloadMedia(.new(mxc: notification.roomAvatar!))
|
||||||
);
|
.then<File?>((file) => file)
|
||||||
|
.onError((_, _) => null);
|
||||||
|
|
||||||
final pmp = notification.perMessageProfile;
|
final pmp = notification.perMessageProfile;
|
||||||
final senderAvatarUrl = pmp?.avatar ?? notification.sender.avatar;
|
final senderAvatarUrl = pmp?.avatar ?? notification.sender.avatar;
|
||||||
// Only Android can show the sender's avatar
|
// Only Android can show the sender's avatar
|
||||||
final senderAvatar = senderAvatarUrl == null || !Platform.isAndroid
|
final senderAvatar = senderAvatarUrl == null || !Platform.isAndroid
|
||||||
? null
|
? null
|
||||||
: await client.downloadMedia(
|
: await client
|
||||||
.new(mxc: senderAvatarUrl, isAvatar: true),
|
.downloadMedia(.new(mxc: senderAvatarUrl))
|
||||||
);
|
.then<File?>((file) => file)
|
||||||
|
.onError((_, _) => null);
|
||||||
|
|
||||||
await ref
|
await ref
|
||||||
.read(NotificationController.provider.notifier)
|
.read(NotificationController.provider.notifier)
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ part "download_media.g.dart";
|
||||||
class const DownloadMediaRequest({
|
class const DownloadMediaRequest({
|
||||||
required final Uri mxc,
|
required final Uri mxc,
|
||||||
final bool encrypted = false,
|
final bool encrypted = false,
|
||||||
final bool isAvatar = false,
|
|
||||||
final bool thumbnailAvatar = false,
|
|
||||||
}) with _$DownloadMediaRequest {
|
}) with _$DownloadMediaRequest {
|
||||||
Map<String, Object?> toJson() => _$DownloadMediaRequestToJson(this);
|
Map<String, Object?> toJson() => _$DownloadMediaRequestToJson(this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ final class const AvatarOrHash(
|
||||||
child: avatar == null
|
child: avatar == null
|
||||||
? fallback ?? box
|
? fallback ?? box
|
||||||
: Image(
|
: Image(
|
||||||
image: MxcImage(ref, .new(mxc: avatar!, isAvatar: true)),
|
image: MxcImage(ref, .new(mxc: avatar!)),
|
||||||
fit: .cover,
|
fit: .cover,
|
||||||
loadingBuilder: (_, child, loadingProgress) =>
|
loadingBuilder: (_, child, loadingProgress) =>
|
||||||
loadingProgress == null ? child : fallback ?? box,
|
loadingProgress == null ? child : fallback ?? box,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue