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 019b37d61a..afea56c5b9 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 @@ -86,9 +86,9 @@ class NotificationFactory @Inject constructor( invitationNotifications: List, simpleNotifications: List, useCompleteNotificationFormat: Boolean): SummaryNotification { - val roomMeta = roomNotifications.mapToMeta() - val invitationMeta = invitationNotifications.mapToMeta() - val simpleMeta = simpleNotifications.mapToMeta() + val roomMeta = roomNotifications.filterIsInstance().map { it.meta } + val invitationMeta = invitationNotifications.filterIsInstance().map { it.meta } + val simpleMeta = simpleNotifications.filterIsInstance().map { it.meta } return when { roomMeta.isEmpty() && invitationMeta.isEmpty() && simpleMeta.isEmpty() -> SummaryNotification.Removed else -> SummaryNotification.Update( @@ -102,11 +102,6 @@ class NotificationFactory @Inject constructor( } } -private fun List.mapToMeta() = filterIsInstance().map { it.meta } - -@JvmName("mapToMetaOneShotNotification") -private fun List.mapToMeta() = filterIsInstance().map { it.meta } - sealed interface RoomNotification { data class Removed(val roomId: String) : RoomNotification data class Message(val notification: Notification, val shortcutInfo: ShortcutInfoCompat?, val meta: Meta) : RoomNotification {