Commit 543542bc authored by Ghislain MARY's avatar Ghislain MARY

Set rls_uri when migrating config file from GTK version to Qt version so that...

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.
parent a6dfdd1c
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "config.h" #include "config.h"
#include "Paths.hpp" #include "Paths.hpp"
#include <linphone++/linphone.hh>
#define PATH_ASSISTANT_CONFIG "/assistant/" #define PATH_ASSISTANT_CONFIG "/assistant/"
#define PATH_AVATARS "/avatars/" #define PATH_AVATARS "/avatars/"
...@@ -254,6 +255,14 @@ static void migrateConfigurationFile (const QString &oldPath, const QString &new ...@@ -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 () { void Paths::migrate () {
QString newPath = getAppConfigFilePath(); QString newPath = getAppConfigFilePath();
QString oldBaseDir = QSysInfo::productType() == "windows" QString oldBaseDir = QSysInfo::productType() == "windows"
...@@ -261,8 +270,11 @@ void Paths::migrate () { ...@@ -261,8 +270,11 @@ void Paths::migrate () {
: QStandardPaths::writableLocation(QStandardPaths::HomeLocation); : QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
QString oldPath = oldBaseDir + "/.linphonerc"; QString oldPath = oldBaseDir + "/.linphonerc";
if (!filePathExists(newPath) && filePathExists(oldPath)) if (!filePathExists(newPath) && filePathExists(oldPath)) {
migrateConfigurationFile(oldPath, newPath); migrateConfigurationFile(oldPath, newPath);
/* Define RLS uri so that presence switches from peer-to-peer mode to list mode */
setRlsUri(newPath);
}
newPath = getAppCallHistoryFilePath(); newPath = getAppCallHistoryFilePath();
oldPath = oldBaseDir + "/.linphone-call-history.db"; oldPath = oldBaseDir + "/.linphone-call-history.db";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment