mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Fix contact image
This commit is contained in:
parent
e47a04c5d9
commit
77951adaa1
4 changed files with 5 additions and 7 deletions
|
|
@ -123,7 +123,7 @@ final class ContactsManager: ObservableObject {
|
|||
? contact.phoneNumbers.first!.value.stringValue
|
||||
: contact.givenName, lastName: contact.familyName),
|
||||
name: contact.givenName + contact.familyName,
|
||||
prefix: String(Int.random(in: 1...1000)) + ((imageThumbnail == nil) ? "-default" : ""),
|
||||
prefix: ((imageThumbnail == nil) ? "-default" : ""),
|
||||
contact: newContact, linphoneFriend: false, existingFriend: nil)
|
||||
}
|
||||
})
|
||||
|
|
@ -269,7 +269,8 @@ final class ContactsManager: ObservableObject {
|
|||
DispatchQueue.main.async {
|
||||
do {
|
||||
let urlName = URL(string: name + prefix)
|
||||
let imagePath = urlName != nil ? urlName!.absoluteString.replacingOccurrences(of: "%", with: "") : String(Int.random(in: 1...1000))
|
||||
let imagePath = urlName != nil ? urlName!.absoluteString.replacingOccurrences(of: "%", with: "") : "ImageError"
|
||||
|
||||
let decodedData: () = try data.write(to: directory!.appendingPathComponent(imagePath + ".png"))
|
||||
|
||||
completion(decodedData, imagePath + ".png")
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ final class CoreContext: ObservableObject {
|
|||
self.mCore.autoIterateEnabled = false
|
||||
self.mCore.friendsDatabasePath = "\(configDir)/friends.db"
|
||||
|
||||
print("configDirconfigDirconfigDir \(configDir)")
|
||||
|
||||
self.mCore.friendListSubscriptionEnabled = true
|
||||
|
||||
self.mCore.publisher?.onGlobalStateChanged?.postOnMainQueue { (cbVal: (core: Core, state: GlobalState, message: String)) in
|
||||
|
|
|
|||
|
|
@ -492,8 +492,7 @@ struct EditContactFragment: View {
|
|||
firstName: editContactViewModel.firstName, lastName: editContactViewModel.lastName),
|
||||
name: editContactViewModel.firstName
|
||||
+ editContactViewModel.lastName,
|
||||
prefix: String(Int.random(in: 1...1000))
|
||||
+ ((selectedImage == nil) ? "-default" : ""),
|
||||
prefix: ((selectedImage == nil) ? "-default" : ""),
|
||||
contact: newContact, linphoneFriend: true, existingFriend: editContactViewModel.selectedEditFriend)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct EditContactView: UIViewControllerRepresentable {
|
|||
? cnc.phoneNumbers.first!.value.stringValue
|
||||
: cnc.givenName, lastName: cnc.familyName),
|
||||
name: cnc.givenName + cnc.familyName,
|
||||
prefix: String(Int.random(in: 1...1000)) + ((imageThumbnail == nil) ? "-default" : ""),
|
||||
prefix: ((imageThumbnail == nil) ? "-default" : ""),
|
||||
contact: newContact,
|
||||
linphoneFriend: false,
|
||||
existingFriend: ContactsManager.shared.getFriendWithContact(contact: newContact))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue