Merge branch 'experimental-3'

# Conflicts:
#	Telegram/Telegram-iOS/en.lproj/Localizable.strings
#	submodules/ChatListUI/Sources/ChatListControllerNode.swift
#	submodules/ChatListUI/Sources/Node/ChatListNode.swift
#	submodules/ChatListUI/Sources/Node/ChatListStorageInfoItem.swift
#	submodules/GalleryUI/Sources/SecretMediaPreviewController.swift
#	submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewController.swift
#	submodules/LegacyComponents/Sources/TGMediaPickerGalleryInterfaceView.m
#	submodules/LegacyMediaPickerUI/Sources/LegacyICloudFilePicker.swift
#	submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift
#	submodules/TelegramApi/Sources/Api0.swift
#	submodules/TelegramApi/Sources/Api21.swift
#	submodules/TelegramApi/Sources/Api31.swift
#	submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift
#	submodules/TelegramCore/Sources/State/Serialization.swift
#	submodules/TelegramCore/Sources/TelegramEngine/Messages/AttachMenuBots.swift
#	submodules/TelegramUI/BUILD
#	submodules/TelegramUI/Components/LegacyMessageInputPanel/Sources/LegacyMessageInputPanel.swift
#	submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift
#	submodules/TelegramUI/Components/MessageInputPanelComponent/BUILD
#	submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift
#	submodules/TelegramUI/Components/Settings/NewSessionInfoScreen/Sources/NewSessionInfoContentComponent.swift
#	submodules/TelegramUI/Components/Settings/NewSessionInfoScreen/Sources/NewSessionInfoScreen.swift
#	submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift
#	submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift
#	submodules/TelegramUI/Sources/AccountContext.swift
#	submodules/TelegramUI/Sources/ChatController.swift
#	submodules/TelegramUI/Sources/OpenResolvedUrl.swift
#	submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift
#	submodules/TelegramUI/Sources/SharedAccountContext.swift
#	submodules/WebUI/Sources/WebAppTermsAlertController.swift
#	versions.json
This commit is contained in:
Ali 2023-09-08 13:32:46 +04:00
commit 2005a3a18a
11 changed files with 9230 additions and 20 deletions

View File

@ -9919,3 +9919,48 @@ Sorry for the inconvenience.";
"WebApp.DisclaimerAgree" = "I agree to the [Terms of Use]()";
"WebApp.DisclaimerContinue" = "Continue";
"WebApp.Disclaimer_URL" = "https://telegram.org/tos/mini-apps";
"WebApp.AllowWriteTitle" = "Allow Sending Messages?";
"WebApp.AllowWriteConfirmation" = "This will allow the bot **%@** to message you on Telegram.";
"AuthSessions.MessageApp" = "You allowed this bot to message you when you opened %@.";
"Notification.BotWriteAllowedMenu" = "You allowed this bot to message you when you added it to your attachment menu.";
"Notification.BotWriteAllowedRequest" = "You allowed this bot to message you in the app.";
"WebApp.SharePhoneTitle" = "Share Phone Number?";
"WebApp.SharePhoneConfirmation" = "**%@** will know your phone number. This can be useful for integration with other services.";
"WebApp.SharePhoneConfirmationUnblock" = "**%@** will know your phone number. This can be useful for integration with other services.\n\nThis will also unblock the bot.";
"SecretImage.ViewOnce.Title" = "Disappearing Photo";
"SecretVideo.ViewOnce.Title" = "Disappearing Video";
"MediaPicker.Timer.Description" = "Choose how long the media will be kept after opening.";
"MediaPicker.Timer.ViewOnce" = "View Once";
"MediaPicker.Timer.Seconds_1" = "%d Second";
"MediaPicker.Timer.Seconds_any" = "%d Seconds";
"MediaPicker.Timer.DoNotDelete" = "Do Not Delete";
"MediaPicker.Timer.Photo.ViewOnceTooltip" = "Photo set to view once.";
"MediaPicker.Timer.Photo.TimerTooltip" = "Photo will be deleted in\n%@ seconds after opening.";
"MediaPicker.Timer.Photo.KeepTooltip" = "Photo will be kept in chat.";
"MediaPicker.Timer.Video.ViewOnceTooltip" = "Video set to view once.";
"MediaPicker.Timer.Video.TimerTooltip" = "Video will be deleted in\n%@ seconds after opening.";
"MediaPicker.Timer.Video.KeepTooltip" = "Video will be kept in chat.";
"Gallery.ViewOncePhotoTooltip" = "This photo can only be viewed once.";
"Gallery.ViewOnceVideoTooltip" = "This video can only be viewed once.";
"ChatList.SessionReview.ConfirmToastTitle" = "New Login Allowed";
"ChatList.SessionReview.ConfirmToastText" = "You can check the list of your active logins in [Settings > Devices]().";
"ChatList.SessionReview.PanelTitle" = "Someone just got acess to your messages!";
"ChatList.SessionReview.PanelText" = "We detected a new login to your account from %1$@, %2$@. Is it you?";
"ChatList.SessionReview.PanelConfirm" = "Yes, it's me";
"ChatList.SessionReview.PanelReject" = "No, it's not me!";
"SessionReview.NoticeText" = "Never send your login code to anyone or you can lose your Telegram account!";
"SessionReview.Title" = "New Login Prevented";
"SessionReview.Text" = "We have terminated the login attempt from **%1$@**, **%2$@**";
"SessionReview.OkAction" = "Got it";

View File

@ -1 +1 @@
2400
2500

View File

@ -1623,8 +1623,7 @@ public final class ChatListNode: ListView {
} else {
animationBackgroundColor = UIColor(rgb: 0x474747)
}
//TODO:localize
self.present?(UndoOverlayController(presentationData: presentationData, content: .universal(animation: "anim_success", scale: 1.0, colors: ["info1.info1.stroke": animationBackgroundColor, "info2.info2.Fill": animationBackgroundColor], title: "New Login Allowed", text: "You can check the list of your active logins in [Settings > Devices]().", customUndoText: nil, timeout: 5), elevatedLayout: false, action: { [weak self] action in
self.present?(UndoOverlayController(presentationData: presentationData, content: .universal(animation: "anim_success", scale: 1.0, colors: ["info1.info1.stroke": animationBackgroundColor, "info2.info2.Fill": animationBackgroundColor], title: presentationData.strings.ChatList_SessionReview_ConfirmToastTitle, text: presentationData.strings.ChatList_SessionReview_ConfirmToastText, customUndoText: nil, timeout: 5), elevatedLayout: false, action: { [weak self] action in
switch action {
case .info:
self?.interaction?.openActiveSessions()

View File

@ -207,14 +207,13 @@ class ChatListStorageInfoItemNode: ItemListRevealOptionsItemNode {
spacing = 2.0
alignment = .center
//TODO:localize
let titleStringValue = NSMutableAttributedString(attributedString: NSAttributedString(string: "Someone just got acess to your messages!", font: titleFont, textColor: item.theme.rootController.navigationBar.primaryTextColor))
let titleStringValue = NSMutableAttributedString(attributedString: NSAttributedString(string: item.strings.ChatList.SessionReview_PanelTitle, font: titleFont, textColor: item.theme.rootController.navigationBar.primaryTextColor))
titleString = titleStringValue
textString = NSAttributedString(string: "We detected a new login to your account from \(newSessionReview.device), \(newSessionReview.location). Is it you?", font: textFont, textColor: item.theme.rootController.navigationBar.secondaryTextColor)
textString = NSAttributedString(string: item.strings.ChatList_SessionReview_PanelText(newSessionReview.device, newSessionReview.location).0, font: textFont, textColor: item.theme.rootController.navigationBar.secondaryTextColor)
okButtonLayout = makeOkButtonTextLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: "Yes, it's me", font: titleFont, textColor: item.theme.list.itemAccentColor), maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - sideInset - rightInset, height: 100.0)))
cancelButtonLayout = makeCancelButtonTextLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: "No, it's not me!", font: titleFont, textColor: item.theme.list.itemDestructiveColor), maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - sideInset - rightInset, height: 100.0)))
okButtonLayout = makeOkButtonTextLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.strings.ChatList_SessionReview_PanelConfirm, font: titleFont, textColor: item.theme.list.itemAccentColor), maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - sideInset - rightInset, height: 100.0)))
cancelButtonLayout = makeCancelButtonTextLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.strings.ChatList_SessionReview_PanelReject, font: titleFont, textColor: item.theme.list.itemDestructiveColor), maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - sideInset - rightInset, height: 100.0)))
}
let titleLayout = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleString, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - sideInset - rightInset, height: 100.0), alignment: alignment, lineSpacing: 0.18))

View File

@ -280,6 +280,11 @@ public final class SecretMediaPreviewController: ViewController {
self.controllerNode.dismiss = { [weak self] in
self?._hiddenMedia.set(.single(nil))
self?.presentingViewController?.dismiss(animated: false, completion: nil)
if let tooltipController = self?.tooltipController {
self?.tooltipController = nil
tooltipController.dismiss()
}
}
self.controllerNode.beginCustomDismiss = { [weak self] _ in

File diff suppressed because it is too large Load Diff

View File

@ -146,11 +146,15 @@ public enum MediaArea: Codable, Equatable {
case reaction
}
public enum DecodingError: Error {
case generic
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
guard let type = MediaAreaType(rawValue: try container.decode(Int32.self, forKey: .type)) else {
fatalError()
throw DecodingError.generic
}
switch type {
case .venue:

View File

@ -103,11 +103,10 @@ public final class NewSessionInfoContentComponent: Component {
contentHeight += -14.0
//TODO:localize
let noticeSize = self.notice.update(
transition: .immediate,
component: AnyComponent(BalancedTextComponent(
text: .plain(NSAttributedString(string: "Never send your login code to anyone or you can lose your Telegram account!", font: Font.semibold(15.0), textColor: component.theme.list.itemDestructiveColor)),
text: .plain(NSAttributedString(string: component.strings.SessionReview_NoticeText, font: Font.semibold(15.0), textColor: component.theme.list.itemDestructiveColor)),
horizontalAlignment: .center,
maximumNumberOfLines: 0,
lineSpacing: 0.2
@ -146,9 +145,8 @@ public final class NewSessionInfoContentComponent: Component {
contentHeight += iconSize
contentHeight += 16.0
//TODO:localize
let titleString = NSMutableAttributedString()
titleString.append(NSAttributedString(string: "New Login Prevented", font: Font.semibold(19.0), textColor: component.theme.list.itemPrimaryTextColor))
titleString.append(NSAttributedString(string: component.strings.SessionReview_Title, font: Font.semibold(19.0), textColor: component.theme.list.itemPrimaryTextColor))
let imageAttachment = NSTextAttachment()
imageAttachment.image = self.iconBackground.image
titleString.append(NSAttributedString(attachment: imageAttachment))
@ -171,8 +169,7 @@ public final class NewSessionInfoContentComponent: Component {
contentHeight += titleSize.height
contentHeight += 16.0
//TODO:localize
let text: String = "We have terminated the login attempt from **\(component.newSessionReview.device), \(component.newSessionReview.location)**"
let text: String = component.strings.SessionReview_Text(component.newSessionReview.device, component.newSessionReview.location).string
let mainText = NSMutableAttributedString()
mainText.append(parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(

View File

@ -96,11 +96,9 @@ private final class NewSessionInfoSheetContentComponent: Component {
contentHeight += contentSize.height
contentHeight += 30.0
//TODO:localize
var buttonContents: [AnyComponentWithIdentity<Empty>] = []
buttonContents.append(AnyComponentWithIdentity(id: AnyHashable(0 as Int), component: AnyComponent(
Text(text: "Got it", font: Font.semibold(17.0), color: environment.theme.list.itemCheckColors.foregroundColor)
Text(text: environment.strings.SessionReview_OkAction, font: Font.semibold(17.0), color: environment.theme.list.itemCheckColors.foregroundColor)
)))
if self.remainingTimer > 0 {
buttonContents.append(AnyComponentWithIdentity(id: AnyHashable(1 as Int), component: AnyComponent(

View File

@ -240,7 +240,6 @@ private final class StoryStealthModeSheetContentComponent: Component {
contentHeight += contentSize.height
contentHeight += 41.0
//TODO:localize
let buttonText: String
let content: AnyComponentWithIdentity<Empty>
switch component.mode {

View File

@ -1,5 +1,5 @@
{
"app": "10.0.2",
"app": "10.0.3",
"bazel": "6.3.2",
"xcode": "14.3.1"
}