Skip to content

Commit 5d9d21e

Browse files
committed
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
2 parents ecb12a7 + 3b02aea commit 5d9d21e

File tree

14 files changed

+205
-43
lines changed

14 files changed

+205
-43
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15508,3 +15508,31 @@ Error: %8$@";
1550815508
"ChatList.Auctions.UpcomingAuction" = "Upcoming Auction";
1550915509

1551015510
"Gift.AuctionBid.UpcomingBid" = "You placed an early bid";
15511+
15512+
"Login.PhoneWithPasskeySubtitle" = "Enter your phone number\nor [log in using Passkey >](passkey)";
15513+
"PrivacySettings.Passkey" = "Passkey";
15514+
"Attachment.SharedAudio" = "SHARED AUDIO";
15515+
"Attachment.FilesSearchPlaceholder" = "Search shared audio";
15516+
"Chat.GiftPurchaseOffer.Reject" = "Reject";
15517+
"Chat.GiftPurchaseOffer.Accept" = "Accept";
15518+
15519+
"Passkeys.DeleteAlert.Title" = "Delete Passkey?";
15520+
"Passkeys.DeleteAlert.Text" = "Once deleted, this passkey can't be used to log in.\n\nDon't forget to remove it from your password manager too.";
15521+
"Passkeys.DeleteAlert.Action" = "Delete";
15522+
"Passkeys.Into.Title" = "Protect your account";
15523+
"Passkeys.Subtitle" = "Log in safely and keep your account secure.";
15524+
"Passkeys.Into.Title0" = "Create a Passkey";
15525+
"Passkeys.Into.Text0" = "Make a passkey to sign in easily and safely.";
15526+
"Passkeys.Into.Title1" = "Log in with Face ID";
15527+
"Passkeys.Into.Text1" = "Use Face ID, Touch ID, or your passcode to sign in.";
15528+
"Passkeys.Into.Title2" = "Store Passkey Securely";
15529+
"Passkeys.Into.Text2" = "Your passkey is safely kept in your iCloud Keychain.";
15530+
"Passkeys.ButtonCreate" = "Create Passkey";
15531+
"Passkeys.ButtonSkip" = "Skip";
15532+
"Passkeys.Title" = "Passkeys";
15533+
"Passkeys.Subtitle" = "Log in safely and keep your account secure.";
15534+
"Passkeys.EmptyName" = "Passkey";
15535+
"Passkeys.PasskeyCreatedPattern" = "created %@";
15536+
"Passkeys.PasskeyCreatedAndUsedPattern" = "created %1$@ • used %2$@";
15537+
"Passkeys.AddPasskey" = "Create Passkey";
15538+
"Passkeys.ListFooter" = "Your passkeys are stored securely in your password manager.";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,7 @@ public protocol SharedAccountContext: AnyObject {
14761476
func makeNewContactScreen(context: AccountContext, peer: EnginePeer?, phoneNumber: String?, shareViaException: Bool, completion: @escaping (EnginePeer?, DeviceContactStableId?, DeviceContactExtendedData?) -> Void) -> ViewController
14771477

14781478
func makeLoginEmailSetupController(context: AccountContext, blocking: Bool, emailPattern: String?, canAutoDismissIfNeeded: Bool, navigationController: NavigationController?, completion: @escaping () -> Void, dismiss: @escaping () -> Void) -> ViewController
1479+
func makePasskeySetupController(context: AccountContext, displaySkip: Bool, navigationController: NavigationController?, completion: @escaping () -> Void, dismiss: @escaping () -> Void) -> ViewController
14791480

14801481
func navigateToCurrentCall()
14811482
var hasOngoingCall: ValuePromise<Bool> { get }

submodules/AuthorizationUI/Sources/AuthorizationSequencePhoneEntryControllerNode.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,10 @@ final class AuthorizationSequencePhoneEntryControllerNode: ASDisplayNode {
576576
}
577577

578578
func updateDisplayPasskeyLoginOption() {
579-
//TODO:localize
580579
if self.account == nil {
581580
return
582581
}
583-
let attributedText = NSMutableAttributedString(attributedString: parseMarkdownIntoAttributedString("Enter your phone number\nor [log in using Passkey >](passkey)", attributes: MarkdownAttributes(
582+
let attributedText = NSMutableAttributedString(attributedString: parseMarkdownIntoAttributedString(self.strings.Login_PhoneWithPasskeySubtitle, attributes: MarkdownAttributes(
584583
body: MarkdownAttributeSet(font: Font.regular(17.0), textColor: self.theme.list.itemPrimaryTextColor),
585584
bold: MarkdownAttributeSet(font: Font.semibold(17.0), textColor: self.theme.list.itemPrimaryTextColor),
586585
link: MarkdownAttributeSet(font: Font.regular(17.0), textColor: self.theme.list.itemAccentColor),
@@ -607,7 +606,7 @@ final class AuthorizationSequencePhoneEntryControllerNode: ASDisplayNode {
607606
let titleInset: CGFloat = layout.size.width > 320.0 ? 18.0 : 0.0
608607
let additionalBottomInset: CGFloat = layout.size.width > 320.0 ? 80.0 : 10.0
609608

610-
self.titleNode.attributedText = NSAttributedString(string: self.account == nil ? strings.Login_NewNumber : strings.Login_PhoneTitle, font: Font.bold(28.0), textColor: self.theme.list.itemPrimaryTextColor)
609+
self.titleNode.attributedText = NSAttributedString(string: self.account == nil ? self.strings.Login_NewNumber : self.strings.Login_PhoneTitle, font: Font.bold(28.0), textColor: self.theme.list.itemPrimaryTextColor)
611610
self.titleActivateAreaNode.accessibilityLabel = self.titleNode.attributedText?.string ?? ""
612611

613612
let inset: CGFloat = 24.0

submodules/ChatListUI/Sources/ChatListController.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
137137
private let dismissAutoarchiveDisposable = MetaDisposable()
138138
private var didSuggestAutoarchive = false
139139
private var didSuggestLoginEmailSetup = false
140+
private var didSuggestLoginPasskeySetup = false
140141

141142
private var presentationData: PresentationData
142143
private let presentationDataValue = Promise<PresentationData>()
@@ -2586,6 +2587,30 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
25862587
return
25872588
}
25882589

2590+
if values.contains(.setupPasskey) {
2591+
if strongSelf.didSuggestLoginPasskeySetup {
2592+
return
2593+
}
2594+
strongSelf.didSuggestLoginPasskeySetup = true
2595+
2596+
let _ = (context.engine.notices.getServerProvidedSuggestions(reload: true)
2597+
|> deliverOnMainQueue).start(next: { [weak strongSelf] currentValues in
2598+
guard let strongSelf, currentValues.contains(.setupPasskey) else {
2599+
return
2600+
}
2601+
if let navigationController = strongSelf.navigationController as? NavigationController {
2602+
let controller = strongSelf.context.sharedContext.makePasskeySetupController(context: strongSelf.context, displaySkip: true, navigationController: navigationController, completion: {
2603+
let _ = context.engine.notices.dismissServerProvidedSuggestion(suggestion: ServerProvidedSuggestion.setupPasskey.id).startStandalone()
2604+
}, dismiss: {
2605+
let _ = context.engine.notices.dismissServerProvidedSuggestion(suggestion: ServerProvidedSuggestion.setupPasskey.id).startStandalone()
2606+
})
2607+
navigationController.pushViewController(controller)
2608+
}
2609+
})
2610+
2611+
return
2612+
}
2613+
25892614
if strongSelf.didSuggestAutoarchive {
25902615
return
25912616
}

submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,12 +673,11 @@ private func privacyAndSecurityControllerEntries(
673673
entries.append(.twoStepVerification(presentationData.theme, presentationData.strings.PrivacySettings_TwoStepAuth, twoStepAuthString, twoStepAuthData))
674674

675675
if displayPasskeys {
676-
//TODO:localize
677676
var passkeysString = ""
678677
if let hasPasskeys = hasPasskeys {
679-
passkeysString = hasPasskeys ? "On" : "Off"
678+
passkeysString = hasPasskeys ? presentationData.strings.PrivacySettings_PasscodeOn : presentationData.strings.PrivacySettings_PasscodeOff
680679
}
681-
entries.append(.passkeys(presentationData.theme, "Passkey", passkeysString))
680+
entries.append(.passkeys(presentationData.theme, presentationData.strings.PrivacySettings_Passkey, passkeysString))
682681
}
683682

684683
if let privacySettings = privacySettings {
@@ -1268,9 +1267,9 @@ public func privacyAndSecurityController(
12681267
}, openPasskeys: {
12691268
Task { @MainActor in
12701269
let initialPasskeysData = await (passkeysDataValue.get() |> take(1)).get()
1271-
let passkeysScreen = await PasskeysScreen(context: context, initialPasskeysData: initialPasskeysData, passkeysDataUpdated: { passkeysData in
1270+
let passkeysScreen = PasskeysScreen(context: context, displaySkip: false, initialPasskeysData: initialPasskeysData, passkeysDataUpdated: { passkeysData in
12721271
passkeysDataValue.set(.single(passkeysData))
1273-
})
1272+
}, completion: {}, cancel: {})
12741273
pushControllerImpl?(passkeysScreen, true)
12751274
}
12761275
}, openActiveSessions: {

submodules/TelegramCore/Sources/Suggestions.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public enum ServerProvidedSuggestion: Equatable {
2020
case setupPhoto
2121
case setupLoginEmail
2222
case setupLoginEmailBlocking
23+
case setupPasskey
2324
case link(id: String, url: String, title: ServerSuggestionInfo.Item.Text, subtitle: ServerSuggestionInfo.Item.Text)
2425

2526
init?(string: String) {
@@ -56,6 +57,8 @@ public enum ServerProvidedSuggestion: Equatable {
5657
self = .setupLoginEmail
5758
case "SETUP_LOGIN_EMAIL_NOSKIP":
5859
self = .setupLoginEmailBlocking
60+
case "SETUP_PASSKEY":
61+
self = .setupPasskey
5962
default:
6063
return nil
6164
}
@@ -95,6 +98,8 @@ public enum ServerProvidedSuggestion: Equatable {
9598
return "SETUP_LOGIN_EMAIL"
9699
case .setupLoginEmailBlocking:
97100
return "SETUP_LOGIN_EMAIL_NOSKIP"
101+
case .setupPasskey:
102+
return "SETUP_PASSKEY"
98103
case let .link(id, _, _, _):
99104
return id
100105
}

submodules/TelegramUI/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ swift_library(
498498
"//submodules/TelegramUI/Components/AttachmentFileController",
499499
"//submodules/TelegramUI/Components/Contacts/NewContactScreen",
500500
"//submodules/TelegramUI/Components/Chat/ChatSendAsContextMenu",
501+
"//submodules/TelegramUI/Components/Settings/PasskeysScreen",
501502
] + select({
502503
"@build_bazel_rules_apple//apple:ios_arm64": appcenter_targets,
503504
"//build-system:ios_sim_arm64": [],

submodules/TelegramUI/Components/AttachmentFileController/Sources/AttachmentFileController.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ private func attachmentFileControllerEntries(presentationData: PresentationData,
207207
case .recent:
208208
listTitle = presentationData.strings.Attachment_RecentlySentFiles
209209
case .audio:
210-
//TODO:localize
211-
listTitle = "SHARED AUDIO"
210+
listTitle = presentationData.strings.Attachment_SharedAudio
212211
}
213212

214213
if case .audio = mode {

submodules/TelegramUI/Components/AttachmentFileController/Sources/AttachmentFileSearchItem.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ private final class AttachmentFileSearchItemNode: ItemListControllerSearchNode {
138138
transition.updateFrame(node: self.containerNode, frame: CGRect(origin: CGPoint(x: 0.0, y: navigationBarHeight), size: CGSize(width: layout.size.width, height: layout.size.height - navigationBarHeight)))
139139
self.containerNode.containerLayoutUpdated(layout.withUpdatedSize(CGSize(width: layout.size.width, height: layout.size.height - navigationBarHeight)), navigationBarHeight: 0.0, transition: transition)
140140

141-
//TODO:localize
142141
let searchInputSize = self.searchInput.update(
143142
transition: .immediate,
144143
component: AnyComponent(
@@ -147,7 +146,7 @@ private final class AttachmentFileSearchItemNode: ItemListControllerSearchNode {
147146
strings: self.presentationData.strings,
148147
metrics: layout.metrics,
149148
safeInsets: layout.safeInsets,
150-
placeholder: self.mode == .audio ? "Search shared audio" : self.presentationData.strings.Attachment_FilesSearchPlaceholder,
149+
placeholder: self.mode == .audio ? self.presentationData.strings.Attachment_FilesSearchPlaceholder : self.presentationData.strings.Attachment_FilesSearchPlaceholder,
151150
updated: { [weak self] query in
152151
guard let self else {
153152
return

submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,6 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
28442844
icon: .suggestedPostReject
28452845
)
28462846
]
2847-
//TODO:localize
28482847
let (minWidth, buttonsLayout) = actionButtonsLayout(
28492848
item.context,
28502849
item.presentationData.theme,
@@ -2854,8 +2853,8 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
28542853
ReplyMarkupMessageAttribute(
28552854
rows: [
28562855
ReplyMarkupRow(buttons: [
2857-
ReplyMarkupButton(title: "Reject", titleWhenForwarded: nil, action: .callback(requiresPassword: false, data: buttonDecline)),
2858-
ReplyMarkupButton(title: "Accept", titleWhenForwarded: nil, action: .callback(requiresPassword: false, data: buttonApprove))
2856+
ReplyMarkupButton(title: item.presentationData.strings.Chat_GiftPurchaseOffer_Reject, titleWhenForwarded: nil, action: .callback(requiresPassword: false, data: buttonDecline)),
2857+
ReplyMarkupButton(title: item.presentationData.strings.Chat_GiftPurchaseOffer_Accept, titleWhenForwarded: nil, action: .callback(requiresPassword: false, data: buttonApprove))
28592858
])
28602859
],
28612860
flags: [],

0 commit comments

Comments
 (0)