Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
5cd97cb5
Commit
5cd97cb5
authored
Aug 16, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Settings): provide an option to disable the RLS URI
parent
3c455990
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
153 additions
and
33 deletions
+153
-33
en.ts
assets/languages/en.ts
+16
-0
fr.ts
assets/languages/fr.ts
+16
-0
Paths.cpp
src/app/paths/Paths.cpp
+1
-16
AssistantModel.cpp
src/components/assistant/AssistantModel.cpp
+10
-10
AccountSettingsModel.cpp
src/components/settings/AccountSettingsModel.cpp
+14
-7
SettingsModel.cpp
src/components/settings/SettingsModel.cpp
+61
-0
SettingsModel.hpp
src/components/settings/SettingsModel.hpp
+10
-0
SettingsNetwork.qml
ui/views/App/Settings/SettingsNetwork.qml
+25
-0
No files found.
assets/languages/en.ts
View file @
5cd97cb5
...
...
@@ -1240,6 +1240,22 @@ your friend's SIP address or username.</translation>
<
source
>
enableAdaptiveRateControlLabel
<
/source
>
<
translation
>
Enable
adaptive
rate
control
<
/translation
>
<
/message
>
<
message
>
<
source
>
presenceTitle
<
/source
>
<
translation
>
Presence
<
/translation
>
<
/message
>
<
message
>
<
source
>
rlsUriLabel
<
/source
>
<
translation
>
Use
RLS
URI
<
/translation
>
<
/message
>
<
message
>
<
source
>
rlsUriAuto
<
/source
>
<
translation
>
AUTO
<
/translation
>
<
/message
>
<
message
>
<
source
>
rlsUriDisabled
<
/source
>
<
translation
>
NEVER
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsSipAccounts
<
/name
>
...
...
assets/languages/fr.ts
View file @
5cd97cb5
...
...
@@ -1238,6 +1238,22 @@ Cliquez ici : <a href="%1">%1</a>
<
source
>
enableAdaptiveRateControlLabel
<
/source
>
<
translation
>
Activer
le
contr
ô
le
de
d
é
bit
adaptif
<
/translation
>
<
/message
>
<
message
>
<
source
>
presenceTitle
<
/source
>
<
translation
>
Pr
é
sence
<
/translation
>
<
/message
>
<
message
>
<
source
>
rlsUriLabel
<
/source
>
<
translation
>
Utiliser
l
&
apos
;
URI
RLS
<
/translation
>
<
/message
>
<
message
>
<
source
>
rlsUriAuto
<
/source
>
<
translation
>
AUTO
<
/translation
>
<
/message
>
<
message
>
<
source
>
rlsUriDisabled
<
/source
>
<
translation
>
JAMAIS
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsSipAccounts
<
/name
>
...
...
src/app/paths/Paths.cpp
View file @
5cd97cb5
...
...
@@ -48,10 +48,6 @@
#define PATH_MESSAGE_HISTORY_LIST "/message-history.db"
#define PATH_ZRTP_SECRETS "/zidcache"
#ifndef RLS_URI
#define RLS_URI "sips:rls@sip.linphone.org"
#endif // ifndef RLS_URI
using
namespace
std
;
// =============================================================================
...
...
@@ -271,14 +267,6 @@ static void migrateConfigurationFile (const QString &oldPath, const QString &new
}
}
inline
void
setRlsUri
(
const
QString
&
configPath
)
{
shared_ptr
<
linphone
::
Config
>
config
=
linphone
::
Config
::
newWithFactory
(
::
Utils
::
appStringToCoreString
(
configPath
),
""
);
if
(
config
->
getString
(
"sip"
,
"rls_uri"
,
""
).
empty
())
{
config
->
setString
(
"sip"
,
"rls_uri"
,
RLS_URI
);
config
->
sync
();
}
}
void
Paths
::
migrate
()
{
QString
newPath
=
::
getAppConfigFilePath
();
QString
oldBaseDir
=
QSysInfo
::
productType
()
==
"windows"
...
...
@@ -286,11 +274,8 @@ void Paths::migrate () {
:
QStandardPaths
::
writableLocation
(
QStandardPaths
::
HomeLocation
);
QString
oldPath
=
oldBaseDir
+
"/.linphonerc"
;
if
(
!::
filePathExists
(
newPath
)
&&
::
filePathExists
(
oldPath
))
{
if
(
!::
filePathExists
(
newPath
)
&&
::
filePathExists
(
oldPath
))
::
migrateConfigurationFile
(
oldPath
,
newPath
);
/* Define RLS uri so that presence switches from peer-to-peer mode to list mode. */
::
setRlsUri
(
newPath
);
}
newPath
=
::
getAppCallHistoryFilePath
();
oldPath
=
oldBaseDir
+
"/.linphone-call-history.db"
;
...
...
src/components/assistant/AssistantModel.cpp
View file @
5cd97cb5
...
...
@@ -40,6 +40,12 @@ public:
}
private:
void
createProxyConfig
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
)
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_CHECK_PTR
(
proxyConfig
);
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
configureRlsUri
(
proxyConfig
);
}
void
onCreateAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
linphone
::
AccountCreatorStatus
status
,
...
...
@@ -63,9 +69,7 @@ private:
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountExist
||
status
==
linphone
::
AccountCreatorStatusAccountExistWithAlias
)
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_CHECK_PTR
(
proxyConfig
);
createProxyConfig
(
creator
);
emit
mAssistant
->
loginStatusChanged
(
QString
(
""
));
}
else
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestFailed
)
...
...
@@ -84,10 +88,8 @@ private:
status
==
linphone
::
AccountCreatorStatusAccountActivated
||
status
==
linphone
::
AccountCreatorStatusAccountAlreadyActivated
)
{
if
(
creator
->
getEmail
().
empty
())
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_CHECK_PTR
(
proxyConfig
);
}
if
(
creator
->
getEmail
().
empty
())
createProxyConfig
(
creator
);
emit
mAssistant
->
activateStatusChanged
(
QString
(
""
));
}
else
{
...
...
@@ -104,9 +106,7 @@ private:
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountActivated
)
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_CHECK_PTR
(
proxyConfig
);
createProxyConfig
(
creator
);
emit
mAssistant
->
activateStatusChanged
(
QString
(
""
));
}
else
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestFailed
)
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
5cd97cb5
...
...
@@ -61,7 +61,8 @@ AccountSettingsModel::AccountSettingsModel (QObject *parent) : QObject(parent) {
bool
AccountSettingsModel
::
addOrUpdateProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
)
{
Q_CHECK_PTR
(
proxyConfig
);
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
CoreManager
*
coreManager
=
CoreManager
::
getInstance
();
shared_ptr
<
linphone
::
Core
>
core
=
coreManager
->
getCore
();
list
<
shared_ptr
<
linphone
::
ProxyConfig
>
>
proxyConfigs
=
core
->
getProxyConfigList
();
if
(
find
(
proxyConfigs
.
cbegin
(),
proxyConfigs
.
cend
(),
proxyConfig
)
!=
proxyConfigs
.
cend
())
{
...
...
@@ -70,12 +71,15 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (const shared_ptr<linphone::Pr
.
arg
(
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getIdentityAddress
()
->
asString
()));
return
false
;
}
}
else
if
(
core
->
addProxyConfig
(
proxyConfig
)
==
-
1
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to add proxy config: `%1`."
)
.
arg
(
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getIdentityAddress
()
->
asString
()));
return
false
;
coreManager
->
getSettingsModel
()
->
configureRlsUri
();
}
else
{
if
(
core
->
addProxyConfig
(
proxyConfig
)
==
-
1
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to add proxy config: `%1`."
)
.
arg
(
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getIdentityAddress
()
->
asString
()));
return
false
;
}
coreManager
->
getSettingsModel
()
->
configureRlsUri
(
proxyConfig
);
}
emit
accountSettingsUpdated
();
return
true
;
...
...
@@ -115,7 +119,10 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::Pro
void
AccountSettingsModel
::
removeProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
)
{
Q_CHECK_PTR
(
proxyConfig
);
CoreManager
::
getInstance
()
->
getCore
()
->
removeProxyConfig
(
proxyConfig
);
CoreManager
*
coreManager
=
CoreManager
::
getInstance
();
coreManager
->
getCore
()
->
removeProxyConfig
(
proxyConfig
);
coreManager
->
getSettingsModel
()
->
configureRlsUri
();
emit
accountSettingsUpdated
();
}
...
...
src/components/settings/SettingsModel.cpp
View file @
5cd97cb5
...
...
@@ -29,6 +29,10 @@
#include "SettingsModel.hpp"
#ifndef DEFAULT_RLS_URI
#define DEFAULT_RLS_URI "sips:rls@sip.linphone.org"
#endif // ifndef RLS_URI
using
namespace
std
;
// =============================================================================
...
...
@@ -37,6 +41,7 @@ const string SettingsModel::UI_SECTION("ui");
SettingsModel
::
SettingsModel
(
QObject
*
parent
)
:
QObject
(
parent
)
{
mConfig
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
configureRlsUri
();
}
// =============================================================================
...
...
@@ -647,6 +652,62 @@ void SettingsModel::setDscpVideo (int dscp) {
emit
dscpVideoChanged
(
dscp
);
}
// -----------------------------------------------------------------------------
bool
SettingsModel
::
getRlsUriEnabled
()
const
{
return
!!
mConfig
->
getInt
(
UI_SECTION
,
"rls_uri_enabled"
,
true
);
}
void
SettingsModel
::
setRlsUriEnabled
(
bool
status
)
{
mConfig
->
setInt
(
UI_SECTION
,
"rls_uri_enabled"
,
status
);
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
status
?
DEFAULT_RLS_URI
:
""
);
emit
rlsUriEnabledChanged
(
status
);
}
static
string
getRlsUriDomain
()
{
static
string
domain
;
if
(
!
domain
.
empty
())
return
domain
;
shared_ptr
<
linphone
::
Address
>
linphoneAddress
=
CoreManager
::
getInstance
()
->
getCore
()
->
createAddress
(
DEFAULT_RLS_URI
);
Q_CHECK_PTR
(
linphoneAddress
);
domain
=
linphoneAddress
->
getDomain
();
return
domain
;
}
void
SettingsModel
::
configureRlsUri
()
{
// Ensure rls uri is empty.
if
(
!
getRlsUriEnabled
())
{
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
""
);
return
;
}
// Set rls uri if necessary.
const
string
domain
=
getRlsUriDomain
();
for
(
const
auto
&
proxyConfig
:
CoreManager
::
getInstance
()
->
getCore
()
->
getProxyConfigList
())
if
(
proxyConfig
->
getDomain
()
==
domain
)
{
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
DEFAULT_RLS_URI
);
return
;
}
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
""
);
}
void
SettingsModel
::
configureRlsUri
(
const
shared_ptr
<
const
linphone
::
ProxyConfig
>
&
proxyConfig
)
{
if
(
!
getRlsUriEnabled
())
{
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
""
);
return
;
}
const
string
domain
=
getRlsUriDomain
();
if
(
proxyConfig
->
getDomain
()
==
domain
)
{
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
DEFAULT_RLS_URI
);
return
;
}
mConfig
->
setString
(
"sip"
,
"rls_uri"
,
""
);
}
// =============================================================================
// UI.
// =============================================================================
...
...
src/components/settings/SettingsModel.hpp
View file @
5cd97cb5
...
...
@@ -111,6 +111,8 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
int
dscpAudio
READ
getDscpAudio
WRITE
setDscpAudio
NOTIFY
dscpAudioChanged
);
Q_PROPERTY
(
int
dscpVideo
READ
getDscpVideo
WRITE
setDscpVideo
NOTIFY
dscpVideoChanged
);
Q_PROPERTY
(
bool
rlsUriEnabled
READ
getRlsUriEnabled
WRITE
setRlsUriEnabled
NOTIFY
rlsUriEnabledChanged
);
// UI. -----------------------------------------------------------------------
Q_PROPERTY
(
QString
remoteProvisioning
READ
getRemoteProvisioning
WRITE
setRemoteProvisioning
NOTIFY
remoteProvisioningChanged
);
...
...
@@ -272,6 +274,12 @@ public:
int
getDscpVideo
()
const
;
void
setDscpVideo
(
int
dscp
);
bool
getRlsUriEnabled
()
const
;
void
setRlsUriEnabled
(
bool
status
);
void
configureRlsUri
();
void
configureRlsUri
(
const
std
::
shared_ptr
<
const
linphone
::
ProxyConfig
>
&
proxyConfig
);
// UI. -----------------------------------------------------------------------
QString
getSavedScreenshotsFolder
()
const
;
...
...
@@ -375,6 +383,8 @@ signals:
void
dscpAudioChanged
(
int
dscp
);
void
dscpVideoChanged
(
int
dscp
);
void
rlsUriEnabledChanged
(
bool
status
);
// UI. -----------------------------------------------------------------------
void
savedScreenshotsFolderChanged
(
const
QString
&
folder
);
...
...
ui/views/App/Settings/SettingsNetwork.qml
View file @
5cd97cb5
...
...
@@ -96,6 +96,31 @@ TabContainer {
}
}
// -------------------------------------------------------------------------
// Presence.
// -------------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
presenceTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
rlsUriLabel
'
)
ExclusiveButtons
{
selectedButton
:
Number
(
!
SettingsModel
.
rlsUriEnabled
)
texts
:
[
qsTr
(
'
rlsUriAuto
'
),
qsTr
(
'
rlsUriDisabled
'
)
]
onClicked
:
SettingsModel
.
rlsUriEnabled
=
!
button
}
}
}
}
// -------------------------------------------------------------------------
// Network protocol and ports.
// -------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment