From 5321a3768dda375b6622e081d04dad7e4fe54cf7 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Tue, 3 Dec 2024 19:00:44 +0100 Subject: [PATCH] chore: Remove conversationTitle if room is dm room in android notifications --- lib/utils/push_helper.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils/push_helper.dart b/lib/utils/push_helper.dart index 3b1194690..51aba8f9b 100644 --- a/lib/utils/push_helper.dart +++ b/lib/utils/push_helper.dart @@ -197,6 +197,7 @@ Future _tryPushHelper( final id = notification.roomId.hashCode; + final senderName = event.senderFromMemoryOrFallback.calcDisplayname(); // Show notification final newMessage = Message( @@ -205,7 +206,7 @@ Future _tryPushHelper( Person( bot: event.messageType == MessageTypes.Notice, key: event.senderId, - name: event.senderFromMemoryOrFallback.calcDisplayname(), + name: senderName, icon: senderAvatarFile == null ? null : ByteArrayAndroidIcon(senderAvatarFile), @@ -252,14 +253,14 @@ Future _tryPushHelper( styleInformation: messagingStyleInformation ?? MessagingStyleInformation( Person( - name: event.senderFromMemoryOrFallback.calcDisplayname(), + name: senderName, icon: roomAvatarFile == null ? null : ByteArrayAndroidIcon(roomAvatarFile), key: event.roomId, important: event.room.isFavourite, ), - conversationTitle: roomName, + conversationTitle: event.room.isDirectChat ? null : roomName, groupConversation: !event.room.isDirectChat, messages: [newMessage], ),