Commit dcfecffe authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ContactDescription): do not display `display name` if exists

parent 7ae543dd
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('>'))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment