linphone-desktop/ui/scripts/LinphoneUtils/linphone-utils.js
2017-06-14 18:05:18 +02:00

16 lines
577 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
}