mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-25 15:58:16 +00:00
When adding a Linphone account, set core encryption to SRTP if None.
Fix encryption synchronization on QML.
This commit is contained in:
parent
8fcae64313
commit
fd6fd27909
5 changed files with 15 additions and 4 deletions
|
|
@ -48,6 +48,7 @@ private:
|
|||
shared_ptr<linphone::ProxyConfig> proxyConfig = creator->createProxyConfig();
|
||||
auto account = CoreManager::getInstance()->getCore()->getAccountByIdkey(proxyConfig->getIdkey());
|
||||
if(account){
|
||||
CoreManager::getInstance()->addingAccount(account->getParams());
|
||||
CoreManager::getInstance()->getSettingsModel()->configureRlsUri(account);
|
||||
CoreManager::getInstance()->getAccountSettingsModel()->setDefaultAccount(account);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,6 +291,14 @@ void CoreManager::updateUserAgent(){
|
|||
mCore->setUserAgent(Utils::appStringToCoreString(Utils::computeUserAgent(mCore->getConfig())), mCore->getVersion());
|
||||
forceRefreshRegisters(); // After setting a new device name, REGISTER need to take account it.
|
||||
}
|
||||
void CoreManager::addingAccount(const std::shared_ptr<const linphone::AccountParams> params) {
|
||||
if( params->getDomain() == Constants::LinphoneDomain) {// Special case for Linphone
|
||||
// It has been decided that if the core encryption is None, new Linphone accounts will reset it to SRTP.
|
||||
if( CoreManager::getInstance()->getSettingsModel()->getMediaEncryption() == SettingsModel::MediaEncryptionNone){
|
||||
CoreManager::getInstance()->getSettingsModel()->setMediaEncryption(SettingsModel::MediaEncryptionSrtp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CoreManager::handleChatRoomCreated(const QSharedPointer<ChatRoomModel> &chatRoomModel){
|
||||
emit chatRoomModelCreated(chatRoomModel);
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ public:
|
|||
Q_INVOKABLE bool isLastRemoteProvisioningGood();
|
||||
Q_INVOKABLE QString getUserAgent()const;
|
||||
void updateUserAgent();
|
||||
void addingAccount(const std::shared_ptr<const linphone::AccountParams> params);
|
||||
|
||||
public slots:
|
||||
void initCoreManager();
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ bool AccountSettingsModel::addOrUpdateAccount (std::shared_ptr<linphone::Account
|
|||
.arg(QString::fromStdString(account->getParams()->getIdentityAddress()->asString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
coreManager->addingAccount(account->getParams());
|
||||
coreManager->getSettingsModel()->configureRlsUri(account);
|
||||
}else
|
||||
coreManager->getSettingsModel()->configureRlsUri();
|
||||
|
|
|
|||
|
|
@ -37,12 +37,11 @@ TabContainer {
|
|||
|
||||
return encryptions
|
||||
})()
|
||||
|
||||
Component.onCompleted: {
|
||||
var toFound = SettingsModel.mediaEncryption
|
||||
property var currentEncryption: SettingsModel.mediaEncryption
|
||||
onCurrentEncryptionChanged: {
|
||||
currentIndex = Number(
|
||||
Utils.findIndex(encryption.model, function (value) {
|
||||
return toFound === value.value
|
||||
return currentEncryption === value.value
|
||||
})
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue