mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 14:48:15 +00:00
- use vcard of Contact in qml - remove `sipAddress` attribute of Contact - refactoring...
14 lines
475 B
JavaScript
14 lines
475 B
JavaScript
// ===================================================================
|
|
// Contains linphone helpers.
|
|
// ===================================================================
|
|
|
|
.pragma library
|
|
|
|
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
|
|
|
|
// Returns the username of a contact object or URI string.
|
|
function getContactUsername (contact) {
|
|
return Utils.isString(contact)
|
|
? contact.substring(4, contact.indexOf('@')) // 4 = length("sip:")
|
|
: contact.vcard.username
|
|
}
|