linphone-desktop/tests/ui/scripts/LinphoneUtils/linphone-utils.js
Ronan Abhamon 08fbc20c97 feat(app): many changes:
- use vcard of Contact in qml
- remove `sipAddress` attribute of Contact
- refactoring...
2016-12-14 13:20:35 +01:00

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
}