From 15543275c477484ddb388b6e4d4c21e49de9793f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Sat, 17 May 2025 16:40:09 +0200 Subject: [PATCH] chore: Follow up push avatars --- lib/utils/client_download_content_extension.dart | 2 +- lib/utils/push_helper.dart | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/utils/client_download_content_extension.dart b/lib/utils/client_download_content_extension.dart index f93d522f0..e159b7b8d 100644 --- a/lib/utils/client_download_content_extension.dart +++ b/lib/utils/client_download_content_extension.dart @@ -51,7 +51,7 @@ extension ClientDownloadContentExtension on Client { if (rounded) { final image = decodeImage(imageData); if (image != null) { - imageData = copyCropCircle(image).toUint8List(); + imageData = encodePng(copyCropCircle(image)); } } diff --git a/lib/utils/push_helper.dart b/lib/utils/push_helper.dart index 33d0cce30..f0ee658bf 100644 --- a/lib/utils/push_helper.dart +++ b/lib/utils/push_helper.dart @@ -17,6 +17,8 @@ import 'package:fluffychat/utils/client_manager.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart'; import 'package:fluffychat/utils/platform_infos.dart'; +const notificationAvatarDimension = 128; + Future pushHelper( PushNotification notification, { Client? client, @@ -165,8 +167,8 @@ Future _tryPushHelper( .downloadMxcCached( avatar, thumbnailMethod: ThumbnailMethod.crop, - width: 128, - height: 128, + width: notificationAvatarDimension, + height: notificationAvatarDimension, animated: false, isThumbnail: true, rounded: true, @@ -184,8 +186,8 @@ Future _tryPushHelper( .downloadMxcCached( senderAvatar, thumbnailMethod: ThumbnailMethod.crop, - width: 128, - height: 128, + width: notificationAvatarDimension, + height: notificationAvatarDimension, animated: false, isThumbnail: true, rounded: true,