diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c77c5169..8d407e5a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Video conference. - Log viewer. - Option to set the display name in "using an account" tab of assistant. +- Long pressed buttons. +- Phone dialpad on main window. ### Fixed - Crash on exit. +- Crash when using no account. - Memory stability. +- Show display name of the caller if it exists instead of call logs. ## 4.4.4 - 2022-06-01 diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index ec6bb9d19..fcbc6f536 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -852,7 +852,7 @@ void CallModel::searchReceived(std::list }else{ if((*it)->getAddress()->weakEqual(mRemoteAddress)){ std::string newDisplayName = (*it)->getAddress()->getDisplayName(); - if(!newDisplayName.empty())// Override only if there is one + if( ((*it)->getSourceFlags() & (int) linphone::MagicSearchSource::CallLogs) == 0 || newDisplayName.empty()) setRemoteDisplayName(newDisplayName); found = true; } diff --git a/linphone-app/src/utils/Utils.cpp b/linphone-app/src/utils/Utils.cpp index f0a92cb27..96c0cc6cc 100644 --- a/linphone-app/src/utils/Utils.cpp +++ b/linphone-app/src/utils/Utils.cpp @@ -489,16 +489,21 @@ QString Utils::getDisplayName(const std::shared_ptr& ad if(model && model->getVcardModel()) displayName = model->getVcardModel()->getUsername(); else{ - auto callHistory = CoreManager::getInstance()->getCore()->getCallLogs(); - auto callLog = std::find_if(callHistory.begin(), callHistory.end(), [address](std::shared_ptr& cl){ - return cl->getRemoteAddress()->weakEqual(address); - }); - if(callLog != callHistory.end()) - displayName = QString::fromStdString((*callLog)->getRemoteAddress()->getDisplayName()); - if(displayName == "") - displayName = QString::fromStdString(address->getDisplayName()); - if(displayName == "") - displayName = Utils::coreStringToAppString(address->getUsername()); + // Try to get display from full address + displayName = QString::fromStdString(address->getDisplayName()); + if( displayName == ""){ + // Try to get display name from logs + auto callHistory = CoreManager::getInstance()->getCore()->getCallLogs(); + auto callLog = std::find_if(callHistory.begin(), callHistory.end(), [address](std::shared_ptr& cl){ + return cl->getRemoteAddress()->weakEqual(address); + }); + if(callLog != callHistory.end()) + displayName = QString::fromStdString((*callLog)->getRemoteAddress()->getDisplayName()); + if(displayName == "") + displayName = QString::fromStdString(address->getDisplayName()); + if(displayName == "") + displayName = Utils::coreStringToAppString(address->getUsername()); + } } } return displayName;