mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-20 17:57:29 +00:00
Includes quotes of your messages in 'notify for mentions' setting.
Fixes #14595
This commit is contained in:
committed by
Alex Hart
parent
b48b1f031e
commit
49abece92b
@@ -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)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user