diff --git a/src/components/chat/ChatModel.cpp b/src/components/chat/ChatModel.cpp index 32f7b7079..65ac8d345 100644 --- a/src/components/chat/ChatModel.cpp +++ b/src/components/chat/ChatModel.cpp @@ -622,7 +622,6 @@ void ChatModel::removeEntry (ChatEntryData &entry) { void ChatModel::insertCall (const shared_ptr &callLog) { linphone::Call::Status status = callLog->getStatus(); - switch (status) { case linphone::Call::Status::Aborted: case linphone::Call::Status::EarlyAborted: diff --git a/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.cpp b/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.cpp index 61b4e7e65..80c8a2a26 100644 --- a/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.cpp +++ b/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.cpp @@ -39,7 +39,7 @@ AbstractMessageCountNotifier::AbstractMessageCountNotifier (QObject *parent) : Q ); QObject::connect( coreManager->getHandlers().get(), &CoreHandlers::messageReceived, - this, &AbstractMessageCountNotifier::handleMessageReceived + this, &AbstractMessageCountNotifier::updateUnreadMessageCount ); QObject::connect( coreManager->getSettingsModel(), &SettingsModel::chatEnabledChanged, @@ -50,10 +50,7 @@ AbstractMessageCountNotifier::AbstractMessageCountNotifier (QObject *parent) : Q // ----------------------------------------------------------------------------- void AbstractMessageCountNotifier::updateUnreadMessageCount () { - mUnreadMessageCount = 0; - for (const auto &chatRoom : CoreManager::getInstance()->getCore()->getChatRooms()) - mUnreadMessageCount += chatRoom->getUnreadMessagesCount(); - + mUnreadMessageCount = CoreManager::getInstance()->getCore()->getUnreadChatMessageCountFromActiveLocals(); internalNotifyUnreadMessageCount(); } @@ -72,8 +69,3 @@ void AbstractMessageCountNotifier::handleChatModelCreated (const shared_ptr &) { - mUnreadMessageCount++; - internalNotifyUnreadMessageCount(); -} diff --git a/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.hpp b/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.hpp index 89fe27549..f039cde47 100644 --- a/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.hpp +++ b/src/components/core/messages-count-notifier/AbstractMessageCountNotifier.hpp @@ -50,7 +50,6 @@ private: void internalNotifyUnreadMessageCount (); void handleChatModelCreated (const std::shared_ptr &chatModel); - void handleMessageReceived (const std::shared_ptr &message); int mUnreadMessageCount = 0; };