From f69db1d16913c16a38fa31880eb0e32efd5ca30f Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Wed, 1 May 2024 13:09:01 +0200 Subject: [PATCH] notification client(bugfix): don't filter out the notification if we couldn't compute push actions with /context This is in line with what the other method using sliding sync does. This wasn't tested before, because this required `filter_by_push_rules()` to be enabled in the notification client; now that it's the default, the test revealed the bug, and so it could be fixed. --- crates/matrix-sdk-ui/src/notification_client.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/matrix-sdk-ui/src/notification_client.rs b/crates/matrix-sdk-ui/src/notification_client.rs index 06a6fe33b..eab81d6f2 100644 --- a/crates/matrix-sdk-ui/src/notification_client.rs +++ b/crates/matrix-sdk-ui/src/notification_client.rs @@ -494,12 +494,10 @@ impl NotificationClient { timeline_event = decrypted_event; } - if !timeline_event - .push_actions - .as_ref() - .is_some_and(|actions| actions.iter().any(|a| a.should_notify())) - { - return Ok(None); + if let Some(actions) = timeline_event.push_actions.as_ref() { + if !actions.iter().any(|a| a.should_notify()) { + return Ok(None); + } } Ok(Some(