From 1c18288fbaac5b74b3b3b4ade9139f4c238996d5 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 11 Apr 2024 14:08:49 +0200 Subject: [PATCH] Notify reactions only on our messages. --- CHANGELOG.md | 1 + linphone-app/src/components/core/CoreHandlers.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55710b9b1..fd88f7f06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Option to mute chat reactions. +- Notify reactions only on local accounts messages. ## 5.2.3 - 2024-03-29 diff --git a/linphone-app/src/components/core/CoreHandlers.cpp b/linphone-app/src/components/core/CoreHandlers.cpp index 8f19cfcc1..37213c25e 100644 --- a/linphone-app/src/components/core/CoreHandlers.cpp +++ b/linphone-app/src/components/core/CoreHandlers.cpp @@ -331,7 +331,10 @@ void CoreHandlers::onNewMessageReaction(const std::shared_ptr & appSettings.beginGroup("chatrooms"); - if( !message || CoreManager::getInstance()->getAccountSettingsModel()->findAccount(reaction->getFromAddress()) || !settingsModel->getChatReactionsNotificationsEnabled()) + // 0. Do not notify if there is no message, it is our reaction, the notification has been deactivated or the message is not ours. + if( !message || CoreManager::getInstance()->getAccountSettingsModel()->findAccount(reaction->getFromAddress()) || !settingsModel->getChatReactionsNotificationsEnabled() + || !CoreManager::getInstance()->getAccountSettingsModel()->findAccount(message->getFromAddress()) + ) return; // 1. Do not notify if chat is not activated. if (chatRoom->getCurrentParams()->getEncryptionBackend() == linphone::ChatRoom::EncryptionBackend::None && !settingsModel->getStandardChatEnabled()