Prefill the contact name with the display name or username of selected contact

This commit is contained in:
Julien Wadel 2020-06-05 23:45:15 +02:00
parent 2b9941eb50
commit f43f1d496f

View file

@ -24,6 +24,7 @@
.import Linphone 1.0 as Linphone
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
.import 'qrc:/ui/scripts/LinphoneUtils/linphone-utils.js' as LinphoneUtils
// =============================================================================
@ -59,6 +60,9 @@ function handleCreation () {
if (sipAddress && sipAddress.length > 0) {
vcard.addSipAddress(sipAddress)
vcard.username = LinphoneUtils.getContactUsername(Linphone.SipAddressesModel.getSipAddressObserver(sipAddress, sipAddress))
}else{
vcard.username = ' '// Username initialization to avoid Belr parsing issue when setting new name
}
contactEdit._vcard = vcard