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
0c0b8c4f
Commit
0c0b8c4f
authored
Jun 26, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(LinphoneUtils): `getContactUsername` is now magic, it supports sipAddressObserver
parent
b74f36a7
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
16 deletions
+20
-16
Chat.js
ui/modules/Linphone/Chat/Chat.js
+1
-1
FileMessage.qml
ui/modules/Linphone/Chat/FileMessage.qml
+1
-1
IncomingMessage.qml
ui/modules/Linphone/Chat/IncomingMessage.qml
+1
-1
linphone-utils.js
ui/scripts/LinphoneUtils/linphone-utils.js
+11
-4
AbstractStartingCall.qml
ui/views/App/Calls/AbstractStartingCall.qml
+1
-1
Conference.qml
ui/views/App/Calls/Conference.qml
+1
-1
EndedCall.qml
ui/views/App/Calls/EndedCall.qml
+1
-1
Incall.qml
ui/views/App/Calls/Incall.qml
+1
-1
IncallAvatar.qml
ui/views/App/Calls/IncallAvatar.qml
+1
-1
Conversation.js
ui/views/App/Main/Conversation.js
+1
-4
No files found.
ui/modules/Linphone/Chat/Chat.js
View file @
0c0b8c4f
...
...
@@ -41,7 +41,7 @@ function getIsComposingMessage () {
var
sipAddressObserver
=
chat
.
sipAddressObserver
return
qsTr
(
'
isComposing
'
).
replace
(
'
%1
'
,
LinphoneUtils
.
getContactUsername
(
sipAddressObserver
.
contact
||
sipAddressObserver
.
sipAddress
)
LinphoneUtils
.
getContactUsername
(
sipAddressObserver
)
)
}
...
...
ui/modules/Linphone/Chat/FileMessage.qml
View file @
0c0b8c4f
...
...
@@ -27,7 +27,7 @@ Row {
width
:
ChatStyle
.
entry
.
message
.
incoming
.
avatarSize
image
:
chat
.
sipAddressObserver
.
contact
?
chat
.
sipAddressObserver
.
contact
.
avatar
:
''
username
:
LinphoneUtils
.
getContactUsername
(
chat
.
sipAddressObserver
.
contact
||
proxyModel
.
sipAddress
)
username
:
LinphoneUtils
.
getContactUsername
(
chat
.
sipAddressObserver
)
}
}
...
...
ui/modules/Linphone/Chat/IncomingMessage.qml
View file @
0c0b8c4f
...
...
@@ -21,7 +21,7 @@ RowLayout {
anchors.centerIn
:
parent
height
:
ChatStyle
.
entry
.
message
.
incoming
.
avatarSize
image
:
chat
.
sipAddressObserver
.
contact
?
chat
.
sipAddressObserver
.
contact
.
vcard
.
avatar
:
''
username
:
LinphoneUtils
.
getContactUsername
(
chat
.
sipAddressObserver
.
contact
||
proxyModel
.
sipAddress
)
username
:
LinphoneUtils
.
getContactUsername
(
chat
.
sipAddressObserver
)
width
:
ChatStyle
.
entry
.
message
.
incoming
.
avatarSize
// The avatar is only visible for the first message of a incoming messages sequence.
...
...
ui/scripts/LinphoneUtils/linphone-utils.js
View file @
0c0b8c4f
...
...
@@ -8,9 +8,16 @@
// =============================================================================
// Returns the username of a contact object or URI string.
// Returns the username of a contact
/sipAddressObserver
object or URI string.
function
getContactUsername
(
contact
)
{
return
Utils
.
isString
(
contact
)
?
contact
.
substring
(
4
,
contact
.
indexOf
(
'
@
'
))
// 4 = length('sip:')
:
contact
.
vcard
.
username
var
object
=
contact
.
contact
||
// Contact object from `SipAddressObserver`.
(
contact
.
vcard
&&
contact
)
||
// Contact object.
(
contact
.
sipAddress
)
||
// String from `SipAddressObserver`.
contact
// String.
if
(
Utils
.
isString
(
object
))
{
return
object
.
substring
(
4
,
object
.
indexOf
(
'
@
'
))
// 4 = length('sip:')
}
return
object
.
vcard
.
username
}
ui/views/App/Calls/AbstractStartingCall.qml
View file @
0c0b8c4f
...
...
@@ -41,7 +41,7 @@ Rectangle {
height
:
CallStyle
.
header
.
contactDescription
.
height
horizontalTextAlignment
:
Text
.
AlignHCenter
sipAddress
:
call
.
sipAddress
username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
.
contact
||
call
.
sipAddress
)
username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
)
width
:
parent
.
width
}
...
...
ui/views/App/Calls/Conference.qml
View file @
0c0b8c4f
...
...
@@ -132,7 +132,7 @@ Rectangle {
horizontalTextAlignment
:
Text
.
AlignHCenter
sipAddress
:
parent
.
sipAddressObserver
.
sipAddress
username
:
LinphoneUtils
.
getContactUsername
(
parent
.
sipAddressObserver
.
contact
||
parent
.
sipAddress
)
username
:
LinphoneUtils
.
getContactUsername
(
parent
.
sipAddressObserver
)
}
IncallAvatar
{
...
...
ui/views/App/Calls/EndedCall.qml
View file @
0c0b8c4f
...
...
@@ -38,7 +38,7 @@ Rectangle {
horizontalTextAlignment
:
Text
.
AlignHCenter
sipAddress
:
_sipAddressObserver
.
sipAddress
username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
.
contact
||
sipAddress
)
username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
)
}
Text
{
...
...
ui/views/App/Calls/Incall.qml
View file @
0c0b8c4f
...
...
@@ -144,7 +144,7 @@ Rectangle {
anchors.centerIn
:
parent
horizontalTextAlignment
:
Text
.
AlignHCenter
sipAddress
:
''
username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
.
contact
||
_sipAddressObserver
.
sipAddress
)
username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
)
height
:
parent
.
height
width
:
parent
.
width
-
rightActions
.
width
-
leftActions
.
width
-
CallStyle
.
header
.
contactDescription
.
width
...
...
ui/views/App/Calls/IncallAvatar.qml
View file @
0c0b8c4f
...
...
@@ -11,7 +11,7 @@ Avatar {
property
var
call
readonly
property
var
_sipAddressObserver
:
SipAddressesModel
.
getSipAddressObserver
(
call
.
sipAddress
)
readonly
property
var
_username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
.
contact
||
call
.
sipAddress
)
readonly
property
var
_username
:
LinphoneUtils
.
getContactUsername
(
_sipAddressObserver
)
backgroundColor
:
CallStyle
.
container
.
avatar
.
backgroundColor
foregroundColor
:
call
.
status
===
CallModel
.
CallStatusPaused
...
...
ui/views/App/Main/Conversation.js
View file @
0c0b8c4f
...
...
@@ -29,10 +29,7 @@ function getEditIcon () {
}
function
getUsername
()
{
return
LinphoneUtils
.
getContactUsername
(
conversation
.
_sipAddressObserver
.
contact
||
conversation
.
sipAddress
)
return
LinphoneUtils
.
getContactUsername
(
conversation
.
_sipAddressObserver
)
}
function
updateChatFilter
(
button
)
{
...
...
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