diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index b5b5981ff..9e6879a96 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -206,15 +206,12 @@ class NotificationsManager @MainThread constructor(private val context: Context) message: ChatMessage, reaction: ChatMessageReaction ) { - val address = reaction.fromAddress - val defaultAccountAddress = core.defaultAccount?.params?.identityAddress - // Do not notify our own reactions, it won't be done anyway since the chat room is very likely to be currently displayed - if (defaultAccountAddress != null && defaultAccountAddress.weakEqual(address)) return + if (corePreferences.disableChat) return + val address = reaction.fromAddress Log.i( "$TAG Reaction received [${reaction.body}] from [${address.asStringUriOnly()}] for message [$message]" ) - if (corePreferences.disableChat) return val id = LinphoneUtils.getChatRoomId(chatRoom) /*if (id == currentlyDisplayedChatRoomId) { @@ -232,6 +229,10 @@ class NotificationsManager @MainThread constructor(private val context: Context) Log.i("$TAG Reaction has been sent by ourselves, do not notify it") return } + if (!coreContext.isAddressMyself(message.fromAddress)) { + Log.i("$TAG Reaction isn't for a message we sent, do not notify it") + return + } if (reaction.body.isNotEmpty()) { showChatMessageReactionNotification(chatRoom, reaction.body, address, message) @@ -742,7 +743,6 @@ class NotificationsManager @MainThread constructor(private val context: Context) val originalMessage = LinphoneUtils.getTextDescribingMessage(message) val text = AppUtils.getString(R.string.notification_chat_message_reaction_received).format( - displayName, reaction, originalMessage ) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2078ed6cd..6b891fcec 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -45,7 +45,7 @@ &appName; notifications d\'appels manqués &appName; notification de service &appName; notifications des conversations - %s a réagi par %s à : %s + A réagi par %s à : %s Marquer comme lu Répondre Appel manqué de %s diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 806ff4d6c..d1e02ae8f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -80,7 +80,7 @@ &appName; missed calls notifications &appName; service notification &appName; instant messages notifications - %s has reacted by %s to: %s + Reacted by %s to: %s Mark as read Reply Missed call from %s