diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a13464e..d562a9d9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - RF3987 to allow IRI parsing in chats. - Image display in chats from an URL. +- Display a notification of all kind of messages. ## 5.0.0 - 2022-12-07 diff --git a/linphone-app/src/components/core/CoreHandlers.cpp b/linphone-app/src/components/core/CoreHandlers.cpp index e77da4514..f00621f2e 100644 --- a/linphone-app/src/components/core/CoreHandlers.cpp +++ b/linphone-app/src/components/core/CoreHandlers.cpp @@ -227,29 +227,26 @@ void CoreHandlers::onMessagesReceived ( for(auto message : messages){ if( !message || message->isOutgoing() ) continue; - const string contentType = message->getContentType(); - if (contentType == "text/plain" || contentType == "application/vnd.gsma.rcs-ft-http+xml") { - messagesToSignal.push_back(message); - - // 1. Do not notify if chat is not activated. - if (chatRoom->getCurrentParams()->getEncryptionBackend() == linphone::ChatRoomEncryptionBackend::None && !settingsModel->getStandardChatEnabled() - || chatRoom->getCurrentParams()->getEncryptionBackend() != linphone::ChatRoomEncryptionBackend::None && !settingsModel->getSecureChatEnabled()) - continue; - - // 2. Notify with Notification popup. - if (coreManager->getSettingsModel()->getChatNotificationsEnabled() - && (!app->hasFocus() || !Utils::isMe(chatRoom->getLocalAddress())) - && !message->isRead())// On aggregation, the list can contains already displayed messages. - messagesToNotify.push_back(message); - else{ - notNotifyReasons.push_back( - "NotifEnabled=" + QString::number(coreManager->getSettingsModel()->getChatNotificationsEnabled()) - +" focus=" +QString::number(app->hasFocus()) - +" isMe=" +QString::number(Utils::isMe(chatRoom->getLocalAddress())) - +" isRead=" +QString::number(message->isRead()) - ); - } + messagesToSignal.push_back(message); + + // 1. Do not notify if chat is not activated. + if (chatRoom->getCurrentParams()->getEncryptionBackend() == linphone::ChatRoomEncryptionBackend::None && !settingsModel->getStandardChatEnabled() + || chatRoom->getCurrentParams()->getEncryptionBackend() != linphone::ChatRoomEncryptionBackend::None && !settingsModel->getSecureChatEnabled()) + continue; + + // 2. Notify with Notification popup. + if (coreManager->getSettingsModel()->getChatNotificationsEnabled() + && (!app->hasFocus() || !Utils::isMe(chatRoom->getLocalAddress())) + && !message->isRead())// On aggregation, the list can contains already displayed messages. + messagesToNotify.push_back(message); + else{ + notNotifyReasons.push_back( + "NotifEnabled=" + QString::number(coreManager->getSettingsModel()->getChatNotificationsEnabled()) + +" focus=" +QString::number(app->hasFocus()) + +" isMe=" +QString::number(Utils::isMe(chatRoom->getLocalAddress())) + +" isRead=" +QString::number(message->isRead()) + ); } } if( messagesToSignal.size() > 0)