Skip to content

Commit 984d220

Browse files
author
Isaac
committed
Merge commit 'ef20f4229c39b4a77a1f4d40c3ad0bf08f1facd4'
2 parents 241c383 + ef20f42 commit 984d220

File tree

51 files changed

+4475
-3850
lines changed

Some content is hidden

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

51 files changed

+4475
-3850
lines changed

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14262,6 +14262,7 @@ Sorry for the inconvenience.";
1426214262

1426314263
"PeerInfo.Gifts.Sale" = "sale";
1426414264

14265+
"Gift.Store.ForResaleNoResults" = "no results";
1426514266
"Gift.Store.ForResale_1" = "%@ for resale";
1426614267
"Gift.Store.ForResale_any" = "%@ for resale";
1426714268
"Gift.Store.Sort.Price" = "Price";
@@ -14291,10 +14292,31 @@ Sorry for the inconvenience.";
1429114292
"MediaPicker.CreateStory_any" = "Create %@ Stories";
1429214293
"MediaPicker.CombineIntoCollage" = "Combine into Collage";
1429314294

14294-
"Gift.Resale.Unavailable.Title" = "Resell Gift";
14295-
"Gift.Resale.Unavailable.Text" = "Sorry, you can't list this gift yet.\n\Reselling will be available on %@.";
14295+
"Gift.Resale.Unavailable.Title" = "Try Later";
14296+
"Gift.Resale.Unavailable.Text" = "You will be able to resell this gift on %@.";
1429614297

14297-
"Gift.Transfer.Unavailable.Title" = "Transfer Gift";
14298-
"Gift.Transfer.Unavailable.Text" = "Sorry, you can't transfer this gift yet.\n\Transferring will be available on %@.";
14298+
"Gift.Transfer.Unavailable.Title" = "Try Later";
14299+
"Gift.Transfer.Unavailable.Text" = "You will be able to transfer this gift on %@.";
1429914300

1430014301
"Premium.CreateMultipleStories" = "Create Multiple Stories";
14302+
14303+
"FrozenAccount.Violation.TextNew" = "Your account was frozen for breaking Telegram's [Terms and Conditions]().";
14304+
"FrozenAccount.Violation.TextNew_URL" = "https://telegram.org/tos";
14305+
14306+
"Stars.Purchase.BuyStarGiftInfo" = "Buy Stars to acquire a unique collectible.";
14307+
14308+
"Stars.Purchase.EnoughStars" = "You have enough stars at the moment.";
14309+
"Stars.Purchase.BuyAnyway" = "Buy Anyway";
14310+
14311+
"Gift.Buy.Confirm.Title" = "Confirm Payment";
14312+
"Gift.Buy.Confirm.Text" = "Do you really want to buy **%1$@** for %2$@?";
14313+
"Gift.Buy.Confirm.GiftText" = "Do you really want to buy **%1$@** for %2$@ and gift it to **%3$@**?";
14314+
"Gift.Buy.Confirm.Text.Stars_1" = "**%@** Star";
14315+
"Gift.Buy.Confirm.Text.Stars_any" = "**%@** Stars";
14316+
"Gift.Buy.Confirm.BuyFor_1" = "Buy for %@ Star";
14317+
"Gift.Buy.Confirm.BuyFor_any" = "Buy for %@ Stars";
14318+
14319+
"Calls.HideCallsTab" = "Hide Calls Tab";
14320+
14321+
"Story.Editor.TooltipSelection_1" = "Tap here to view your %@ story";
14322+
"Story.Editor.TooltipSelection_any" = "Tap here to view your %@ stories";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ public enum ResolvedUrl {
322322
case premiumMultiGift(reference: String?)
323323
case collectible(gift: StarGift.UniqueGift?)
324324
case messageLink(link: TelegramResolvedMessageLink?)
325+
case stars
325326
}
326327

327328
public enum ResolveUrlResult {

submodules/AccountContext/Sources/Premium.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public enum StarsPurchasePurpose: Equatable {
141141
case upgradeStarGift(requiredStars: Int64)
142142
case transferStarGift(requiredStars: Int64)
143143
case sendMessage(peerId: EnginePeer.Id, requiredStars: Int64)
144+
case buyStarGift(requiredStars: Int64)
144145
}
145146

146147
public struct PremiumConfiguration {

submodules/CallListUI/Sources/CallListController.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import TelegramBaseController
1616
import InviteLinksUI
1717
import UndoUI
1818
import TelegramCallsUI
19+
import TelegramUIPreferences
1920

2021
public enum CallListControllerMode {
2122
case tab
@@ -734,10 +735,22 @@ public final class CallListController: TelegramBaseController {
734735
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/AddUser"), color: theme.contextMenu.primaryColor)
735736
}, action: { [weak self] c, f in
736737
c?.dismiss(completion: { [weak self] in
737-
guard let strongSelf = self else {
738+
guard let self else {
738739
return
739740
}
740-
strongSelf.callPressed()
741+
self.callPressed()
742+
})
743+
})))
744+
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.Calls_HideCallsTab, icon: { theme in
745+
return generateTintedImage(image: UIImage(bundleImageName: "Peer Info/HideIcon"), color: theme.contextMenu.primaryColor)
746+
}, action: { [weak self] c, f in
747+
c?.dismiss(completion: { [weak self] in
748+
guard let self else {
749+
return
750+
}
751+
let _ = updateCallListSettingsInteractively(accountManager: self.context.sharedContext.accountManager, {
752+
$0.withUpdatedShowTab(false)
753+
}).start()
741754
})
742755
})))
743756

