Skip to content

Commit e5908c0

Browse files
author
Isaac
committed
Merge commit 'c026f5af0b1c8d8a2ea7fecd97bd65db4b99cd77'
2 parents 894e0e4 + c026f5a commit e5908c0

File tree

72 files changed

+2749
-665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2749
-665
lines changed

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

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13875,6 +13875,26 @@ Sorry for the inconvenience.";
1387513875

1387613876
"Chat.PanelCustomStatusShortInfo" = "%@ is a mark for [Premium subscribers >]()";
1387713877

13878+
"Chat.NonContactUser.Subtitle" = "Not a contact";
13879+
"Chat.NonContactUser.PhoneNumber" = "Phone Number";
13880+
"Chat.NonContactUser.Registration" = "Registration";
13881+
"Chat.NonContactUser.Groups" = "Shared Groups";
13882+
"Chat.NonContactUser.GroupsCount_1" = "%@ group";
13883+
"Chat.NonContactUser.GroupsCount_any" = "%@ groups";
13884+
"Chat.NonContactUser.GroupsNone" = "None";
13885+
"Chat.NonContactUser.Disclaimer" = "Not an official account";
13886+
"Chat.NonContactUser.AnonymousNumber" = "Anonymous";
13887+
13888+
"Chat.NonContactUser.UpdatedName" = "User updated name %1$@";
13889+
"Chat.NonContactUser.UpdatedPhoto" = "User updated photo %1$@";
13890+
13891+
"Chat.NonContactUser.UpdatedMinutes_1" = "%@ minute ago";
13892+
"Chat.NonContactUser.UpdatedMinutes_any" = "%@ minutes ago";
13893+
"Chat.NonContactUser.UpdatedHours_1" = "%@ hour ago";
13894+
"Chat.NonContactUser.UpdatedHours_any" = "%@ hours ago";
13895+
"Chat.NonContactUser.UpdatedDays_1" = "%@ day ago";
13896+
"Chat.NonContactUser.UpdatedDays_any" = "%@ days ago";
13897+
1387813898
"Chat.InputTextPaidMessagePlaceholder" = "Message for %@";
1387913899

1388013900
"Privacy.Messages.Stars_1" = "%@ Star";
@@ -13884,3 +13904,72 @@ Sorry for the inconvenience.";
1388413904
"Premium.PaidMessages" = "Paid Messages";
1388513905
"Premium.PaidMessagesInfo" = "Charge a fee for messages from non-contacts or new senders.";
1388613906
"Premium.PaidMessages.Proceed" = "About Telegram Premium";
13907+
13908+
"PeerInfo.Gifts.Reorder" = "Reorder";
13909+
"PeerInfo.Gifts.Context.Pin" = "Pin";
13910+
"PeerInfo.Gifts.Context.Unpin" = "Unpin";
13911+
"PeerInfo.Gifts.Context.Reorder" = "Reorder";
13912+
"PeerInfo.Gifts.Context.Wear" = "Wear";
13913+
"PeerInfo.Gifts.Context.CopyLink" = "Copy Link";
13914+
"PeerInfo.Gifts.Context.Share" = "Share";
13915+
"PeerInfo.Gifts.Context.Hide" = "Hide";
13916+
"PeerInfo.Gifts.Context.Show" = "Show";
13917+
"PeerInfo.Gifts.Context.Transfer" = "Transfer";
13918+
13919+
"Gift.Send.Premium.Confirmation.Title" = "Send a Gift";
13920+
"Gift.Send.Premium.Confirmation.Text" = "Are you sure you want to gift **Telegram Premium** to **%1$@** for **%2$@**?";
13921+
"Gift.Send.Premium.Confirmation.Text.Stars_1" = "%@ Star";
13922+
"Gift.Send.Premium.Confirmation.Text.Stars_any" = "%@ Stars";
13923+
"Gift.Send.Premium.Confirmation.Confirm" = "Confirm";
13924+
13925+
"StarsBalance.YourBalance" = "Your balance is %@";
13926+
"StarsBalance.GetMoreStars" = "Get More Stars >";
13927+
13928+
"Stars.Intro.BuyShort" = "Top Up";
13929+
"Stars.Intro.Withdraw" = "Withdraw";
13930+
13931+
"Group.Info.Settings" = "Group Settings";
13932+
13933+
"Monetization.Balance.StarsInfoGroup" = "You can collect rewards for Stars using Fragment. You cannot withdraw less than 1000 stars. [Learn More >]()";
13934+
13935+
"PeerInfo.Gifts.ToastPinLimit.Text_1" = "You can't pin more than %@ gift.";
13936+
"PeerInfo.Gifts.ToastPinLimit.Text_any" = "You can't pin more than %@ gifts.";
13937+
"PeerInfo.Gifts.ToastUnpinned.Text" = "Gift Unpinned.";
13938+
"PeerInfo.Gifts.ToastPinned.Title" = "Gift Pinned";
13939+
"PeerInfo.Gifts.ToastPinned.Text" = "Now it will always be shown on the top.";
13940+
13941+
"Chat.PaidMessage.Confirm.Title" = "Confirm Payment";
13942+
"Chat.PaidMessage.Confirm.DontAskAgain" = "Don't ask again";
13943+
"Chat.PaidMessage.Confirm.PayForMessage_1" = "Pay for %@ Message";
13944+
"Chat.PaidMessage.Confirm.PayForMessage_any" = "Pay for %@ Messages";
13945+
"Chat.PaidMessage.Confirm.Single.Text" = "**%1$@** charges **%2$@** per incoming message. Would you like to pay **%3$@** to send %4$@?";
13946+
"Chat.PaidMessage.Confirm.Multiple.Text" = "You selected %1$@ who charge Stars for messages. Would you like to pay **%2$@** Stars to send %3$@?";
13947+
"Chat.PaidMessage.Confirm.Text.Users_1" = "**%@** user";
13948+
"Chat.PaidMessage.Confirm.Text.Users_any" = "**%@** users";
13949+
"Chat.PaidMessage.Confirm.Text.Messages_1" = "**%@** message";
13950+
"Chat.PaidMessage.Confirm.Text.Messages_any" = "**%@** messages";
13951+
"Chat.PaidMessage.Confirm.Text.Stars_1" = "%@ Star";
13952+
"Chat.PaidMessage.Confirm.Text.Stars_any" = "%@ Stars";
13953+
13954+
"Chat.PaidMessage.RemoveFee.Title" = "Remove Fee";
13955+
"Chat.PaidMessage.RemoveFee.Text" = "Are you sure you want to allow **%@** to message you for free?";
13956+
"Chat.PaidMessage.RemoveFee.Yes" = "Yes";
13957+
"Chat.PaidMessage.RemoveFee.Refund" = "Refund already paid **%@**";
13958+
"Chat.PaidMessage.RemoveFee.Refund.Stars_1" = "%@ Star";
13959+
"Chat.PaidMessage.RemoveFee.Refund.Stars_any" = "%@ Stars";
13960+
13961+
"Chat.PaidMessage.Sent.Title_1" = "Message Sent";
13962+
"Chat.PaidMessage.Sent.Title_any" = "%@ Messages Sent";
13963+
"Chat.PaidMessage.Sent.Text" = "You paid %@";
13964+
"Chat.PaidMessage.Sent.Text.Stars_1" = "%@ Star";
13965+
"Chat.PaidMessage.Sent.Text.Stars_any" = "%@ Stars";
13966+
13967+
"Chat.PaidMessageFee.Text" = "%1$@ must pay %2$@ for each message to you.";
13968+
"Chat.PaidMessageFee.RemoveFee" = "Remove Fee";
13969+
13970+
"Privacy.Review.Review" = "Review";
13971+
"Privacy.Review.Calls.Title" = "Call Settings";
13972+
"Privacy.Review.Calls.Text" = "You've restricted who can message you, but anyone can still call you. Would you like to review these settings?";
13973+
13974+
"Privacy.Review.Invite.Title" = "Invitation Settings";
13975+
"Privacy.Review.Invite.Text" = "You've restricted who can message you, but anyone can still invite you to groups and channels. Would you like to review these settings?";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ public enum PeerInfoControllerMode {
593593
case myProfile
594594
case gifts
595595
case myProfileGifts
596+
case groupsInCommon
596597
}
597598

598599
public enum ContactListActionItemInlineIconPosition {
@@ -1100,6 +1101,7 @@ public protocol SharedAccountContext: AnyObject {
11001101
func makeStarsStatisticsScreen(context: AccountContext, peerId: EnginePeer.Id, revenueContext: StarsRevenueStatsContext) -> ViewController
11011102
func makeStarsAmountScreen(context: AccountContext, initialValue: Int64?, completion: @escaping (Int64) -> Void) -> ViewController
11021103
func makeStarsWithdrawalScreen(context: AccountContext, stats: StarsRevenueStats, completion: @escaping (Int64) -> Void) -> ViewController
1104+
func makeStarsWithdrawalScreen(context: AccountContext, completion: @escaping (Int64) -> Void) -> ViewController
11031105
func makeStarsGiftScreen(context: AccountContext, message: EngineMessage) -> ViewController
11041106
func makeStarsGiveawayBoostScreen(context: AccountContext, peerId: EnginePeer.Id, boost: ChannelBoostersContext.State.Boost) -> ViewController
11051107
func makeStarsIntroScreen(context: AccountContext) -> ViewController

submodules/AccountContext/Sources/ChatController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,12 @@ public struct ChatControllerInitialBotAppStart {
314314
public enum ChatControllerInteractionNavigateToPeer {
315315
public struct InfoParams {
316316
public let switchToRecommendedChannels: Bool
317+
public let switchToGroupsInCommon: Bool
317318
public let ignoreInSavedMessages: Bool
318319

319-
public init(switchToRecommendedChannels: Bool = false, ignoreInSavedMessages: Bool = false) {
320+
public init(switchToRecommendedChannels: Bool = false, switchToGroupsInCommon: Bool = false, ignoreInSavedMessages: Bool = false) {
320321
self.switchToRecommendedChannels = switchToRecommendedChannels
322+
self.switchToGroupsInCommon = switchToGroupsInCommon
321323
self.ignoreInSavedMessages = ignoreInSavedMessages
322324
}
323325
}

submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,9 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
908908
}
909909
self.textPlaceholderNode.isHidden = inputHasText
910910

911-
let textInputFrame = CGRect(x: leftInset + textFieldInsets.left, y: textFieldInsets.top, width: baseWidth - textFieldInsets.left - textFieldInsets.right, height: panelHeight - textFieldInsets.top - textFieldInsets.bottom)
911+
let additionalRightInset = self.updateFieldAndButtonsLayout(inputHasText: inputHasText, panelHeight: panelHeight, transition: transition)
912+
913+
let textInputFrame = CGRect(x: leftInset + textFieldInsets.left, y: textFieldInsets.top, width: baseWidth - textFieldInsets.left - textFieldInsets.right - additionalRightInset, height: panelHeight - textFieldInsets.top - textFieldInsets.bottom)
912914
transition.updateFrame(node: self.textInputContainer, frame: textInputFrame)
913915

914916
if let textInputNode = self.textInputNode {
@@ -923,16 +925,14 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
923925
}
924926
}
925927

926-
self.updateFieldAndButtonsLayout(inputHasText: inputHasText, panelHeight: panelHeight, transition: transition)
927-
928928
self.actionButtons.updateAccessibility()
929929

930930
return panelHeight
931931
}
932932

933-
private func updateFieldAndButtonsLayout(inputHasText: Bool, panelHeight: CGFloat, transition: ContainedViewLayoutTransition) {
933+
private func updateFieldAndButtonsLayout(inputHasText: Bool, panelHeight: CGFloat, transition: ContainedViewLayoutTransition) -> CGFloat {
934934
guard let (width, leftInset, rightInset, additionalSideInsets, _, metrics, _) = self.validLayout else {
935-
return
935+
return 0.0
936936
}
937937
var textFieldMinHeight: CGFloat = 33.0
938938
if let presentationInterfaceState = self.presentationInterfaceState {
@@ -954,6 +954,11 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
954954
let baseWidth = width - leftInset - rightInset
955955
let textInputFrame = self.textInputContainer.frame
956956

957+
var textFieldInsets = self.textFieldInsets(metrics: metrics)
958+
if additionalSideInsets.right > 0.0 {
959+
textFieldInsets.right += additionalSideInsets.right / 3.0
960+
}
961+
957962
var textBackgroundInset: CGFloat = 0.0
958963
let actionButtonsSize: CGSize
959964
if let presentationInterfaceState = self.presentationInterfaceState {
@@ -968,24 +973,19 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
968973
text = presentationInterfaceState.strings.MediaPicker_Send
969974
}
970975
actionButtonsSize = self.actionButtons.updateLayout(size: CGSize(width: 44.0, height: minimalHeight), transition: transition, minimized: isMinimized, text: text, interfaceState: presentationInterfaceState)
971-
textBackgroundInset = 44.0 - actionButtonsSize.width
976+
textBackgroundInset = actionButtonsSize.width - 44.0
972977
} else {
973978
actionButtonsSize = CGSize(width: 44.0, height: minimalHeight)
974979
}
975980

976-
var textFieldInsets = self.textFieldInsets(metrics: metrics)
977-
if additionalSideInsets.right > 0.0 {
978-
textFieldInsets.right += additionalSideInsets.right / 3.0
979-
}
980-
981981
let actionButtonsFrame = CGRect(origin: CGPoint(x: width - rightInset - actionButtonsSize.width + 1.0 - UIScreenPixel + composeButtonsOffset, y: panelHeight - minimalHeight), size: actionButtonsSize)
982982
transition.updateFrame(node: self.actionButtons, frame: actionButtonsFrame)
983983

984-
let textInputBackgroundFrame = CGRect(origin: CGPoint(), size: CGSize(width: textInputFrame.size.width + composeButtonsOffset + textBackgroundInset, height: textInputFrame.size.height))
984+
let textInputBackgroundFrame = CGRect(origin: CGPoint(), size: CGSize(width: textInputFrame.size.width + composeButtonsOffset, height: textInputFrame.size.height))
985985
transition.updateFrame(node: self.textInputContainerBackgroundNode, frame: textInputBackgroundFrame)
986986

987-
transition.updateFrame(layer: self.textInputBackgroundNode.layer, frame: CGRect(x: leftInset + textFieldInsets.left, y: textFieldInsets.top, width: baseWidth - textFieldInsets.left - textFieldInsets.right + composeButtonsOffset + textBackgroundInset, height: panelHeight - textFieldInsets.top - textFieldInsets.bottom))
988-
transition.updateFrame(layer: self.textInputBackgroundImageNode.layer, frame: CGRect(x: 0.0, y: 0.0, width: baseWidth - textFieldInsets.left - textFieldInsets.right + composeButtonsOffset + textBackgroundInset, height: panelHeight - textFieldInsets.top - textFieldInsets.bottom))
987+
transition.updateFrame(layer: self.textInputBackgroundNode.layer, frame: CGRect(x: leftInset + textFieldInsets.left, y: textFieldInsets.top, width: baseWidth - textFieldInsets.left - textFieldInsets.right + composeButtonsOffset - textBackgroundInset, height: panelHeight - textFieldInsets.top - textFieldInsets.bottom))
988+
transition.updateFrame(layer: self.textInputBackgroundImageNode.layer, frame: CGRect(x: 0.0, y: 0.0, width: baseWidth - textFieldInsets.left - textFieldInsets.right + composeButtonsOffset - textBackgroundInset, height: panelHeight - textFieldInsets.top - textFieldInsets.bottom))
989989

990990
var textInputViewRealInsets = UIEdgeInsets()
991991
if let presentationInterfaceState = self.presentationInterfaceState {
@@ -1027,6 +1027,8 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
10271027
placeholderFrame = CGRect(origin: CGPoint(x: leftInset + textFieldInsets.left + self.textInputViewInternalInsets.left, y: textFieldInsets.top + self.textInputViewInternalInsets.top + textInputViewRealInsets.top + UIScreenPixel), size: self.textPlaceholderNode.frame.size)
10281028
}
10291029
transition.updateFrame(node: self.textPlaceholderNode, frame: placeholderFrame)
1030+
1031+
return textBackgroundInset
10301032
}
10311033

10321034
private var skipUpdate = false
@@ -1387,7 +1389,7 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
13871389

13881390
let panelHeight = self.updateTextHeight(animated: animated)
13891391
if self.isAttachment, let panelHeight = panelHeight {
1390-
self.updateFieldAndButtonsLayout(inputHasText: inputHasText, panelHeight: panelHeight, transition: .animated(duration: 0.2, curve: .easeInOut))
1392+
let _ = self.updateFieldAndButtonsLayout(inputHasText: inputHasText, panelHeight: panelHeight, transition: .animated(duration: 0.2, curve: .easeInOut))
13911393
}
13921394
}
13931395

submodules/CountrySelectionUI/Sources/CountryList.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public func emojiFlagForISOCountryCode(_ countryCode: String) -> String {
1313
return "🛰️"
1414
} else if countryCode == "XV" {
1515
return "🌍"
16+
} else if countryCode == "TS" {
17+
return "🏳️"
1618
}
1719

1820
if ["YL"].contains(countryCode) {

submodules/MediaPickerUI/Sources/MediaPickerScreen.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,6 @@ public final class MediaPickerScreenImpl: ViewController, MediaPickerScreen, Att
23762376
transition.updateTransformScale(node: self.moreButtonNode.iconNode, scale: moreIsVisible ? 1.0 : 0.1)
23772377

23782378
//if self. {
2379-
//TODO:localize
23802379
//self.mainButtonStatePromise.set(.single(AttachmentMainButtonState(text: "Add", badge: "\(count)", font: .bold, background: .color(self.presentationData.theme.actionSheet.controlAccentColor), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, isVisible: count > 0, progress: .none, isEnabled: true, hasShimmer: false)))
23812380
//}
23822381
}

submodules/PremiumUI/Sources/PremiumDemoScreen.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,6 @@ private final class DemoSheetContent: CombinedComponent {
13021302
buttonAnimationName = "premium_unlock"
13031303
case .paidMessages:
13041304
buttonText = strings.Premium_PaidMessages_Proceed
1305-
buttonAnimationName = "premium_unlock"
13061305
default:
13071306
buttonText = strings.Common_OK
13081307
}

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,16 +1470,15 @@ public func privacyAndSecurityController(
14701470
}
14711471

14721472
showPrivacySuggestionImpl = {
1473-
//TODO:localize
14741473
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
14751474
if reviewCallPrivacySuggestion {
14761475
reviewCallPrivacySuggestion = false
14771476
let alertController = textAlertController(
14781477
context: context,
1479-
title: "Call Settings",
1480-
text: "You've restricted who can message you, but anyone can still call you. Would you like to review these settings?",
1478+
title: presentationData.strings.Privacy_Review_Calls_Title,
1479+
text: presentationData.strings.Privacy_Review_Calls_Text,
14811480
actions: [
1482-
TextAlertAction(type: .defaultAction, title: "Review", action: {
1481+
TextAlertAction(type: .defaultAction, title: presentationData.strings.Privacy_Review_Review, action: {
14831482
arguments.openVoiceCallPrivacy()
14841483
}),
14851484
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {
@@ -1495,10 +1494,10 @@ public func privacyAndSecurityController(
14951494
reviewInvitePrivacySuggestion = false
14961495
let alertController = textAlertController(
14971496
context: context,
1498-
title: "Invitation Settings",
1499-
text: "You've restricted who can message you, but anyone can still invite you to groups and channels. Would you like to review these settings?",
1497+
title: presentationData.strings.Privacy_Review_Invite_Title,
1498+
text: presentationData.strings.Privacy_Review_Invite_Text,
15001499
actions: [
1501-
TextAlertAction(type: .defaultAction, title: "Review", action: {
1500+
TextAlertAction(type: .defaultAction, title: presentationData.strings.Privacy_Review_Review, action: {
15021501
arguments.openGroupsPrivacy()
15031502
}),
15041503
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {

0 commit comments

Comments
 (0)