Skip to content

Commit b92293e

Browse files
author
Isaac
committed
Merge commit '9e0600edfa45ce017d315be9101615dc480717d8' into post-suggestion
# Conflicts: # submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift
2 parents 89bcbcf + 9e0600e commit b92293e

File tree

67 files changed

+2694
-1381
lines changed

Some content is hidden

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

67 files changed

+2694
-1381
lines changed

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

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14202,3 +14202,94 @@ Sorry for the inconvenience.";
1420214202
"Story.Privacy.KeepOnMyPageManyInfo" = "Keep these stories on your profile even after they expire in %@. Privacy settings will apply.";
1420314203
"Story.Privacy.KeepOnChannelPageManyInfo" = "Keep these stories on the channel profile even after they expire in %@.";
1420414204
"Story.Privacy.KeepOnGroupPageManyInfo" = "Keep these stories on the group page even after they expire in %@.";
14205+
14206+
"Gift.Options.Gift.Filter.Resale" = "Resale";
14207+
"Gift.Options.Gift.Resale" = "resale";
14208+
14209+
"Stars.Intro.Transaction.GiftPurchase" = "Gift Purchase";
14210+
"Stars.Intro.Transaction.GiftSale" = "Gift Sale";
14211+
14212+
"Stars.Transaction.GiftPurchase" = "Gift Purchase";
14213+
"Stars.Transaction.GiftSale" = "Gift Sale";
14214+
14215+
"Channel.Info.AutoTranslate" = "Auto-Translate Messages";
14216+
14217+
"ChannelBoost.Table.AutoTranslate" = "Autotranslation of Messages";
14218+
"ChannelBoost.AutoTranslate" = "Autotranslation of Messages";
14219+
"ChannelBoost.AutoTranslateLevelText" = "Your channel needs **Level %1$@** to enable autotranslation of messages.";
14220+
14221+
"Channel.AdminLog.MessageToggleAutoTranslateOn" = "%@ enabled autotranslation of messages";
14222+
"Channel.AdminLog.MessageToggleAutoTranslateOff" = "%@ disabled autotranslation of messages";
14223+
14224+
"Notification.StarsGift.Bought" = "%1$@ gifted you %2$@ for %3$@";
14225+
"Notification.StarsGift.Bought.Stars_1" = "%@ Star";
14226+
"Notification.StarsGift.Bought.Stars_any" = "%@ Stars";
14227+
"Notification.StarsGift.BoughtYou" = "You gifted %1$@ for %2$@";
14228+
"Notification.StarsGift.BoughtForYouself" = "You bought this gift for %1$@";
14229+
14230+
"Gift.View.Context.ChangePrice" = "Change Price";
14231+
"Gift.View.Context.ViewInProfile" = "View in Profile";
14232+
14233+
"Gift.View.Sell" = "sell";
14234+
"Gift.View.Unlist" = "unlist";
14235+
14236+
"Gift.View.BuyFor" = "Buy for";
14237+
"Gift.View.SellingGiftInfo" = "%@ is selling this gift and you can buy it.";
14238+
14239+
"Gift.View.Resale.Success.Title" = "Gift Sent";
14240+
"Gift.View.Resale.Success.Text" = "%@ has been notified about your gift.";
14241+
"Gift.View.Resale.SuccessYou.Title" = "Gift Acquired";
14242+
"Gift.View.Resale.SuccessYou.Text" = "%@ is now yours.";
14243+
14244+
"Gift.View.Resale.Unlist.Title" = "Unlist This Item?";
14245+
"Gift.View.Resale.Unlist.Text" = "It will no longer be for sale.";
14246+
"Gift.View.Resale.Unlist.Unlist" = "Unlist";
14247+
"Gift.View.Resale.Unlist.Success" = "%@ is removed from sale.";
14248+
"Gift.View.Resale.List.Success" = "%@ is now for sale!";
14249+
"Gift.View.Resale.Relist.Success" = "%1$@ is relisted for %2$@.";
14250+
"Gift.View.Resale.Relist.Success.Stars_1" = "%@ Star";
14251+
"Gift.View.Resale.Relist.Success.Stars_any" = "%@ Stars";
14252+
14253+
"Stars.SellGift.Title" = "Sell Gift";
14254+
"Stars.SellGift.EditTitle" = "Edit Price";
14255+
"Stars.SellGift.AmountTitle" = "PRICE IN STARS";
14256+
"Stars.SellGift.AmountPlaceholder" = "Enter Price";
14257+
"Stars.SellGift.AmountInfo" = "You will receive **%@**.";
14258+
"Stars.SellGift.AmountInfo.Stars_1" = "%@ Star";
14259+
"Stars.SellGift.AmountInfo.Stars_any" = "%@ Stars";
14260+
"Stars.SellGift.Sell" = "Sell";
14261+
"Stars.SellGift.SellFor" = "Sell for";
14262+
14263+
"PeerInfo.Gifts.Sale" = "sale";
14264+
14265+
"Gift.Store.ForResale_1" = "%@ for resale";
14266+
"Gift.Store.ForResale_any" = "%@ for resale";
14267+
"Gift.Store.Sort.Price" = "Price";
14268+
"Gift.Store.Sort.Date" = "Date";
14269+
"Gift.Store.Sort.Number" = "Number";
14270+
"Gift.Store.SortByPrice" = "Sort By Price";
14271+
"Gift.Store.SortByDate" = "Sort By Date";
14272+
"Gift.Store.SortByNumber" = "Sort By Number";
14273+
"Gift.Store.Filter.Model" = "Model";
14274+
"Gift.Store.Filter.Backdrop" = "Backdrop";
14275+
"Gift.Store.Filter.Symbol" = "Symbol";
14276+
"Gift.Store.Filter.Selected.Model_1" = "%@ Model";
14277+
"Gift.Store.Filter.Selected.Model_any" = "%@ Models";
14278+
"Gift.Store.Filter.Selected.Backdrop_1" = "%@ Backdrop";
14279+
"Gift.Store.Filter.Selected.Backdrop_any" = "%@ Backdrops";
14280+
"Gift.Store.Filter.Selected.Symbol_1" = "%@ Symbol";
14281+
"Gift.Store.Filter.Selected.Symbol_any" = "%@ Symbols";
14282+
"Gift.Store.Search" = "Search";
14283+
"Gift.Store.SelectAll" = "Select All";
14284+
"Gift.Store.NoResults" = "No Results";
14285+
"Gift.Store.EmptyResults" = "No Matching Gifts";
14286+
"Gift.Store.ClearFilters" = "Clear Filters";
14287+
14288+
"Gift.Send.AvailableForResale" = "Available for Resale";
14289+
14290+
"MediaPicker.CreateStory_1" = "Create %@ Story";
14291+
"MediaPicker.CreateStory_any" = "Create %@ Stories";
14292+
"MediaPicker.CombineIntoCollage" = "Combine into Collage";
14293+
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 %@.";

submodules/AccountContext/Sources/Premium.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public enum BoostSubject: Equatable {
125125
case emojiPack
126126
case noAds
127127
case wearGift
128+
case autoTranslate
128129
}
129130

130131
public enum StarsPurchasePurpose: Equatable {
@@ -164,6 +165,7 @@ public struct PremiumConfiguration {
164165
minChannelCustomWallpaperLevel: 10,
165166
minChannelRestrictAdsLevel: 50,
166167
minChannelWearGiftLevel: 8,
168+
minChannelAutoTranslateLevel: 3,
167169
minGroupProfileIconLevel: 7,
168170
minGroupEmojiStatusLevel: 8,
169171
minGroupWallpaperLevel: 9,
@@ -193,6 +195,7 @@ public struct PremiumConfiguration {
193195
public let minChannelCustomWallpaperLevel: Int32
194196
public let minChannelRestrictAdsLevel: Int32
195197
public let minChannelWearGiftLevel: Int32
198+
public let minChannelAutoTranslateLevel: Int32
196199
public let minGroupProfileIconLevel: Int32
197200
public let minGroupEmojiStatusLevel: Int32
198201
public let minGroupWallpaperLevel: Int32
@@ -221,6 +224,7 @@ public struct PremiumConfiguration {
221224
minChannelCustomWallpaperLevel: Int32,
222225
minChannelRestrictAdsLevel: Int32,
223226
minChannelWearGiftLevel: Int32,
227+
minChannelAutoTranslateLevel: Int32,
224228
minGroupProfileIconLevel: Int32,
225229
minGroupEmojiStatusLevel: Int32,
226230
minGroupWallpaperLevel: Int32,
@@ -248,6 +252,7 @@ public struct PremiumConfiguration {
248252
self.minChannelCustomWallpaperLevel = minChannelCustomWallpaperLevel
249253
self.minChannelRestrictAdsLevel = minChannelRestrictAdsLevel
250254
self.minChannelWearGiftLevel = minChannelWearGiftLevel
255+
self.minChannelAutoTranslateLevel = minChannelAutoTranslateLevel
251256
self.minGroupProfileIconLevel = minGroupProfileIconLevel
252257
self.minGroupEmojiStatusLevel = minGroupEmojiStatusLevel
253258
self.minGroupWallpaperLevel = minGroupWallpaperLevel
@@ -283,6 +288,7 @@ public struct PremiumConfiguration {
283288
minChannelCustomWallpaperLevel: get(data["channel_custom_wallpaper_level_min"]) ?? defaultValue.minChannelCustomWallpaperLevel,
284289
minChannelRestrictAdsLevel: get(data["channel_restrict_sponsored_level_min"]) ?? defaultValue.minChannelRestrictAdsLevel,
285290
minChannelWearGiftLevel: get(data["channel_emoji_status_level_min"]) ?? defaultValue.minChannelWearGiftLevel,
291+
minChannelAutoTranslateLevel: get(data["channel_autotranslation_level_min"]) ?? defaultValue.minChannelAutoTranslateLevel,
286292
minGroupProfileIconLevel: get(data["group_profile_bg_icon_level_min"]) ?? defaultValue.minGroupProfileIconLevel,
287293
minGroupEmojiStatusLevel: get(data["group_emoji_status_level_min"]) ?? defaultValue.minGroupEmojiStatusLevel,
288294
minGroupWallpaperLevel: get(data["group_wallpaper_level_min"]) ?? defaultValue.minGroupWallpaperLevel,

submodules/Camera/Sources/Camera.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ private final class CameraContext {
173173
self.positionValue = configuration.position
174174
self._positionPromise = ValuePromise<Camera.Position>(configuration.position)
175175

176+
#if targetEnvironment(simulator)
177+
#else
176178
self.setDualCameraEnabled(configuration.isDualEnabled, change: false)
177-
179+
#endif
180+
178181
NotificationCenter.default.addObserver(
179182
self,
180183
selector: #selector(self.sessionRuntimeError),

submodules/Components/SheetComponent/Sources/SheetComponent.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
6767
public let externalState: ExternalState?
6868
public let animateOut: ActionSlot<Action<()>>
6969
public let onPan: () -> Void
70+
public let willDismiss: () -> Void
7071

7172
public init(
7273
content: AnyComponent<ChildEnvironmentType>,
@@ -76,7 +77,8 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
7677
isScrollEnabled: Bool = true,
7778
externalState: ExternalState? = nil,
7879
animateOut: ActionSlot<Action<()>>,
79-
onPan: @escaping () -> Void = {}
80+
onPan: @escaping () -> Void = {},
81+
willDismiss: @escaping () -> Void = {}
8082
) {
8183
self.content = content
8284
self.backgroundColor = backgroundColor
@@ -86,6 +88,7 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
8688
self.externalState = externalState
8789
self.animateOut = animateOut
8890
self.onPan = onPan
91+
self.willDismiss = willDismiss
8992
}
9093

9194
public static func ==(lhs: SheetComponent, rhs: SheetComponent) -> Bool {
@@ -222,6 +225,7 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
222225
let currentContentOffset = scrollView.contentOffset
223226
targetContentOffset.pointee = currentContentOffset
224227
if velocity.y > 300.0 {
228+
self.component?.willDismiss()
225229
self.animateOut(initialVelocity: initialVelocity, completion: {
226230
self.dismiss?(false)
227231
})
@@ -233,6 +237,7 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
233237
scrollView.setContentOffset(CGPoint(x: 0.0, y: scrollView.contentSize.height - scrollView.contentInset.top), animated: true)
234238
}
235239
} else {
240+
self.component?.willDismiss()
236241
self.animateOut(initialVelocity: initialVelocity, completion: {
237242
self.dismiss?(false)
238243
})

submodules/Display/Source/Navigation/NavigationModalContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ final class NavigationModalContainer: ASDisplayNode, ASScrollViewDelegate, ASGes
283283
let transition: ContainedViewLayoutTransition
284284
let dismissProgress: CGFloat
285285
if (velocity.y < -0.5 || progress >= 0.5) && self.checkInteractiveDismissWithControllers() {
286-
if let controller = self.container.controllers.last as? MinimizableController {
286+
if let controller = self.container.controllers.last as? MinimizableController, controller.isMinimizable {
287287
dismissProgress = 0.0
288288
targetOffset = 0.0
289289
transition = .immediate

submodules/ItemListStickerPackItem/Sources/ItemListStickerPackItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode {
370370
}
371371

372372
let packRevealOptions: [ItemListRevealOption]
373-
if item.editing.editable && item.enabled {
373+
if item.editing.editable && item.enabled && !item.editing.editing {
374374
packRevealOptions = [ItemListRevealOption(key: 0, title: item.presentationData.strings.Common_Delete, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)]
375375
} else {
376376
packRevealOptions = []
@@ -564,7 +564,7 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode {
564564
strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor
565565
}
566566

567-
let revealOffset = strongSelf.revealOffset
567+
let revealOffset = !packRevealOptions.isEmpty ? strongSelf.revealOffset : 0.0
568568

569569
let transition: ContainedViewLayoutTransition
570570
if animated {

submodules/MediaPickerUI/Sources/MediaPickerScreen.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ public final class MediaPickerScreenImpl: ViewController, MediaPickerScreen, Att
20042004
var hasSelect = false
20052005
if forCollage {
20062006
hasSelect = true
2007-
} else if case .story = mode {
2007+
} else if case .story = mode, selectionContext.selectionLimit > 1 {
20082008
hasSelect = true
20092009
}
20102010

@@ -2395,15 +2395,11 @@ public final class MediaPickerScreenImpl: ViewController, MediaPickerScreen, Att
23952395
transition.updateTransformScale(node: self.moreButtonNode.iconNode, scale: moreIsVisible ? 1.0 : 0.1)
23962396

23972397
if case .assets(_, .story) = self.subject, self.selectionCount > 0 {
2398-
//TODO:localize
2399-
var text = "Create 1 Story"
2400-
if self.selectionCount > 1 {
2401-
text = "Create \(self.selectionCount) Stories"
2402-
}
2398+
let text = self.presentationData.strings.MediaPicker_CreateStory(self.selectionCount)
24032399
self.mainButtonStatePromise.set(.single(AttachmentMainButtonState(text: text, badge: nil, font: .bold, background: .color(self.presentationData.theme.actionSheet.controlAccentColor), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, isVisible: true, progress: .none, isEnabled: true, hasShimmer: false, position: .top)))
24042400

24052401
if self.selectionCount > 1 && self.selectionCount <= 6 {
2406-
self.secondaryButtonStatePromise.set(.single(AttachmentMainButtonState(text: "Combine into Collage", badge: nil, font: .regular, background: .color(.clear), textColor: self.presentationData.theme.actionSheet.controlAccentColor, isVisible: true, progress: .none, isEnabled: true, hasShimmer: false, iconName: "Media Editor/Collage", smallSpacing: true, position: .bottom)))
2402+
self.secondaryButtonStatePromise.set(.single(AttachmentMainButtonState(text: self.presentationData.strings.MediaPicker_CombineIntoCollage, badge: nil, font: .regular, background: .color(.clear), textColor: self.presentationData.theme.actionSheet.controlAccentColor, isVisible: true, progress: .none, isEnabled: true, hasShimmer: false, iconName: "Media Editor/Collage", smallSpacing: true, position: .bottom)))
24072403
} else {
24082404
self.secondaryButtonStatePromise.set(.single(nil))
24092405
}
@@ -3406,7 +3402,7 @@ public func stickerMediaPickerController(
34063402
destinationCornerRadius: 0.0
34073403
)
34083404
},
3409-
completion: { result, _, commit in
3405+
completion: { result, _, _, commit in
34103406
completion(result, nil, .zero, nil, true, { _ in return nil }, {
34113407
returnToCameraImpl?()
34123408
})
@@ -3524,7 +3520,7 @@ public func avatarMediaPickerController(
35243520
destinationCornerRadius: 0.0
35253521
)
35263522
},
3527-
completion: { result, _, commit in
3523+
completion: { result, _, _, commit in
35283524
completion(result, nil, .zero, nil, true, { _ in return nil }, {
35293525
returnToCameraImpl?()
35303526
})

submodules/MtProtoKit/Sources/MTApiEnvironment.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ - (NSString *)platformString
542542
return @"iPhone 16 Pro";
543543
if ([platform isEqualToString:@"iPhone17,2"])
544544
return @"iPhone 16 Pro Max";
545+
if ([platform isEqualToString:@"iPhone17,5"])
546+
return @"iPhone 16e";
545547

546548
if ([platform hasPrefix:@"iPod1"])
547549
return @"iPod touch 1G";

submodules/PremiumUI/Sources/PremiumBoostLevelsScreen.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ func requiredBoostSubjectLevel(subject: BoostSubject, group: Bool, context: Acco
6161
return configuration.minChannelRestrictAdsLevel
6262
case .wearGift:
6363
return configuration.minChannelWearGiftLevel
64+
case .autoTranslate:
65+
return configuration.minChannelAutoTranslateLevel
6466
}
6567
}
6668

@@ -243,6 +245,7 @@ private final class LevelSectionComponent: CombinedComponent {
243245
case emojiPack
244246
case noAds
245247
case wearGift
248+
case autoTranslate
246249

247250
func title(strings: PresentationStrings, isGroup: Bool) -> String {
248251
switch self {
@@ -274,6 +277,8 @@ private final class LevelSectionComponent: CombinedComponent {
274277
return strings.ChannelBoost_Table_NoAds
275278
case .wearGift:
276279
return strings.ChannelBoost_Table_WearGift
280+
case .autoTranslate:
281+
return strings.ChannelBoost_Table_AutoTranslate
277282
}
278283
}
279284

@@ -307,6 +312,8 @@ private final class LevelSectionComponent: CombinedComponent {
307312
return "Premium/BoostPerk/NoAds"
308313
case .wearGift:
309314
return "Premium/BoostPerk/NoAds"
315+
case .autoTranslate:
316+
return "Chat/Title Panels/Translate"
310317
}
311318
}
312319
}
@@ -647,6 +654,8 @@ private final class SheetContent: CombinedComponent {
647654
textString = strings.ChannelBoost_EnableNoAdsLevelText("\(requiredLevel)").string
648655
case .wearGift:
649656
textString = strings.ChannelBoost_WearGiftLevelText("\(requiredLevel)").string
657+
case .autoTranslate:
658+
textString = strings.ChannelBoost_AutoTranslateLevelText("\(requiredLevel)").string
650659
}
651660
} else {
652661
let boostsString = strings.ChannelBoost_MoreBoostsNeeded_Boosts(Int32(remaining))
@@ -1162,6 +1171,9 @@ private final class SheetContent: CombinedComponent {
11621171
if !isGroup && level >= requiredBoostSubjectLevel(subject: .noAds, group: isGroup, context: component.context, configuration: premiumConfiguration) {
11631172
perks.append(.noAds)
11641173
}
1174+
if !isGroup && level >= requiredBoostSubjectLevel(subject: .autoTranslate, group: isGroup, context: component.context, configuration: premiumConfiguration) {
1175+
perks.append(.autoTranslate)
1176+
}
11651177
// if !isGroup && level >= requiredBoostSubjectLevel(subject: .wearGift, group: isGroup, context: component.context, configuration: premiumConfiguration) {
11661178
// perks.append(.wearGift)
11671179
// }
@@ -1466,6 +1478,8 @@ private final class BoostLevelsContainerComponent: CombinedComponent {
14661478
titleString = strings.ChannelBoost_NoAds
14671479
case .wearGift:
14681480
titleString = strings.ChannelBoost_WearGift
1481+
case .autoTranslate:
1482+
titleString = strings.ChannelBoost_AutoTranslate
14691483
}
14701484
} else {
14711485
titleString = isGroup == true ? strings.GroupBoost_Title_Current : strings.ChannelBoost_Title_Current

submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta
10621062
} else {
10631063
rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Edit), style: .regular, enabled: true, action: {
10641064
updateState {
1065-
$0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set())
1065+
$0.withUpdatedEditing(true).withUpdatedPackIdWithRevealedOptions(nil).withUpdatedSelectedPackIds(Set())
10661066
}
10671067
})
10681068
}

0 commit comments

Comments
 (0)