From b0ea692706bed8de8bc5f3e82b9186700ba1ee0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Sun, 11 Apr 2021 10:50:30 +0200 Subject: [PATCH] fix: malformed pushrule error when event does not trigger any actions --- src/database/pusher.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/database/pusher.rs b/src/database/pusher.rs index 27e5926..9a9452c 100644 --- a/src/database/pusher.rs +++ b/src/database/pusher.rs @@ -216,16 +216,11 @@ pub async fn send_push_notice( notify = Some(n); } - let notify = notify.ok_or_else(|| { - Error::bad_database( - r#"Malformed pushrule contains none of these actions: ["dont_notify", "notify", "coalesce"]"#, - ) - })?; - - if notify { + if notify == Some(true) { send_notice(unread, pusher, tweaks, pdu, db).await?; } - + // Else the event triggered no actions + Ok(()) }