Fix phone number linked to SIP address

This commit is contained in:
Benoit Martins 2025-01-20 13:17:39 +01:00
parent 9b31eb3d99
commit 7f2c276b6a

View file

@ -139,13 +139,11 @@ final class ContactsManager: ObservableObject {
self.friendList?.removeDelegate(delegate: friendListDelegate)
}
self.friendListDelegate = FriendListDelegateStub(onNewSipAddressDiscovered: { (_: FriendList, linphoneFriend: Friend, sipUri: String) in
var addedAvatarListModel: [ContactAvatarModel] = []
linphoneFriend.phoneNumbers.forEach { phone in
let address = core.interpretUrl(url: phone, applyInternationalPrefix: true)
let address = try? Factory.Instance.createAddress(addr: sipUri)
let presence = linphoneFriend.getPresenceModelForUriOrTel(uriOrTel: address?.asStringUriOnly() ?? "")
if address != nil && presence != nil {
if address != nil {
linphoneFriend.edit()
linphoneFriend.addAddress(address: address!)
linphoneFriend.done()