From 52c0d2f266b76d8975bba2d5e75c62bb30149c45 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 11 Mar 2026 05:15:00 +0700 Subject: [PATCH] fix: send push notifications for DM and group messages (#660) DMs and group messages never triggered push notifications because the condition only checked for explicit @mentions. DMs don't use mentions, so users were never notified of new direct messages. Signed-off-by: sanasol --- crates/core/database/src/models/messages/model.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/core/database/src/models/messages/model.rs b/crates/core/database/src/models/messages/model.rs index 11bc2eac..2db57b12 100644 --- a/crates/core/database/src/models/messages/model.rs +++ b/crates/core/database/src/models/messages/model.rs @@ -687,8 +687,13 @@ impl Message { ) .await?; + let is_dm_or_group = matches!( + channel, + Channel::DirectMessage { .. } | Channel::Group { .. } + ); + if !self.has_suppressed_notifications() - && (self.mentions.is_some() || self.contains_mass_push_mention()) + && (is_dm_or_group || self.mentions.is_some() || self.contains_mass_push_mention()) { // send Push notifications #[cfg(feature = "tasks")]