Includes quotes of your messages in 'notify for mentions' setting.

Fixes #14595
This commit is contained in:
Greyson Parrelli
2026-02-16 14:30:59 -05:00
committed by Alex Hart
parent b48b1f031e
commit 49abece92b
2 changed files with 8 additions and 4 deletions

View File

@@ -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)

View File

@@ -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 {