From 66d3e840100cc3b5bf6e678b0794e630ec78d23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 30 Nov 2023 11:55:18 +0100 Subject: [PATCH] notifications: Show notifications for rooms other than the active one Prior to this, we would only show notifications for sessions other than the active one. The expectation should be to have notifications for any room that is not currently opened. --- src/session/model/notifications.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/session/model/notifications.rs b/src/session/model/notifications.rs index 887c16a4..f83aea55 100644 --- a/src/session/model/notifications.rs +++ b/src/session/model/notifications.rs @@ -116,10 +116,15 @@ impl Notifications { let window = app.active_window().and_downcast::(); let session_id = session.session_id(); - // Don't show notifications for the current session if the window is active. - if window - .is_some_and(|w| w.is_active() && w.current_session_id().as_deref() == Some(session_id)) - { + // Don't show notifications for the current room in the current session if the + // window is active. + if window.is_some_and(|w| { + w.is_active() + && w.current_session_id().as_deref() == Some(session_id) + && w.session_view() + .selected_room() + .is_some_and(|r| r.room_id() == matrix_notification.room_id) + }) { return; }