linphone-desktop/tests/ui/scripts/LinphoneUtils/linphone-utils.js
2016-12-01 17:11:16 +01:00

14 lines
469 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.username
}