From cd481d3ca98355773af07fad879b434a5f7d9609 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 4 Nov 2024 15:32:52 +0100 Subject: [PATCH] Add a message in the notification for the caption. Fixes #2602 --- .../notifications/factories/NotificationCreator.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt index dc57b0fe7b..b2a7a62679 100755 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt @@ -424,6 +424,17 @@ class DefaultNotificationCreator @Inject constructor( message.extras.putString(MESSAGE_EVENT_ID, event.eventId.value) } addMessage(message) + + // Add additional message for captions + if (event.imageUri != null && event.body != null) { + addMessage( + MessagingStyle.Message( + event.body, + event.timestamp, + senderPerson, + ) + ) + } } } }