mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-06 20:23:08 +00:00
feat(MessageCount): use new API to deal correctly with locals
This commit is contained in:
parent
894428b76f
commit
2440635278
3 changed files with 2 additions and 12 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue