Ensure sip.linphone.org accounts have a LIME X3DH server URL set in their params

This commit is contained in:
Sylvain Berfini 2023-01-02 09:33:35 +01:00
parent 3fc596c448
commit 6db5b54a86
2 changed files with 17 additions and 4 deletions

View file

@ -453,10 +453,16 @@ class CoreContext(
Log.i("[Context] CPIM allowed in basic chat rooms for account ${params.identityAddress?.asString()}")
}
if (account.params.limeServerUrl == null && limeServerUrl.isNotEmpty()) {
params.limeServerUrl = limeServerUrl
paramsChanged = true
Log.i("[Context] Moving Core's LIME X3DH server URL [$limeServerUrl] on account ${params.identityAddress?.asString()}")
if (account.params.limeServerUrl.isNullOrEmpty()) {
if (limeServerUrl.isNotEmpty()) {
params.limeServerUrl = limeServerUrl
paramsChanged = true
Log.i("[Context] Moving Core's LIME X3DH server URL [$limeServerUrl] on account ${params.identityAddress?.asString()}")
} else {
params.limeServerUrl = corePreferences.limeServerUrl
paramsChanged = true
Log.w("[Context] Linphone account [${params.identityAddress?.asString()}] didn't have a LIME X3DH server URL, setting one: ${corePreferences.limeServerUrl}")
}
}
if (paramsChanged) {

View file

@ -522,6 +522,13 @@ class CorePreferences constructor(private val context: Context) {
"sip:videoconference-factory@sip.linphone.org"
)!!
val limeServerUrl: String
get() = config.getString(
"app",
"default_lime_server_url",
"https://lime.linphone.org/lime-server/lime-server.php"
)!!
val checkUpdateAvailableInterval: Int
get() = config.getInt("app", "version_check_interval", 86400000)