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?;
|
.await?;
|
||||||
|
|
||||||
|
let is_dm_or_group = matches!(
|
||||||
|
channel,
|
||||||
|
Channel::DirectMessage { .. } | Channel::Group { .. }
|
||||||
|
);
|
||||||
|
|
||||||
if !self.has_suppressed_notifications()
|
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
|
// send Push notifications
|
||||||
#[cfg(feature = "tasks")]
|
#[cfg(feature = "tasks")]
|
||||||
|
|||||||
Reference in New Issue
Block a user