mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 19:38:09 +00:00
Add Missed call count for local proxies
This commit is contained in:
parent
c41f337907
commit
eca8bd8ab4
6 changed files with 17 additions and 1 deletions
|
|
@ -310,6 +310,9 @@ int CoreManager::getEventCount () const {
|
|||
int CoreManager::getMissedCallCount(const QString &peerAddress, const QString &localAddress)const{
|
||||
return mEventCountNotifier ? mEventCountNotifier->getMissedCallCount(peerAddress, localAddress) : 0;
|
||||
}
|
||||
int CoreManager::getMissedCallCountFromLocal( const QString &localAddress)const{
|
||||
return mEventCountNotifier ? mEventCountNotifier->getMissedCallCountFromLocal(localAddress) : 0;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CoreManager::iterate () {
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ public:
|
|||
Q_INVOKABLE void cleanLogs () const;
|
||||
|
||||
int getMissedCallCount(const QString &peerAddress, const QString &localAddress) const;// Get missed call count from a chat (useful for showing bubbles on Timelines)
|
||||
int getMissedCallCountFromLocal(const QString &localAddress) const;// Get missed call count from a chat (useful for showing bubbles on Timelines)
|
||||
|
||||
signals:
|
||||
void coreCreated ();
|
||||
|
|
|
|||
|
|
@ -77,6 +77,15 @@ int AbstractEventCountNotifier::getMissedCallCount(const QString &peerAddress, c
|
|||
else
|
||||
return 0;
|
||||
}
|
||||
// Get missed call from a chat (useful for showing bubbles on Timelines)
|
||||
int AbstractEventCountNotifier::getMissedCallCountFromLocal(const QString &localAddress) const{
|
||||
int count = 0;
|
||||
for(auto it = mMissedCalls.cbegin() ; it != mMissedCalls.cend() ; ++it){
|
||||
if(it.key().second == localAddress)
|
||||
count += *it;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void AbstractEventCountNotifier::handleChatModelCreated (const shared_ptr<ChatModel> &chatModel) {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public:
|
|||
|
||||
int getEventCount () const { return mUnreadMessageCount + getMissedCallCount(); }
|
||||
int getMissedCallCount(const QString &peerAddress, const QString &localAddress) const;// Get missed call count from a chat (useful for showing bubbles on Timelines)
|
||||
int getMissedCallCountFromLocal(const QString &localAddress) const;// Get missed call count from a chat (useful for showing bubbles on Timelines)
|
||||
|
||||
signals:
|
||||
void eventCountChanged (int count);
|
||||
|
|
|
|||
|
|
@ -406,6 +406,7 @@ QVariantList AccountSettingsModel::getAccounts () const {
|
|||
account["sipAddress"] = Utils::coreStringToAppString(core->createPrimaryContactParsed()->asStringUriOnly());
|
||||
account["fullSipAddress"] = Utils::coreStringToAppString(core->createPrimaryContactParsed()->asString());
|
||||
account["unreadMessageCount"] = core->getUnreadChatMessageCountFromLocal(core->createPrimaryContactParsed());
|
||||
account["missedCallCount"] = CoreManager::getInstance()->getMissedCallCountFromLocal(account["sipAddress"].toString());
|
||||
account["proxyConfig"].setValue(nullptr);
|
||||
accounts << account;
|
||||
}
|
||||
|
|
@ -416,6 +417,7 @@ QVariantList AccountSettingsModel::getAccounts () const {
|
|||
account["fullSipAddress"] = Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asString());
|
||||
account["proxyConfig"].setValue(proxyConfig);
|
||||
account["unreadMessageCount"] = proxyConfig->getUnreadChatMessageCount();
|
||||
account["missedCallCount"] = CoreManager::getInstance()->getMissedCallCountFromLocal(account["sipAddress"].toString());
|
||||
accounts << account;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ DialogPlus {
|
|||
|
||||
MessageCounter {
|
||||
anchors.fill: parent
|
||||
count: flattenedModel.unreadMessageCount
|
||||
count: flattenedModel.unreadMessageCount+flattenedModel.missedCallCount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue