From 74a0b180d7877a5a142f504dc3c005f1b72462bb Mon Sep 17 00:00:00 2001 From: "roman.turubayev@econophysica.com" Date: Sun, 1 Sep 2024 13:25:50 +0700 Subject: [PATCH] #7761 Fixed case when event info is absent --- .../vector/app/features/notifications/NotificationFactory.kt | 2 +- .../app/features/notifications/NotificationRenderer.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt index b8fa99837e..47833f057a 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt @@ -35,7 +35,7 @@ class NotificationFactory @Inject constructor( eventId = events.firstOrNull()?.event?.eventId.orEmpty(), roomName = events.firstOrNull()?.event?.roomName.orEmpty(), notification = notificationUtils.buildIncomingJitsiCallNotification( - callId = events.firstOrNull()?.event?.eventId.orEmpty(), + callId = events.firstOrNull()?.event?.eventId.orEmpty().ifEmpty { roomId }, signalingRoomId = roomId, otherUserId = events.firstOrNull()?.event?.matrixID.orEmpty(), isIncomingCall = true, diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt index 83adfd5176..df948cd8b6 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt @@ -76,8 +76,9 @@ class NotificationRenderer @Inject constructor( when (wrapper) { is JitsiNotification.IncomingCall -> { Timber.d("Updating jitsi call notification ${wrapper.roomId} for room ${wrapper.roomName}") - if (wrapper.eventId.isNotEmpty()) { - notificationDisplayer.showNotificationMessage(wrapper.eventId, JITSI_CALL_NOTIFICATION_ID, wrapper.notification) + if (wrapper.eventId.isNotEmpty() || wrapper.roomId.isNotEmpty()) { + val tag = wrapper.eventId.ifEmpty { wrapper.roomId } + notificationDisplayer.showNotificationMessage(tag, JITSI_CALL_NOTIFICATION_ID, wrapper.notification) } } }