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
8bf34d85
Commit
8bf34d85
authored
Aug 09, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Call): display correctly `forced display name` and only sip uri in description
parent
d7be2afb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
CallModel.cpp
src/components/call/CallModel.cpp
+1
-1
SipAddressesModel.cpp
src/components/sip-addresses/SipAddressesModel.cpp
+11
-3
SipAddressesModel.hpp
src/components/sip-addresses/SipAddressesModel.hpp
+2
-0
ContactDescription.qml
ui/modules/Linphone/Contact/ContactDescription.qml
+2
-2
linphone-utils.js
ui/scripts/LinphoneUtils/linphone-utils.js
+0
-7
No files found.
src/components/call/CallModel.cpp
View file @
8bf34d85
...
...
@@ -71,7 +71,7 @@ CallModel::~CallModel () {
// -----------------------------------------------------------------------------
QString
CallModel
::
getSipAddress
()
const
{
return
::
Utils
::
coreStringToAppString
(
mCall
->
getRemoteAddress
()
->
asString
UriOnly
());
return
::
Utils
::
coreStringToAppString
(
mCall
->
getRemoteAddress
()
->
asString
());
}
// -----------------------------------------------------------------------------
...
...
src/components/sip-addresses/SipAddressesModel.cpp
View file @
8bf34d85
...
...
@@ -99,9 +99,10 @@ ContactModel *SipAddressesModel::mapSipAddressToContact (const QString &sipAddre
SipAddressObserver
*
SipAddressesModel
::
getSipAddressObserver
(
const
QString
&
sipAddress
)
{
SipAddressObserver
*
model
=
new
SipAddressObserver
(
sipAddress
);
const
QString
cleanedSipAddress
=
cleanSipAddress
(
sipAddress
);
{
auto
it
=
mSipAddresses
.
find
(
s
ipAddress
);
auto
it
=
mSipAddresses
.
find
(
cleanedS
ipAddress
);
if
(
it
!=
mSipAddresses
.
end
())
{
model
->
setContact
(
it
->
value
(
"contact"
).
value
<
ContactModel
*>
());
model
->
setPresenceStatus
(
...
...
@@ -113,10 +114,10 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &sip
}
}
mObservers
.
insert
(
s
ipAddress
,
model
);
mObservers
.
insert
(
cleanedS
ipAddress
,
model
);
QObject
::
connect
(
model
,
&
SipAddressObserver
::
destroyed
,
this
,
[
this
,
model
]()
{
const
QString
sipAddress
=
model
->
getSipAddress
(
);
const
QString
sipAddress
=
cleanSipAddress
(
model
->
getSipAddress
()
);
if
(
mObservers
.
remove
(
sipAddress
,
model
)
==
0
)
qWarning
()
<<
QStringLiteral
(
"Unable to remove sip address `%1` from observers."
).
arg
(
sipAddress
);
});
...
...
@@ -190,6 +191,13 @@ bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) {
return
address
&&
!
address
->
getUsername
().
empty
();
}
QString
SipAddressesModel
::
cleanSipAddress
(
const
QString
&
sipAddress
)
{
const
int
index
=
sipAddress
.
lastIndexOf
(
'<'
);
if
(
index
==
-
1
)
return
sipAddress
;
return
sipAddress
.
mid
(
index
+
1
,
sipAddress
.
lastIndexOf
(
'>'
)
-
index
-
1
);
}
// -----------------------------------------------------------------------------
bool
SipAddressesModel
::
removeRow
(
int
row
,
const
QModelIndex
&
parent
)
{
...
...
src/components/sip-addresses/SipAddressesModel.hpp
View file @
8bf34d85
...
...
@@ -62,6 +62,8 @@ public:
Q_INVOKABLE
static
bool
addressIsValid
(
const
QString
&
address
);
Q_INVOKABLE
static
bool
sipAddressIsValid
(
const
QString
&
sipAddress
);
Q_INVOKABLE
static
QString
cleanSipAddress
(
const
QString
&
sipAddress
);
// ---------------------------------------------------------------------------
private:
...
...
ui/modules/Linphone/Contact/ContactDescription.qml
View file @
8bf34d85
import
QtQuick
2.7
import
Linphone
1.0
import
Linphone
.
Styles
1.0
import
LinphoneUtils
1.0
// =============================================================================
...
...
@@ -29,7 +29,7 @@ Column {
}
Text
{
text
:
LinphoneUtils
.
cleanSipAddress
(
sipAddress
)
text
:
SipAddressesModel
.
cleanSipAddress
(
sipAddress
)
color
:
sipAddressColor
elide
:
Text
.
ElideRight
...
...
ui/scripts/LinphoneUtils/linphone-utils.js
View file @
8bf34d85
...
...
@@ -84,10 +84,3 @@ function getContactUsername (contact) {
name
=
_getUsername
(
object
)
return
name
==
null
?
'
Bad EGG
'
:
name
}
function
cleanSipAddress
(
sipAddress
)
{
var
index
=
sipAddress
.
indexOf
(
'
<
'
)
return
index
===
-
1
?
sipAddress
:
sipAddress
.
substring
(
index
+
1
,
sipAddress
.
lastIndexOf
(
'
>
'
))
}
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