Migrate call logs after starting core.

Fix Ref initialization for sip addresses optimizations.
Update SDK to 5.2.78 (chat rooms loading optimization)
This commit is contained in:
Julien Wadel 2023-06-16 15:29:02 +02:00
parent 879fa31326
commit e6218bbd0a
4 changed files with 15 additions and 11 deletions

View file

@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Create thumbnails into memory instead of disk.
- Display video thumbnails.
- Crop thumbnail and pictures if distored.
- Update SDK to 5.2.72
## 5.0.18 - 2023-06-16

View file

@ -217,18 +217,16 @@ void CoreManager::cleanLogs () const {
void CoreManager::setDatabasesPaths () {
SET_DATABASE_PATH(Friends, Paths::getFriendsListFilePath());
linphone_core_set_call_logs_database_path(mCore->cPtr(), Paths::getCallHistoryFilePath().c_str());// Setting the message database let SDK to migrate data
if(QFile::exists(Utils::coreStringToAppString(Paths::getMessageHistoryFilePath()))){
linphone_core_set_chat_database_path(mCore->cPtr(), Paths::getMessageHistoryFilePath().c_str());// Setting the message database let SDK to migrate data
QFile::remove(Utils::coreStringToAppString(Paths::getMessageHistoryFilePath()));
}
}
#undef SET_DATABASE_PATH
// -----------------------------------------------------------------------------
void CoreManager::setOtherPaths () {
SET_DATABASE_PATH(CallLogs, Paths::getCallHistoryFilePath());// Setting the call logs database let SDK to migrate data
if (mCore->getZrtpSecretsFile().empty() || !Paths::filePathExists(mCore->getZrtpSecretsFile(), true))
mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilePath());// Use application path if Linphone default is not available
qInfo() << "Using ZrtpSecrets path : " << QString::fromStdString(mCore->getZrtpSecretsFile());
@ -253,6 +251,8 @@ void CoreManager::setResourcesPaths () {
// -----------------------------------------------------------------------------
#undef SET_DATABASE_PATH
void CoreManager::createLinphoneCore (const QString &configPath) {
qInfo() << QStringLiteral("Launch async core creation.");

View file

@ -590,10 +590,11 @@ void SipAddressesModel::initSipAddresses () {
qInfo() << "Sip addresses model from Chats :" << stepsTimer.restart() << "ms.";
initSipAddressesFromCalls();
qInfo() << "Sip addresses model from Calls :" << stepsTimer.restart() << "ms.";
initRefs();
qInfo() << "Sip addresses model from Refs :" << stepsTimer.restart() << "ms.";
initSipAddressesFromContacts();
qInfo() << "Sip addresses model from Contacts :" << stepsTimer.restart() << "ms.";
mRefs.clear();
initRefs();
qInfo() << "Sip addresses model init Refs :" << stepsTimer.restart() << "ms.";
qInfo() << "Sip addresses model initialized in:" << timer.elapsed() << "ms.";
}

View file

@ -152,12 +152,14 @@ private:
// ---------------------------------------------------------------------------
SipAddressEntry *getSipAddressEntry (const QString &peerAddress) {
auto it = mPeerAddressToSipAddressEntry.find(peerAddress);
if (it == mPeerAddressToSipAddressEntry.end())
it = mPeerAddressToSipAddressEntry.insert(peerAddress, { peerAddress, nullptr, Presence::Offline, {} });
return &(*it);
}
SipAddressEntry *getSipAddressEntry (const QString &peerAddress) {
auto it = mPeerAddressToSipAddressEntry.find(peerAddress);
if (it == mPeerAddressToSipAddressEntry.end()){
it = mPeerAddressToSipAddressEntry.insert(peerAddress, { peerAddress, nullptr, Presence::Offline, {} });
mRefs << &(*it);
}
return &(*it);
}
QHash<QString, SipAddressEntry> mPeerAddressToSipAddressEntry;
QList<const SipAddressEntry *> mRefs;