mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
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 <mail@sanasol.ws>
This commit is contained in:
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user