From 9fa285e6ca8e0ed276a2b287b5160a418938019b Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Tue, 8 Mar 2022 14:06:28 +0300 Subject: [PATCH] Support showing push notifications for poll start events. --- .../app/features/notifications/NotifiableEventResolver.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt b/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt index ec034173fc..0cf586afea 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt @@ -94,7 +94,7 @@ class NotifiableEventResolver @Inject constructor( } suspend fun resolveInMemoryEvent(session: Session, event: Event, canBeReplaced: Boolean): NotifiableEvent? { - if (event.getClearType() != EventType.MESSAGE) return null + if (event.getClearType() !in listOf(EventType.MESSAGE, EventType.POLL_START)) return null // Ignore message edition if (event.isEdition()) return null @@ -153,7 +153,8 @@ class NotifiableEventResolver @Inject constructor( event.attemptToDecryptIfNeeded(session) // only convert encrypted messages to NotifiableMessageEvents when (event.root.getClearType()) { - EventType.MESSAGE -> { + EventType.MESSAGE, + EventType.POLL_START -> { val body = displayableEventFormatter.format(event, isDm = room.roomSummary()?.isDirect.orFalse(), appendAuthor = false).toString() val roomName = room.roomSummary()?.displayName ?: "" val senderDisplayName = event.senderInfo.disambiguatedDisplayName @@ -185,7 +186,7 @@ class NotifiableEventResolver @Inject constructor( soundName = null ) } - else -> null + else -> null } } }