submodules/ChatListUI/Sources/ChatListControllerNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ public final class ChatListContainerNode: ASDisplayNode, ASGestureRecognizerDele
10151015
}
10161016
}
10171017

1018-
itemNode.listNode.isMainTab.set(self.availableFilters.firstIndex(where: { $0.id == id }) == 0 ? true : false)
1018+
itemNode.listNode.isMainTab.set(self.availableFilters.firstIndex(where: { $0.id == id }) == 0)
10191019
itemNode.updateLayout(size: layout.size, insets: insets, visualNavigationHeight: visualNavigationHeight, originalNavigationHeight: originalNavigationHeight, inlineNavigationLocation: inlineNavigationLocation, inlineNavigationTransitionFraction: itemInlineNavigationTransitionFraction, storiesInset: storiesInset, transition: nodeTransition)
10201020
if let scrollingOffset = self.scrollingOffset {
10211021
itemNode.updateScrollingOffset(navigationHeight: scrollingOffset.navigationHeight, offset: scrollingOffset.offset, transition: nodeTransition)

submodules/ChatListUI/Sources/Node/ChatListNode.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,8 +2092,6 @@ public final class ChatListNode: ListView {
20922092
return .single(.setupPhoto(accountPeer))
20932093
} else if suggestions.contains(.gracePremium) {
20942094
return .single(.premiumGrace)
2095-
} else if suggestions.contains(.setupBirthday) && birthday == nil {
2096-
return .single(.setupBirthday)
20972095
} else if suggestions.contains(.xmasPremiumGift) {
20982096
return .single(.xmasPremiumGift)
20992097
} else if suggestions.contains(.annualPremium) || suggestions.contains(.upgradePremium) || suggestions.contains(.restorePremium), let inAppPurchaseManager = context.inAppPurchaseManager {
@@ -2149,6 +2147,8 @@ public final class ChatListNode: ListView {
21492147
}
21502148
return .birthdayPremiumGift(peers: todayBirthdayPeers, birthdays: birthdays)
21512149
}
2150+
} else if suggestions.contains(.setupBirthday) && birthday == nil {
2151+
return .single(.setupBirthday)
21522152
} else if case let .link(id, url, title, subtitle) = suggestions.first(where: { if case .link = $0 { return true } else { return false} }) {
21532153
return .single(.link(id: id, url: url, title: title, subtitle: subtitle))
21542154
} else {

submodules/Components/ReactionButtonListComponent/Sources/ReactionButtonListComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public final class ReactionButtonAsyncNode: ContextControllerSourceView {
501501
animationFraction = max(0.0, min(1.0, (CACurrentMediaTime() - animationState.startTime) / animationState.duration))
502502
animationFraction = animationState.curve.solve(at: animationFraction)
503503
if animationState.fromExtracted != isExtracted {
504-
fixedTransitionDirection = isExtracted ? true : false
504+
fixedTransitionDirection = isExtracted
505505
}
506506
} else {
507507
animationFraction = 1.0

submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,10 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
11061106
}
11071107
}
11081108

1109+
if let rightLabelTextLayoutAndApply {
1110+
additionalTitleInset += rightLabelTextLayoutAndApply.0.size.width + 36.0
1111+
}
1112+
11091113
let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(0.0, params.width - leftInset - rightInset - additionalTitleInset), height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets()))
11101114

11111115
var maxStatusWidth: CGFloat = params.width - leftInset - rightInset - badgeSize

submodules/ContextUI/Sources/ContextController.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,12 @@ final class ContextControllerNode: ViewControllerTracingNode, ASScrollViewDelega
527527
guard let strongSelf = self, let _ = gesture else {
528528
return
529529
}
530-
let localPoint = strongSelf.view.convert(point, from: view)
530+
let localPoint: CGPoint
531+
if let layout = strongSelf.validLayout, layout.metrics.isTablet, layout.size.width > layout.size.height, let view {
532+
localPoint = view.convert(point, to: nil)
533+
} else {
534+
localPoint = strongSelf.view.convert(point, from: view)
535+
}
531536
let initialPoint: CGPoint
532537
if let current = strongSelf.initialContinueGesturePoint {
533538
initialPoint = current

submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionControllerNode.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ public func searchCountries(items: [((String, String), String, [Int])], query: S
167167
let componentsOne = item.0.0.components(separatedBy: " ")
168168
let abbrOne = componentsOne.compactMap { $0.first.flatMap { String($0) } }.reduce(into: String(), { $0.append(contentsOf: $1) }).replacingOccurrences(of: "&", with: "")
169169

170-
let componentsTwo = item.0.0.components(separatedBy: " ")
170+
let componentsTwo = item.0.1.components(separatedBy: " ")
171171
let abbrTwo = componentsTwo.compactMap { $0.first.flatMap { String($0) } }.reduce(into: String(), { $0.append(contentsOf: $1) }).replacingOccurrences(of: "&", with: "")
172172

173-
let string = "\(item.0.0) \((item.0.1)) \(item.1) \(abbrOne) \(abbrTwo)"
173+
let phoneCodes = item.2.map { "\($0)" }.joined(separator: " ")
174+
175+
let string = "\(item.0.0) \((item.0.1)) \(item.1) \(abbrOne) \(abbrTwo) \(phoneCodes)"
174176
let tokens = stringTokens(string)
175177
if matchStringTokens(tokens, with: queryTokens) {
176178
for code in item.2 {

0 commit comments

Comments
 (0)