Commit 24406352 authored by Ronan's avatar Ronan

feat(MessageCount): use new API to deal correctly with locals

parent 894428b7
......@@ -622,7 +622,6 @@ void ChatModel::removeEntry (ChatEntryData &entry) {
void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) {
linphone::Call::Status status = callLog->getStatus();
switch (status) {
case linphone::Call::Status::Aborted:
case linphone::Call::Status::EarlyAborted:
......
......@@ -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<Chat
this, &AbstractMessageCountNotifier::updateUnreadMessageCount
);
}
void AbstractMessageCountNotifier::handleMessageReceived (const shared_ptr<linphone::ChatMessage> &) {
mUnreadMessageCount++;
internalNotifyUnreadMessageCount();
}
......@@ -50,7 +50,6 @@ private:
void internalNotifyUnreadMessageCount ();
void handleChatModelCreated (const std::shared_ptr<ChatModel> &chatModel);
void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
int mUnreadMessageCount = 0;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment