Skip to content

Commit 6a09d2e

Browse files
committed
Various improvements
1 parent 0044bde commit 6a09d2e

File tree

17 files changed

+1012
-264
lines changed

17 files changed

+1012
-264
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15507,7 +15507,9 @@ Error: %8$@";
1550715507

1550815508
"ChatList.Auctions.UpcomingAuction" = "Upcoming Auction";
1550915509

15510-
"Gift.AuctionBid.UpcomingBid" = "You placed an early bid";
15510+
"Gift.AuctionBid.UpcomingBid" = "You've placed an early bid";
15511+
"ChatList.Auctions.Status.UpcomingBid" = "You've placed an early bid.";
15512+
"Gift.ActiveAuctions.UpcomingBid" = "You've placed an early bid";
1551115513

1551215514
"Login.PhoneWithPasskeySubtitle" = "Enter your phone number\nor [log in using Passkey >](passkey)";
1551315515
"PrivacySettings.Passkey" = "Passkey";
@@ -15536,3 +15538,13 @@ Error: %8$@";
1553615538
"Passkeys.PasskeyCreatedAndUsedPattern" = "created %1$@ • used %2$@";
1553715539
"Passkeys.AddPasskey" = "Create Passkey";
1553815540
"Passkeys.ListFooter" = "Your passkeys are stored securely in your password manager.";
15541+
15542+
"Gifts.Demo.Title" = "Unique Collectibles";
15543+
"Gifts.Demo.Description" = "Telegram Gifts are collectible items you can trade or showcase on your profile.";
15544+
"Gifts.Demo.Unique.Title" = "Unique";
15545+
"Gifts.Demo.Unique.Text" = "Upgrade your gifts to get a unique number, model, backdrop and symbol.";
15546+
"Gifts.Demo.Tradable.Title" = "Tradable";
15547+
"Gifts.Demo.Tradable.Text" = "Sell your gift on Telegram or on third-party NFT marketplaces.";
15548+
"Gifts.Demo.Wearable.Title" = "Wearable";
15549+
"Gifts.Demo.Wearable.Text" = "Display gifts on your page and set them as profile covers or statuses.";
15550+
"Gifts.Demo.Understood" = "Understood";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,7 @@ public protocol SharedAccountContext: AnyObject {
12731273
func navigateToChat(accountId: AccountRecordId, peerId: PeerId, messageId: MessageId?)
12741274
func openChatMessage(_ params: OpenChatMessageParams) -> Bool
12751275
func messageFromPreloadedChatHistoryViewForLocation(id: MessageId, location: ChatHistoryLocationInput, context: AccountContext, chatLocation: ChatLocation, subject: ChatControllerSubject?, chatLocationContextHolder: Atomic<ChatLocationContextHolder?>, tag: HistoryViewInputTag?) -> Signal<(MessageIndex?, Bool), NoError>
1276+
12761277
func makeOverlayAudioPlayerController(context: AccountContext, chatLocation: ChatLocation, type: MediaManagerPlayerType, initialMessageId: MessageId, initialOrder: MusicPlaybackSettingsOrder, playlistLocation: SharedMediaPlaylistLocation?, parentNavigationController: NavigationController?) -> ViewController & OverlayAudioPlayerController
12771278
func makePeerInfoController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, peer: Peer, mode: PeerInfoControllerMode, avatarInitiallyExpanded: Bool, fromChat: Bool, requestsContext: PeerInvitationImportersContext?) -> ViewController?
12781279
func makeChannelAdminController(context: AccountContext, peerId: PeerId, adminId: PeerId, initialParticipant: ChannelParticipant) -> ViewController?
@@ -1356,54 +1357,34 @@ public protocol SharedAccountContext: AnyObject {
13561357
func makeInstantPageController(context: AccountContext, message: Message, sourcePeerType: MediaAutoDownloadPeerType?) -> ViewController?
13571358
func makeInstantPageController(context: AccountContext, webPage: TelegramMediaWebpage, anchor: String?, sourceLocation: InstantPageSourceLocation) -> ViewController
13581359
func openChatWallpaper(context: AccountContext, message: Message, present: @escaping (ViewController, Any?) -> Void)
1359-
13601360
func makeRecentSessionsController(context: AccountContext, activeSessionsContext: ActiveSessionsContext) -> ViewController & RecentSessionsController
1361-
13621361
func makeChatQrCodeScreen(context: AccountContext, peer: Peer, threadId: Int64?, temporary: Bool) -> ViewController
1363-
13641362
func makePremiumIntroController(context: AccountContext, source: PremiumIntroSource, forceDark: Bool, dismissed: (() -> Void)?) -> ViewController
13651363
func makePremiumIntroController(sharedContext: SharedAccountContext, engine: TelegramEngineUnauthorized, inAppPurchaseManager: InAppPurchaseManager, source: PremiumIntroSource, proceed: (() -> Void)?) -> ViewController
1366-
13671364
func makePremiumDemoController(context: AccountContext, subject: PremiumDemoSubject, forceDark: Bool, action: @escaping () -> Void, dismissed: (() -> Void)?) -> ViewController
13681365
func makePremiumLimitController(context: AccountContext, subject: PremiumLimitSubject, count: Int32, forceDark: Bool, cancel: @escaping () -> Void, action: @escaping () -> Bool) -> ViewController
1369-
13701366
func makeStarsGiftController(context: AccountContext, birthdays: [EnginePeer.Id: TelegramBirthday]?, completion: @escaping (([EnginePeer.Id]) -> Void)) -> ViewController
13711367
func makePremiumGiftController(context: AccountContext, source: PremiumGiftSource, completion: (([EnginePeer.Id]) -> Signal<Never, TransferStarGiftError>)?) -> ViewController
13721368
func makeGiftOptionsController(context: AccountContext, peerId: EnginePeer.Id, premiumOptions: [CachedPremiumGiftOption], hasBirthday: Bool, completion: (() -> Void)?) -> ViewController
13731369
func makeGiftStoreController(context: AccountContext, peerId: EnginePeer.Id, gift: StarGift.Gift) -> ViewController
13741370
func makePremiumPrivacyControllerController(context: AccountContext, subject: PremiumPrivacySubject, peerId: EnginePeer.Id) -> ViewController
13751371
func makePremiumBoostLevelsController(context: AccountContext, peerId: EnginePeer.Id, subject: BoostSubject, boostStatus: ChannelBoostStatus, myBoostStatus: MyBoostStatus, forceDark: Bool, openStats: (() -> Void)?) -> ViewController
1376-
13771372
func makeStickerPackScreen(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, mainStickerPack: StickerPackReference, stickerPacks: [StickerPackReference], loadedStickerPacks: [LoadedStickerPack], actionTitle: String?, isEditing: Bool, expandIfNeeded: Bool, parentNavigationController: NavigationController?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?, actionPerformed: ((Bool) -> Void)?) -> ViewController
1378-
13791373
func makeCameraScreen(context: AccountContext, mode: CameraScreenMode, cameraHolder: Any?, transitionIn: CameraScreenTransitionIn?, transitionOut: @escaping (Bool) -> CameraScreenTransitionOut?, completion: @escaping (Any, @escaping () -> Void) -> Void, transitionedOut: (() -> Void)?) -> ViewController
1380-
13811374
func makeMediaPickerScreen(context: AccountContext, hasSearch: Bool, completion: @escaping (Any) -> Void) -> ViewController
1382-
13831375
func makeStoryMediaEditorScreen(context: AccountContext, source: Any?, text: String?, link: (url: String, name: String?)?, remainingCount: Int32, completion: @escaping ([MediaEditorScreenResult], MediaEditorTransitionOutExternalState, @escaping (@escaping () -> Void) -> Void) -> Void) -> ViewController
1384-
13851376
func makeBotPreviewEditorScreen(context: AccountContext, source: Any?, target: Stories.PendingTarget, transitionArguments: (UIView, CGRect, UIImage?)?, transitionOut: @escaping () -> BotPreviewEditorTransitionOut?, externalState: MediaEditorTransitionOutExternalState, completion: @escaping (MediaEditorScreenResult, @escaping (@escaping () -> Void) -> Void) -> Void, cancelled: @escaping () -> Void) -> ViewController
1386-
13871377
func makeStickerEditorScreen(context: AccountContext, source: Any?, intro: Bool, transitionArguments: (UIView, CGRect, UIImage?)?, completion: @escaping (TelegramMediaFile, [String], @escaping () -> Void) -> Void, cancelled: @escaping () -> Void) -> ViewController
1388-
13891378
func makeStickerMediaPickerScreen(context: AccountContext, getSourceRect: @escaping () -> CGRect?, completion: @escaping (Any?, UIView?, CGRect, UIImage?, Bool, @escaping (Bool?) -> (UIView, CGRect)?, @escaping () -> Void) -> Void, dismissed: @escaping () -> Void) -> ViewController
1390-
13911379
func makeAvatarMediaPickerScreen(context: AccountContext, getSourceRect: @escaping () -> CGRect?, canDelete: Bool, performDelete: @escaping () -> Void, completion: @escaping (Any?, UIView?, CGRect, UIImage?, Bool, @escaping (Bool?) -> (UIView, CGRect)?, @escaping () -> Void) -> Void, dismissed: @escaping () -> Void) -> ViewController
1392-
13931380
func makeStoryMediaPickerScreen(context: AccountContext, isDark: Bool, forCollage: Bool, selectionLimit: Int?, getSourceRect: @escaping () -> CGRect, completion: @escaping (Any, UIView, CGRect, UIImage?, @escaping (Bool?) -> (UIView, CGRect)?, @escaping () -> Void) -> Void, multipleCompletion: @escaping ([Any], Bool) -> Void, dismissed: @escaping () -> Void, groupsPresented: @escaping () -> Void) -> ViewController
1394-
13951381
func makeStickerPickerScreen(context: AccountContext, inputData: Promise<StickerPickerInput>, completion: @escaping (FileMediaReference) -> Void) -> ViewController
1396-
13971382
func makeProxySettingsController(sharedContext: SharedAccountContext, account: UnauthorizedAccount) -> ViewController
1398-
13991383
func makeDataAndStorageController(context: AccountContext, sensitiveContent: Bool) -> ViewController
1400-
14011384
func makeInstalledStickerPacksController(context: AccountContext, mode: InstalledStickerPacksControllerMode, forceTheme: PresentationTheme?) -> ViewController
1402-
14031385
func makeChannelStatsController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, peerId: EnginePeer.Id, boosts: Bool, boostStatus: ChannelBoostStatus?) -> ViewController
14041386
func makeMessagesStatsController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, messageId: EngineMessage.Id) -> ViewController
14051387
func makeStoryStatsController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, peerId: EnginePeer.Id, storyId: Int32, storyItem: EngineStoryItem, fromStory: Bool) -> ViewController
1406-
14071388
func makeStarsTransactionsScreen(context: AccountContext, starsContext: StarsContext) -> ViewController
14081389
func makeStarsPurchaseScreen(context: AccountContext, starsContext: StarsContext, options: [Any], purpose: StarsPurchasePurpose, targetPeerId: EnginePeer.Id?, customTheme: PresentationTheme?, completion: @escaping (Int64) -> Void) -> ViewController
14091390
func makeStarsTransferScreen(context: AccountContext, starsContext: StarsContext, invoice: TelegramMediaInvoice, source: BotPaymentInvoiceSource, extendedMedia: [TelegramExtendedMedia], inputData: Signal<(StarsContext.State, BotPaymentForm, EnginePeer?, EnginePeer?)?, NoError>, completion: @escaping (Bool) -> Void) -> ViewController
@@ -1431,33 +1412,23 @@ public protocol SharedAccountContext: AnyObject {
14311412
func makeGiftOfferScreen(context: AccountContext, gift: StarGift.UniqueGift, peer: EnginePeer, amount: CurrencyAmount, commit: @escaping () -> Void) -> ViewController
14321413
func makeGiftUpgradeVariantsPreviewScreen(context: AccountContext, gift: StarGift, attributes: [StarGift.UniqueGift.Attribute]) -> ViewController
14331414
func makeGiftAuctionWearPreviewScreen(context: AccountContext, auctionContext: GiftAuctionContext, acquiredGifts: Signal<[GiftAuctionAcquiredGift], NoError>?, attributes: [StarGift.UniqueGift.Attribute], completion: @escaping () -> Void) -> ViewController
1434-
1415+
func makeGiftDemoScreen(context: AccountContext) -> ViewController
14351416
func makeStorySharingScreen(context: AccountContext, subject: StorySharingSubject, parentController: ViewController) -> ViewController
1436-
14371417
func makeContentReportScreen(context: AccountContext, subject: ReportContentSubject, forceDark: Bool, present: @escaping (ViewController) -> Void, completion: @escaping () -> Void, requestSelectMessages: ((String, Data, String?) -> Void)?)
1438-
14391418
func makeShareController(context: AccountContext, subject: ShareControllerSubject, forceExternal: Bool, shareStory: (() -> Void)?, enqueued: (([PeerId], [Int64]) -> Void)?, actionCompleted: (() -> Void)?) -> ViewController
1440-
14411419
func makeMiniAppListScreenInitialData(context: AccountContext) -> Signal<MiniAppListScreenInitialData, NoError>
14421420
func makeMiniAppListScreen(context: AccountContext, initialData: MiniAppListScreenInitialData) -> ViewController
1443-
14441421
func makeIncomingMessagePrivacyScreen(context: AccountContext, value: GlobalPrivacySettings.NonContactChatsPrivacy, exceptions: SelectivePrivacySettings, update: @escaping (GlobalPrivacySettings.NonContactChatsPrivacy) -> Void) -> ViewController
1445-
14461422
func openWebApp(context: AccountContext, parentController: ViewController, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, botPeer: EnginePeer, chatPeer: EnginePeer?, threadId: Int64?, buttonText: String, url: String, simple: Bool, source: ChatOpenWebViewSource, skipTermsOfService: Bool, payload: String?, verifyAgeCompletion: ((Int) -> Void)?)
1447-
14481423
func makeAffiliateProgramSetupScreenInitialData(context: AccountContext, peerId: EnginePeer.Id, mode: AffiliateProgramSetupScreenMode) -> Signal<AffiliateProgramSetupScreenInitialData, NoError>
14491424
func makeAffiliateProgramSetupScreen(context: AccountContext, initialData: AffiliateProgramSetupScreenInitialData) -> ViewController
14501425
func makeAffiliateProgramJoinScreen(context: AccountContext, sourcePeer: EnginePeer, commissionPermille: Int32, programDuration: Int32?, revenuePerUser: Double, mode: JoinAffiliateProgramScreenMode) -> ViewController
1451-
14521426
func makeJoinSubjectScreen(context: AccountContext, mode: JoinSubjectScreenMode) -> ViewController
1453-
14541427
func makeOldChannelsController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, intent: OldChannelsControllerIntent, completed: @escaping (Bool) -> Void) -> ViewController
1455-
14561428
func makeGalleryController(context: AccountContext, source: GalleryControllerItemSource, streamSingleVideo: Bool, isPreview: Bool) -> ViewController
1457-
14581429
func makeAccountFreezeInfoScreen(context: AccountContext) -> ViewController
14591430
func makeSendInviteLinkScreen(context: AccountContext, subject: SendInviteLinkScreenSubject, peers: [TelegramForbiddenInvitePeer], theme: PresentationTheme?) -> ViewController
1460-
1431+
14611432
@available(iOS 13.0, *)
14621433
func makePostSuggestionsSettingsScreen(context: AccountContext, peerId: EnginePeer.Id) async -> ViewController
14631434

