mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-27 16:59:21 +00:00
feat(ContactDescription): do not display display name if exists
This commit is contained in:
parent
7ae543dd93
commit
dcfecffe66
2 changed files with 11 additions and 2 deletions
|
|
@ -1,12 +1,14 @@
|
|||
import QtQuick 2.7
|
||||
|
||||
import Linphone.Styles 1.0
|
||||
import LinphoneUtils 1.0
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Column {
|
||||
property alias sipAddress: sipAddress.text
|
||||
property alias username: username.text
|
||||
property string sipAddress
|
||||
|
||||
property color sipAddressColor: ContactDescriptionStyle.sipAddress.color
|
||||
property color usernameColor: ContactDescriptionStyle.username.color
|
||||
property int horizontalTextAlignment
|
||||
|
|
@ -27,7 +29,7 @@ Column {
|
|||
}
|
||||
|
||||
Text {
|
||||
id: sipAddress
|
||||
text: LinphoneUtils.cleanSipAddress(sipAddress)
|
||||
|
||||
color: sipAddressColor
|
||||
elide: Text.ElideRight
|
||||
|
|
|
|||
|
|
@ -84,3 +84,10 @@ 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('>'))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue