From 42cbdf0a6c15dfa5fb0b8e8c915c8a73315bfb9d Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Mon, 11 Oct 2021 14:27:08 -0500 Subject: [PATCH] Dont set person on sent message notification Signed-off-by: Alex Baker --- changelog.d/4221.bugfix | 1 + .../notifications/NotificationDrawerManager.kt | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 changelog.d/4221.bugfix diff --git a/changelog.d/4221.bugfix b/changelog.d/4221.bugfix new file mode 100644 index 0000000000..76c66898b1 --- /dev/null +++ b/changelog.d/4221.bugfix @@ -0,0 +1 @@ +Fix conversation notification for sent messages diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt index 37de7b1a75..7d75fd27d5 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt @@ -325,11 +325,15 @@ class NotificationDrawerManager @Inject constructor(private val context: Context } roomEventGroupInfo.hasNewEvent = roomEventGroupInfo.hasNewEvent || !event.hasBeenDisplayed - val senderPerson = Person.Builder() - .setName(event.senderName) - .setIcon(iconLoader.getUserIcon(event.senderAvatarPath)) - .setKey(event.senderId) - .build() + val senderPerson = if (event.outGoingMessage) { + null + } else { + Person.Builder() + .setName(event.senderName) + .setIcon(iconLoader.getUserIcon(event.senderAvatarPath)) + .setKey(event.senderId) + .build() + } if (event.outGoingMessage && event.outGoingMessageFailed) { style.addMessage(stringProvider.getString(R.string.notification_inline_reply_failed), event.timestamp, senderPerson)