Update lime algo and add migration step.

Update SDK.
This commit is contained in:
Julien Wadel 2025-01-16 10:24:10 +01:00
parent 7c4d89cd86
commit 60182a8797
8 changed files with 37 additions and 7 deletions

View file

@ -24,6 +24,7 @@
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry>
<entry name="rtp_bundle" overwrite="true">1</entry>
<entry name="lime_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry>
<entry name="lime_algo" overwrite="true">c25519</entry>
</section>
<section name="default_nat_policy_values">
<entry name="stun_server" overwrite="true">stun.linphone.org</entry>

View file

@ -24,6 +24,7 @@
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry>
<entry name="rtp_bundle" overwrite="true">1</entry>
<entry name="lime_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry>
<entry name="lime_algo" overwrite="true">c25519</entry>
</section>
<section name="default_nat_policy_values">
<entry name="stun_server" overwrite="true">stun.linphone.org</entry>

View file

@ -21,6 +21,7 @@
<entry name="conference_factory_uri" overwrite="true"></entry>
<entry name="audio_video_conference_factory_uri" overwrite="true"></entry>
<entry name="lime_server_url" overwrite="true"></entry>
<entry name="lime_algo" overwrite="true"></entry>
</section>
<section name="default_nat_policy_values">
<entry name="stun_server" overwrite="true"></entry>

View file

@ -45,7 +45,7 @@ register_only_when_network_is_up=1
rls_uri=sips:rls@sip.linphone.org
update_presence_model_timestamp_before_publish_expires_refresh=1
use_cpim=1
zrtp_key_agreements_suites=MS_ZRTP_KEY_AGREEMENT_K255_KYB512
zrtp_key_agreements_suites=MS_ZRTP_KEY_AGREEMENT_K255_MLK512,MS_ZRTP_KEY_AGREEMENT_K255_KYB512
[sound]
#remove this property for any application that is not Linphone public version itself

View file

@ -95,6 +95,7 @@ void CoreModel::start() {
QString userAgent = ToolModel::computeUserAgent(config);
mCore->setUserAgent(Utils::appStringToCoreString(userAgent), LINPHONESDK_VERSION);
mCore->start();
migrate();
setPathAfterStart();
if (SettingsModel::clearLocalLdapFriendsUponStartup(config)) {
// Remove ldap friends cache list. If not, old stored friends will take priority on merge and will not be
@ -230,6 +231,35 @@ bool CoreModel::setFetchConfig(QString filePath) {
return fetched;
}
void CoreModel::migrate() {
std::shared_ptr<linphone::Config> config = mCore->getConfig();
int rcVersion = config->getInt(SettingsModel::UiSection, Constants::RcVersionName, 0);
if (rcVersion == Constants::RcVersionCurrent) return;
if (rcVersion > Constants::RcVersionCurrent) {
qWarning() << QStringLiteral("RC file version (%1) is more recent than app rc file version (%2)!!!")
.arg(rcVersion)
.arg(Constants::RcVersionCurrent);
return;
}
qInfo() << QStringLiteral("Migrate from old rc file (%1 to %2).").arg(rcVersion).arg(Constants::RcVersionCurrent);
for (const auto &account : mCore->getAccountList()) {
auto params = account->getParams();
if (params->getDomain() == Constants::LinphoneDomain) {
auto newParams = params->clone();
QString accountIdentity =
(newParams->getIdentityAddress() ? newParams->getIdentityAddress()->asString().c_str() : "no-identity");
if (rcVersion < 1) {
newParams->setLimeAlgo("c25519");
qInfo() << "Migrating" << accountIdentity << "for version 1. lime algo = c25519";
}
account->setParams(newParams);
}
}
config->setInt(SettingsModel::UiSection, Constants::RcVersionName, Constants::RcVersionCurrent);
}
//---------------------------------------------------------------------------------------------------------------------------
void CoreModel::onAccountAdded(const std::shared_ptr<linphone::Core> &core,

View file

@ -57,6 +57,7 @@ public:
QString getFetchConfig(QString filePath, bool *error);
void useFetchConfig(QString filePath);
bool setFetchConfig(QString filePath);
void migrate();
bool mEnd = false;

View file

@ -171,11 +171,7 @@ public:
static constexpr char VcardScheme[] = EXECUTABLE_NAME "-desktop:/";
static constexpr int CbsCallInterval = 20;
static constexpr char RcVersionName[] = "rc_version";
static constexpr int RcVersionCurrent = 6; // 2 = Conference URI
// 3 = CPIM on basic chat rooms
// 4 = RTP bundle mode
// 5 = Video Conference URI
// 6 = Publish expires
static constexpr int RcVersionCurrent = 1; // 1 = Lime algo
static constexpr char DownloadDefaultFileName[] = "download";
//--------------------------------------------------------------------------------

@ -1 +1 @@
Subproject commit 110aacf62d2bf4e1714e3c878057533f237d52a5
Subproject commit d65510fb076de2c8e04b9f352b43a089ff228cf3