From 49abece92b5144c2d71f95281ae8d72528eebf68 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 16 Feb 2026 14:30:59 -0500 Subject: [PATCH] Includes quotes of your messages in 'notify for mentions' setting. Fixes #14595 --- .../securesms/notifications/v2/NotificationItem.kt | 2 +- .../notifications/v2/NotificationStateProvider.kt | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationItem.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationItem.kt index edf07a8a9f..e018b2e521 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationItem.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationItem.kt @@ -220,7 +220,7 @@ class MessageNotification(threadRecipient: Recipient, record: MessageRecord) : N override val timestamp: Long = record.timestamp override val authorRecipient: Recipient = record.fromRecipient.resolve() override val isNewNotification: Boolean = notifiedTimestamp == 0L && !record.isEditMessage - val hasSelfMention = record.hasSelfMention() + val hasSelfMention = record.hasSelfMention() || (record is MmsMessageRecord && record.quote?.author == Recipient.self().id) private var thumbnailInfo: ThumbnailInfo = NotificationThumbnails.getWithoutModifying(this) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationStateProvider.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationStateProvider.kt index 2a91f12acd..876185f025 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationStateProvider.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationStateProvider.kt @@ -167,13 +167,13 @@ object NotificationStateProvider { isUnreadMessage && !messageRecord.isOutgoing && isGroupStoryReply && - (isParentStorySentBySelf || messageRecord.hasSelfMention() || (hasSelfRepliedToStory && !messageRecord.isStoryReaction())) + (isParentStorySentBySelf || messageRecord.hasSelfMentionOrQuoteOfSelf() || (hasSelfRepliedToStory && !messageRecord.isStoryReaction())) fun includeMessage(notificationProfile: NotificationProfile?): MessageInclusion { return if (isUnreadIncoming || stickyThread || isNotifiableGroupStoryMessage || isIncomingMissedCall) { - if (threadRecipient.isMuted && (threadRecipient.isDoNotNotifyMentions || !messageRecord.hasSelfMention())) { + if (threadRecipient.isMuted && (threadRecipient.isDoNotNotifyMentions || !messageRecord.hasSelfMentionOrQuoteOfSelf())) { MessageInclusion.MUTE_FILTERED - } else if (notificationProfile != null && !notificationProfile.isRecipientAllowed(threadRecipient.id) && !(notificationProfile.allowAllMentions && messageRecord.hasSelfMention())) { + } else if (notificationProfile != null && !notificationProfile.isRecipientAllowed(threadRecipient.id) && !(notificationProfile.allowAllMentions && messageRecord.hasSelfMentionOrQuoteOfSelf())) { MessageInclusion.PROFILE_FILTERED } else { MessageInclusion.INCLUDE @@ -209,6 +209,10 @@ object NotificationStateProvider { private val Recipient.isDoNotNotifyMentions: Boolean get() = mentionSetting == RecipientTable.MentionSetting.DO_NOT_NOTIFY + + private fun MessageRecord.hasSelfMentionOrQuoteOfSelf(): Boolean { + return hasSelfMention() || (this is MmsMessageRecord && quote?.author == Recipient.self().id) + } } private enum class MessageInclusion {