Add lime server url checks and migration if Linphone account exists

This commit is contained in:
Julien Wadel 2021-08-27 15:08:07 +02:00
parent 39e41a60ab
commit 1f5db64e46
6 changed files with 19 additions and 6 deletions

View file

@ -37,4 +37,7 @@
<entry name="username_regex" overwrite="true">^[a-z0-9+_.\-]*$</entry>
<entry name="xmlrpc_url" overwrite="true">https://subscribe.linphone.org:444/wizard.php</entry>
</section>
<section name="lime">
<entry name="lime_server_url">https://lime.linphone.org/lime-server/lime-server.php</entry>
</section>
</config>

View file

@ -37,4 +37,7 @@
<entry name="username_regex" overwrite="true">^[a-z0-9+_.\-]*$</entry>
<entry name="xmlrpc_url" overwrite="true">https://subscribe.linphone.org:444/wizard.php</entry>
</section>
<section name="lime">
<entry name="lime_server_url">https://lime.linphone.org/lime-server/lime-server.php</entry>
</section>
</config>

View file

@ -235,10 +235,8 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
Paths::getFactoryConfigFilePath(),
nullptr
);
// You only need to give your LIME server URL
mCore->setLimeX3DhServerUrl("https://lime.linphone.org/lime-server/lime-server.php");
// and enable LIME on your core to use encryption.
mCore->enableLimeX3Dh(true);
// Enable LIME on your core to use encryption.
mCore->enableLimeX3Dh(mCore->getLimeX3DhServerUrl() != "");
// Now see the CoreService.CreateGroupChatRoom to see how to create a secure chat room
mCore->addListener(mHandlers);
@ -295,6 +293,7 @@ void CoreManager::migrate () {
proxyConfig->done();
}
}*/
bool setlimeServerUrl = false;
for(const auto &account : mCore->getAccountList()){
auto params = account->getParams();
if( params->getDomain() == Constants::LinphoneDomain) {
@ -305,10 +304,16 @@ void CoreManager::migrate () {
}
if( rcVersion < 2) {
newParams->setConferenceFactoryUri(Constants::DefaultConferenceURI);
setlimeServerUrl = true;
}
account->setParams(newParams);
}
}
if(setlimeServerUrl) {
mCore->setLimeX3DhServerUrl(Constants::DefaultLimeServerURL);
mCore->enableLimeX3Dh(true);
}
config->setInt(SettingsModel::UiSection, Constants::RcVersionName, Constants::RcVersionCurrent);
}

View file

@ -61,6 +61,7 @@ constexpr qint64 Constants::FileSizeLimit;
constexpr char Constants::DefaultXmlrpcUri[];
constexpr char Constants::DefaultConferenceURI[];
constexpr char Constants::DefaultLimeServerURL[];
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)

View file

@ -62,6 +62,7 @@ public:
static constexpr char DefaultRlsUri[] = "sips:rls@sip.linphone.org";
static constexpr char DefaultLogsEmail[] = "linphone-desktop@belledonne-communications.com";
static constexpr char DefaultConferenceURI[] = "sip:conference-factory@sip.linphone.org";
static constexpr char DefaultLimeServerURL[] = "https://lime.linphone.org/lime-server/lime-server.php";
// Max image size in bytes. (100Kb)

View file

@ -10,8 +10,8 @@ import App.Styles 1.0
TabContainer {
Column {
anchors.fill: parent
spacing: SettingsWindowStyle.forms.spacing
width: parent.width
Form {
title: qsTr('callsTitle')
@ -296,7 +296,7 @@ TabContainer {
}
FormLine {
visible: false // TODO: Use `SettingsModel.limeIsSupported` binding in V2.
visible: false // Use SettingsModel.limeIsSupported when we want to control lime
FormGroup {
label: qsTr('encryptWithLimeLabel')