mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-28 01:09:19 +00:00
fix(LinphoneUtils): check correctly sip address string in getContactUsername
This commit is contained in:
parent
8a6afd79d6
commit
fa149d22af
1 changed files with 4 additions and 1 deletions
|
|
@ -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:')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue