Set rls_uri when migrating config file from GTK version to Qt version so that presence switches from peer-to-peer mode to list mode.

This commit is contained in:
Ghislain MARY 2017-06-05 17:03:19 +02:00
parent a6dfdd1cd1
commit 543542bcfe

View file

@ -30,6 +30,7 @@
#include "config.h"
#include "Paths.hpp"
#include <linphone++/linphone.hh>
#define PATH_ASSISTANT_CONFIG "/assistant/"
#define PATH_AVATARS "/avatars/"
@ -254,6 +255,14 @@ static void migrateConfigurationFile (const QString &oldPath, const QString &new
}
}
static void setRlsUri (const QString &configPath) {
shared_ptr<linphone::Config> config = linphone::Config::newWithFactory(Utils::appStringToCoreString(configPath), "");
if (config->getString("sip", "rls_uri", "").empty()) {
config->setString("sip", "rls_uri", "sips:rls@sip.linphone.org");
config->sync();
}
}
void Paths::migrate () {
QString newPath = getAppConfigFilePath();
QString oldBaseDir = QSysInfo::productType() == "windows"
@ -261,8 +270,11 @@ void Paths::migrate () {
: QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
QString oldPath = oldBaseDir + "/.linphonerc";
if (!filePathExists(newPath) && filePathExists(oldPath))
if (!filePathExists(newPath) && filePathExists(oldPath)) {
migrateConfigurationFile(oldPath, newPath);
/* Define RLS uri so that presence switches from peer-to-peer mode to list mode */
setRlsUri(newPath);
}
newPath = getAppCallHistoryFilePath();
oldPath = oldBaseDir + "/.linphone-call-history.db";