@ -456,6 +456,7 @@ class DefaultMessageNotifier : MessageNotifier {
Log . i ( TAG , " Posted notification. $notification " )
}
// Note: The only use of this method is from `updateNotification`, above.
private fun constructNotificationState ( context : Context , cursor : Cursor ) : NotificationState {
val notificationState = NotificationState ( )
val reader = get ( context ) . mmsSmsDatabase ( ) . readerFor ( cursor )
@ -533,7 +534,11 @@ class DefaultMessageNotifier : MessageNotifier {
blindedPublicKey = generateBlindedId ( threadId , context )
cache [ threadId ] = blindedPublicKey
}
// Only proceed with notifications if the thread is not muted
if ( threadRecipients == null || ! threadRecipients . isMuted ) {
// If this notification is regarding a mention..
if ( threadRecipients != null && threadRecipients . notifyType == RecipientDatabase . NOTIFY _TYPE _MENTIONS ) {
// check if mentioned here
var isQuoteMentioned = false
@ -547,9 +552,14 @@ class DefaultMessageNotifier : MessageNotifier {
if ( body . toString ( ) . contains ( " @ $userPublicKey " ) || body . toString ( ) . contains ( " @ $blindedPublicKey " ) || isQuoteMentioned ) {
notificationState . addNotification ( NotificationItem ( id , mms , recipient , conversationRecipient , threadRecipients , threadId , body , timestamp , slideDeck ) )
}
// ..if this notification is regarding a thread..
} else if ( threadRecipients != null && threadRecipients . notifyType == RecipientDatabase . NOTIFY _TYPE _NONE ) {
Log . w ( " ACL " , " Hit the notify type NONE block. " )
// do nothing, no notifications
} else {
// If this notification is not a mention or thread notification then it must be RecipientDatabase.NOTIFY_TYPE_ALL because those are the only three enums.
// Note: This is the block that hits for 1-on-1 message notifications
Log . w ( " ACL " , " Hit the notify type ALL block " )
notificationState . addNotification ( NotificationItem ( id , mms , recipient , conversationRecipient , threadRecipients , threadId , body , timestamp , slideDeck ) )
}