submodules/PremiumUI/Sources/PhoneDemoComponent.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,15 @@ protocol PhoneDemoDecorationView: UIView {
354354
func resetAnimation()
355355
}
356356

357-
final class PhoneDemoComponent: Component {
358-
typealias EnvironmentType = DemoPageEnvironment
357+
public final class PhoneDemoComponent: Component {
358+
public typealias EnvironmentType = DemoPageEnvironment
359359

360-
enum Position {
360+
public enum Position {
361361
case top
362362
case bottom
363363
}
364364

365-
enum BackgroundDecoration {
365+
public enum BackgroundDecoration {
366366
case none
367367
case dataRain
368368
case swirlStars
@@ -375,7 +375,7 @@ final class PhoneDemoComponent: Component {
375375
case todo
376376
}
377377

378-
enum Model {
378+
public enum Model {
379379
case notch
380380
case island
381381
}
@@ -419,11 +419,11 @@ final class PhoneDemoComponent: Component {
419419
return true
420420
}
421421

422-
final class View: UIView, ComponentTaggedView {
423-
final class Tag {
422+
public final class View: UIView, ComponentTaggedView {
423+
public final class Tag {
424424
}
425425

426-
func matches(tag: Any) -> Bool {
426+
public func matches(tag: Any) -> Bool {
427427
if let _ = tag as? Tag, self.isCentral {
428428
return true
429429
}

submodules/PremiumUI/Sources/PremiumDemoScreen.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public final class PremiumGradientBackgroundComponent: Component {
155155
}
156156
}
157157

158-
final class DemoPageEnvironment: Equatable {
158+
public final class DemoPageEnvironment: Equatable {
159159
public let isDisplaying: Bool
160160
public let isCentral: Bool
161161
public let position: CGFloat
@@ -1134,13 +1134,13 @@ private final class DemoSheetContent: CombinedComponent {
11341134
let closeButton = closeButton.update(
11351135
component: GlassBarButtonComponent(
11361136
size: CGSize(width: 40.0, height: 40.0),
1137-
backgroundColor: theme.rootController.navigationBar.glassBarButtonBackgroundColor,
1138-
isDark: theme.overallDarkAppearance,
1139-
state: .glass,
1137+
backgroundColor: UIColor(rgb: 0x7f76f4),
1138+
isDark: false,
1139+
state: .tintedGlass,
11401140
component: AnyComponentWithIdentity(id: "close", component: AnyComponent(
11411141
BundleIconComponent(
11421142
name: "Navigation/Close",
1143-
tintColor: theme.rootController.navigationBar.glassBarButtonForegroundColor
1143+
tintColor: .white
11441144
)
11451145
)),
11461146
action: { _ in

submodules/TelegramBaseController/Sources/GiftAuctionAccessoryPanel.swift

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,21 @@ final class GiftAuctionAccessoryPanel: ASDisplayNode {
114114
var buttonAnimatedTitleItems: [AnimatedTextComponent.Item] = []
115115

116116
if self.states.count == 1, let auctionState = self.states.first {
117+
var isUpcoming = false
118+
var startTime = currentTime
119+
var endTime = currentTime
120+
if case let .ongoing(_, startDate, _, _, _, _, nextRoundDate, _, _, _, _, _) = auctionState.auctionState {
121+
startTime = startDate
122+
endTime = nextRoundDate
123+
if currentTime < startDate {
124+
isUpcoming = true
125+
}
126+
}
127+
117128
let place = auctionState.place ?? 1
118-
if case let .generic(gift) = auctionState.gift, let auctionGiftsPerRound = gift.auctionGiftsPerRound, place > auctionGiftsPerRound {
129+
if isUpcoming {
130+
subtitleText = self.strings.ChatList_Auctions_Status_UpcomingBid
131+
} else if case let .generic(gift) = auctionState.gift, let auctionGiftsPerRound = gift.auctionGiftsPerRound, place > auctionGiftsPerRound {
119132
subtitleText = self.strings.ChatList_Auctions_Status_Single_Outbid
120133
subtitleTextColor = self.theme.list.itemDestructiveColor
121134
isOutbid = true
@@ -135,13 +148,6 @@ final class GiftAuctionAccessoryPanel: ASDisplayNode {
135148
subtitleText = self.strings.ChatList_Auctions_Status_Single_Winning(placeText).string
136149
}
137150

138-
var startTime = currentTime
139-
var endTime = currentTime
140-
if case let .ongoing(_, startDate, _, _, _, _, nextRoundDate, _, _, _, _, _) = auctionState.auctionState {
141-
startTime = startDate
142-
endTime = nextRoundDate
143-
}
144-
145151
let endTimeout: Int32
146152
if currentTime < startTime {
147153
endTimeout = max(0, startTime - currentTime)

submodules/TelegramUI/BUILD

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

0 commit comments

Comments
 (0)