Commit fa149d22 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(LinphoneUtils): check correctly sip address string in getContactUsername

parent 8a6afd79
......@@ -17,7 +17,10 @@ function getContactUsername (contact) {
return object.vcard.username
}
object = contact.sipAddress || contact // String from `SipAddressObserver` or just a String.
object = Utils.isString(contact.sipAddress)
? contact.sipAddress // String from `SipAddressObserver`.
: contact // Just a String.
var index = object.indexOf('@')
return object.substring(4, index !== -1 ? index : undefined) // 4 = length('sip:')
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment