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 {