From a5f2fac611b0461bc9e13598ceaf781f4e7c84fa Mon Sep 17 00:00:00 2001 From: tejuamirthi Date: Wed, 23 Mar 2022 02:01:55 +0530 Subject: [PATCH] update contact save value to handle --- submodules/AccountContext/Sources/DeviceContactData.swift | 6 +++--- .../PeerInfoUI/Sources/DeviceContactInfoController.swift | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/submodules/AccountContext/Sources/DeviceContactData.swift b/submodules/AccountContext/Sources/DeviceContactData.swift index fe5aca7de94..ac27960e6e3 100644 --- a/submodules/AccountContext/Sources/DeviceContactData.swift +++ b/submodules/AccountContext/Sources/DeviceContactData.swift @@ -187,11 +187,11 @@ public final class DeviceContactInstantMessagingProfileData: Equatable, Hashable } public let phonebookUsernamePathPrefix = "@id" -private let phonebookUsernamePrefix = "https://t.me/" + phonebookUsernamePathPrefix +private let phonebookUsernamePrefix = "https://t.me/" public extension DeviceContactUrlData { - convenience init(appProfile: PeerId) { - self.init(label: "Telegram", value: "\(phonebookUsernamePrefix)\(appProfile.id)") + convenience init(addressName: String) { + self.init(label: "Telegram", value: "\(phonebookUsernamePrefix)\(addressName)") } } diff --git a/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift b/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift index 42248703786..3bf48636fa1 100644 --- a/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift +++ b/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift @@ -1072,7 +1072,8 @@ public func deviceContactInfoController(context: AccountContext, updatedPresenta if let editingName = state.editingState?.editingName, case let .personName(firstName, lastName, _) = editingName, (!firstName.isEmpty || !lastName.isEmpty) { var urls = filteredData.urls if let createForPeer = createForPeer { - let appProfile = DeviceContactUrlData(appProfile: createForPeer.id) + let addressName: String = createForPeer.addressName ?? "" + let appProfile = DeviceContactUrlData(addressName: addressName) var found = false for url in urls { if url.label == appProfile.label && url.value == appProfile.value {