Skip to content

Commit d2d597e

Browse files
committed
Restore NotifiableEvent.shouldIgnoreEventInRoom(appState)
1 parent 42a4297 commit d2d597e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotificationDrawerManager.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
3030
import io.element.android.libraries.matrix.ui.media.ImageLoaderHolder
3131
import io.element.android.libraries.push.api.notifications.NotificationDrawerManager
3232
import io.element.android.libraries.push.impl.notifications.model.NotifiableEvent
33+
import io.element.android.libraries.push.impl.notifications.model.shouldIgnoreEventInRoom
3334
import io.element.android.services.appnavstate.api.AppNavigationStateService
3435
import io.element.android.services.appnavstate.api.NavigationState
3536
import io.element.android.services.appnavstate.api.currentSessionId
@@ -112,6 +113,9 @@ class DefaultNotificationDrawerManager @Inject constructor(
112113
* Events might be grouped and there might not be one notification per event!
113114
*/
114115
suspend fun onNotifiableEventReceived(notifiableEvent: NotifiableEvent) {
116+
if (notifiableEvent.shouldIgnoreEventInRoom(appNavigationStateService.appNavigationState.value)) {
117+
return
118+
}
115119
renderEvents(listOf(notifiableEvent))
116120
}
117121

0 commit comments

Comments
 (0)