diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotificationDrawerManager.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotificationDrawerManager.kt index 0fbd28aa3b..211d8d935a 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotificationDrawerManager.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotificationDrawerManager.kt @@ -224,7 +224,7 @@ class DefaultNotificationDrawerManager @Inject constructor( doRender: Boolean, action: (NotificationEventQueue) -> Unit, ) { - notificationState.updateQueuedEvents(this) { queuedEvents, _ -> + notificationState.updateQueuedEvents { queuedEvents, _ -> action(queuedEvents) } coroutineScope.refreshNotificationDrawer(doRender) @@ -247,7 +247,7 @@ class DefaultNotificationDrawerManager @Inject constructor( private suspend fun refreshNotificationDrawerBg(doRender: Boolean) { Timber.v("refreshNotificationDrawerBg()") - val eventsToRender = notificationState.updateQueuedEvents(this) { queuedEvents, renderedEvents -> + val eventsToRender = notificationState.updateQueuedEvents { queuedEvents, renderedEvents -> notifiableEventProcessor.process(queuedEvents.rawEvents(), renderedEvents).also { queuedEvents.clearAndAdd(it.onlyKeptEvents()) } diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotificationState.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotificationState.kt index 4737e891aa..0d8731548d 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotificationState.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotificationState.kt @@ -39,11 +39,10 @@ class NotificationState( ) { fun updateQueuedEvents( - drawerManager: DefaultNotificationDrawerManager, - action: DefaultNotificationDrawerManager.(NotificationEventQueue, List>) -> T + action: (NotificationEventQueue, List>) -> T ): T { return synchronized(queuedEvents) { - action(drawerManager, queuedEvents, renderedEvents) + action(queuedEvents, renderedEvents) } }