feat(LinphoneUtils): supports addresses like sip:[word]

This commit is contained in:
Wescoeur 2017-06-26 21:15:17 +02:00
parent 0c0b8c4f1a
commit c1e93ffa60

View file

@ -16,7 +16,8 @@ function getContactUsername (contact) {
contact // String.
if (Utils.isString(object)) {
return object.substring(4, object.indexOf('@')) // 4 = length('sip:')
var index = object.indexOf('@')
return object.substring(4, index !== -1 ? index : undefined) // 4 = length('sip:')
}
return object.vcard.username