When manager starts, ensure lime server url is set if account is sip.linphone.org (required for updates since older version)

This commit is contained in:
Sylvain Berfini 2019-03-19 17:32:18 +01:00
parent dcac3200f6
commit 94d13a877f
2 changed files with 18 additions and 2 deletions

View file

@ -751,16 +751,31 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
mCore.migrateLogsFromRcToDb();
// Migrate existing linphone accounts to have conference factory uri set
// Migrate existing linphone accounts to have conference factory uri and LIME X3Dh url set
String uri = getString(R.string.default_conference_factory_uri);
for (ProxyConfig lpc : mCore.getProxyConfigList()) {
if (lpc.getConferenceFactoryUri() == null
&& lpc.getIdentityAddress()
.getDomain()
.equals(getString(R.string.default_domain))) {
lpc.edit();
lpc.setConferenceFactoryUri(getString(R.string.default_conference_factory_uri));
Log.i(
"[Manager] Setting conference factory on proxy config "
+ lpc.getIdentityAddress().asString()
+ " to default value: "
+ uri);
lpc.setConferenceFactoryUri(uri);
lpc.done();
}
if (mCore.limeX3DhAvailable()) {
String url = mCore.getLimeX3DhServerUrl();
if (url == null || url.length() == 0) {
url = getString(R.string.default_lime_x3dh_server_url);
Log.i("[Manager] Setting LIME X3Dh server url to default value: " + url);
mCore.setLimeX3DhServerUrl(url);
}
}
}
if (mServiceContext.getResources().getBoolean(R.bool.enable_push_id)) {

View file

@ -4,6 +4,7 @@
<!-- Global -->
<string name="default_domain">sip.linphone.org</string><!-- Set the default domain used for account creation/addresses -->
<string name="default_conference_factory_uri">sip:conference-factory@sip.linphone.org</string>
<string name="default_lime_x3dh_server_url">http://sip-staging.linphone.org:8083/flexisip-account-manager/x3dh-25519.php</string>
<string name="rls_uri">sip:rls@sip.linphone.org</string>
<string name="user_agent">LinphoneAndroid</string>
<bool name="orientation_portrait_only">false</bool>