Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac committed Oct 29, 2024
2 parents df96d16 + 2adccff commit d7fadef
Show file tree
Hide file tree
Showing 312 changed files with 20,379 additions and 4,444 deletions.
128 changes: 126 additions & 2 deletions Telegram/Telegram-iOS/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -11127,6 +11127,9 @@ Sorry for the inconvenience.";
"Chat.BottomSearchPanel.MessageCount_1" = "message";
"Chat.BottomSearchPanel.MessageCount_any" = "messages";

"Chat.BottomSearchPanel.StoryCount_1" = "story";
"Chat.BottomSearchPanel.StoryCount_any" = "stories";

"Chat.BottomSearchPanel.DisplayModeFormat" = "Show as %@";
"Chat.BottomSearchPanel.DisplayModeChat" = "Chat";
"Chat.BottomSearchPanel.DisplayModeList" = "List";
Expand Down Expand Up @@ -11750,9 +11753,11 @@ Sorry for the inconvenience.";
"Monetization.TransactionInfo.ViewInExplorer" = "View in Blockchain Explorer";

"Monetization.Intro.Title" = "Earn From Your Channel";
"Monetization.Intro.Bot.Title" = "Earn From Your Bot";

"Monetization.Intro.Ads.Title" = "Telegram Ads";
"Monetization.Intro.Ads.Text" = "Telegram can display ads in your channel.";
"Monetization.Intro.Bot.Ads.Text" = "Telegram can display ads in your bot.";

"Monetization.Intro.Split.Title" = "50:50 Revenue Split";
"Monetization.Intro.Split.Text" = "You receive 50% of the ad revenue in TON.";
Expand All @@ -11776,13 +11781,18 @@ Sorry for the inconvenience.";
"AdsInfo.Info" = "Telegram Ads are very different from ads on other platforms. Ads such as this one:";
"AdsInfo.Respect.Title" = "Respect Your Privacy";
"AdsInfo.Respect.Text" = "Ads on Telegram do not use your personal information and are based on the channel in which you see them.";
"AdsInfo.Bot.Respect.Text" = "Ads on Telegram do not use your personal information and are based on the bot in which you see them.";
"AdsInfo.Split.Title" = "Help the Channel Creator";
"AdsInfo.Split.Text" = "50% of the revenue from Telegram Ads goes to the owner of the channel where they are displayed.";
"AdsInfo.Bot.Split.Title" = "Help the Bot Creator";
"AdsInfo.Bot.Split.Text" = "50% of the revenue from Telegram Ads goes to the owner of the bot where they are displayed.";
"AdsInfo.Ads.Title" = "Can Be Removed";
"AdsInfo.Ads.Text" = "You can turn off ads by subscribing to [Telegram Premium](), and Level %@ channels can remove them for their subscribers.";
"AdsInfo.Bot.Ads.Text" = "You can turn off ads by subscribing to [Telegram Premium]().";

"AdsInfo.Launch.Title" = "Can I Launch an Ad?";
"AdsInfo.Launch.Text" = "Anyone can create ads to display in this channel – with minimal budgets. Check out the Telegram Ad Platform for details. [Learn More >]()";
"AdsInfo.Bot.Launch.Text" = "Anyone can create ads to display in this bot – with minimal budgets. Check out the Telegram Ad Platform for details. [Learn More >]()";
"AdsInfo.Launch.Text_URL" = "https://promote.telegram.org";

"AdsInfo.Understood" = "Understood";
Expand Down Expand Up @@ -12393,6 +12403,16 @@ Sorry for the inconvenience.";
"HashtagSearch.StoriesFound_any" = "%@ Stories Found";
"HashtagSearch.StoriesFoundInfo" = "View stories with %@";

"HashtagSearch.Stories_1" = "%@ Story";
"HashtagSearch.Stories_any" = "%@ Stories";
"HashtagSearch.LocalStoriesFound" = "%1$@ in %2$@";

"HashtagSearch.Posts_1" = "%@ Message";
"HashtagSearch.Posts_any" = "%@ Messages";
"HashtagSearch.FoundInfoFormat" = "View %1$@ with %2$@";
"HashtagSearch.FoundStories" = "stories";
"HashtagSearch.FoundPosts" = "posts";

"Stars.BotRevenue.Title" = "Stars Balance";
"Stars.BotRevenue.Revenue.Title" = "Stars Received";
"Stars.BotRevenue.Proceeds.Title" = "Rewards Overview";
Expand Down Expand Up @@ -12963,6 +12983,7 @@ Sorry for the inconvenience.";

"Gift.View.Title" = "Gift";
"Gift.View.ReceivedTitle" = "Received Gift";
"Gift.View.UnavailableTitle" = "Unavailable";
"Gift.View.KeepOrConvertDescription" = "You can keep this gift in your Profile or convert it to %@. [More About Stars >]()";
"Gift.View.KeepOrConvertDescription.Stars_1" = "%@ Star";
"Gift.View.KeepOrConvertDescription.Stars_any" = "%@ Stars";
Expand All @@ -12972,20 +12993,42 @@ Sorry for the inconvenience.";
"Gift.View.OtherDescription" = "%1$@ can keep this gift in their Profile or convert it to %2$@. [More About Stars >]()";
"Gift.View.OtherDescription.Stars_1" = "%@ Star";
"Gift.View.OtherDescription.Stars_any" = "%@ Stars";
"Gift.View.UnavailableDescription" = "This gift has sold out";
"Gift.View.From" = "From";
"Gift.View.HiddenName" = "Hidden Name";
"Gift.View.Send" = "send a gift";
"Gift.View.Date" = "Date";
"Gift.View.FirstSale" = "First Sale";
"Gift.View.LastSale" = "Last Sale";
"Gift.View.Value" = "Value";
"Gift.View.Sale" = "sell for %@";
"Gift.View.Sale.Stars_1" = "%@ Star";
"Gift.View.Sale.Stars_any" = "%@ Stars";
"Gift.View.Availability" = "Availability";
"Gift.View.Availability.Of" = "%1$@ of %2$@";
"Gift.View.Availability.NewOf" = "%1$@ of %2$@ left";
"Gift.View.Visibility" = "Visibility";
"Gift.View.Visibility.Visible" = "Visible on your page";
"Gift.View.Visibility.Hide" = "hide";
"Gift.View.Hide" = "Hide from My Page";
"Gift.View.Display" = "Display on My Page";
"Gift.View.Convert" = "Convert to %@";
"Gift.View.Convert.Stars_1" = "%@ Star";
"Gift.View.Convert.Stars_any" = "%@ Stars";

"Gift.View.NameHidden" = "Only you can see the senders's name.";
"Gift.View.NameAndMessageHidden" = "Only you can see the senders's name and message.";

"Gift.View.DisplayedInfo" = "The gift is visible on your Page. [View >]()";
"Gift.View.HiddenInfo" = "This gift is hidden. Only you can see it.";

"Gift.Displayed.Title" = "Gift Saved to Profile";
"Gift.Displayed.Text" = "The gift is now displayed in [your profile]().";
"Gift.Displayed.NewText" = "The gift is now shown on your Page.";
"Gift.Displayed.View" = "View";
"Gift.Hidden.Title" = "Gift Removed from Profile";
"Gift.Hidden.Text" = "The gift is no longer displayed in [your profile]().";
"Gift.Hidden.NewText" = "The gift is removed from your Page.";
"Gift.Convert.Title" = "Convert Gift to Stars";
"Gift.Convert.Text" = "Do you want to convert this gift from **%1$@** to **%2$@**?\n\nThis will permanently destroy the gift.";
"Gift.Convert.Stars_1" = "%@ Star";
Expand All @@ -13007,8 +13050,8 @@ Sorry for the inconvenience.";
"Gift.Options.Gift.Text" = "Give **%@** gifts that can be kept on the profile or converted to Stars. [What are Stars >]()";
"Gift.Options.Gift.Filter.AllGifts" = "All Gifts";
"Gift.Options.Gift.Filter.Limited" = "Limited";
"Gift.Options.Gift.Limited" = "Limited";
"Gift.Options.Gift.SoldOut" = "Sold Out";
"Gift.Options.Gift.Limited" = "limited";
"Gift.Options.Gift.SoldOut" = "sold out";
"Gift.Options.SoldOut.Text" = "Sorry, this gift is sold out.";

"PeerInfo.PaneGifts" = "Gifts";
Expand Down Expand Up @@ -13077,3 +13120,84 @@ Sorry for the inconvenience.";

"WebBrowser.AuthChallenge.Title" = "Sign in to %@";
"WebBrowser.AuthChallenge.Text" = "Your login information will be sent securely.";


"ChatList.Search.FilterPublicPosts" = "Public Posts";
"DialogList.SearchSectionPublicPosts" = "Public Posts";

"Chat.PrivateMessageEditTimestamp.Date" = "edited %@";
"Chat.PrivateMessageEditTimestamp.TodayAt" = "edited today at %@";
"Chat.PrivateMessageEditTimestamp.YesterdayAt" = "edited yesterday at %@";

"Stars.Transaction.Gift.Title" = "Gift";

"ChatList.Search.Open" = "OPEN";
"ChatList.Search.ShowMore" = "Show More";

"AttachmentMenu.AddPhotoOrVideo" = "Add Photo or Video";
"AttachmentMenu.AddDocument" = "Add Document";

"Chat.BotAd.Title" = "Ad";
"Chat.BotAd.WhatIsThis" = "what's this?";

"ChatList.Search.TopAppsInfo" = "Which apps are included here? [Learn >]()";

"TopApps.Info.Title" = "Top Mini Apps";
"TopApps.Info.Text" = "This catalogue ranks mini apps based on their daily revenue, measured in Stars. To be listed, developers must set their main mini app in [@botfather]() (as described [here](https://core.telegram.org/bots/webapps#launching-the-main-mini-app)), have over **1,000** daily users, and earn a daily revenue above **1,000** Stars, based on weekly average.";
"TopApps.Info.Done" = "Understood";

"Stars.Intro.Transaction.TelegramBotApi.Title" = "Paid Broadcast";
"Stars.Intro.Transaction.TelegramBotApi.Messages_1" = "%@ Message";
"Stars.Intro.Transaction.TelegramBotApi.Messages_any" = "%@ Messages";

"Stars.Transaction.TelegramBotApi.Title" = "Paid Broadcast";
"Stars.Transaction.TelegramBotApi.Messages_1" = "%@ Message";
"Stars.Transaction.TelegramBotApi.Messages_any" = "%@ Messages";

"Monetization.Bot.Header" = "Telegram shares 50% of the revenue from ads displayed in your bot. [Learn More >]()";
"Monetization.Bot.BalanceTitle" = "AVAILABLE BALANCE";

"Resolve.ChannelErrorNotFound" = "Sorry, this channel doesn't seem to exist.";

"Stats.TonBotRevenue.Title" = "TON Balance";

"PeerInfo.BotBalance.Title" = "BALANCE";
"PeerInfo.BotBalance.Ton" = "Ton";
"PeerInfo.BotBalance.Stars" = "Stars";

"Gallery.ToastVideoSpeedSwipe" = "Swipe sideways to adjust speed.";
"Gallery.VideoSettings.QualitySectionTitle" = "QUALITY";
"Gallery.VideoSettings.SpeedSectionTitle" = "PLAYBACK SPEED";
"Gallery.VideoSettings.SpeedControlTitle" = "Speed";

"Gallery.VideoSettings.QualityAuto" = "Auto";
"Gallery.VideoSettings.QualityLow" = "Low";
"Gallery.VideoSettings.QualityMedium" = "Medium";
"Gallery.VideoSettings.QualityHD" = "High";
"Gallery.VideoSettings.QualityFHD" = "Full HD";
"Gallery.VideoSettings.QualityQHD" = "Ultra-High";

"Gallery.VideoSettings.IconQualityLow" = "L";
"Gallery.VideoSettings.IconQualityMedium" = "SD";
"Gallery.VideoSettings.IconQualityHD" = "HD";
"Gallery.VideoSettings.IconQualityFHD" = "FHD";
"Gallery.VideoSettings.IconQualityQHD" = "QHD";

"Gallery.MenuSaveToGallery" = "Save to Gallery";
"Gallery.SaveToGallery.Quality" = "Save in %@p";
"Gallery.SaveToGallery.Original" = "Save Original";

"VideoChat.ScheduleButtonTitle" = "Schedule Video Chat";

"Chat.ToastImprovingVideo.Title" = "Improving video...";
"Chat.ToastImprovingVideo.Text" = "The video will be published after it's optimized for the best viewing experience.";
"Chat.ToastVideoPublished.Title" = "Video Published";
"Chat.ToastVideoPublished.Action" = "View";
"Chat.MessageTooltipVideoProcessing" = "Processing video may take a few minutes.";

"Chat.VideoProcessingServiceMessage_1" = "This video will be published once converted and optimized";
"Chat.VideoProcessingServiceMessage_any" = "These videos will be published once converted and optimized";

"Chat.ScheduledForceSendProcessingVideo.Title" = "Wait!";
"Chat.ScheduledForceSendProcessingVideo.Text" = "This video hasn't been converted and optimized yet. If you send it now, the viewers of the video may experience slow download speed.";
"Chat.ScheduledForceSendProcessingVideo.Action" = "Send Anyway";
3 changes: 1 addition & 2 deletions build-system/Make/Make.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def __init__(self, bazel, override_bazel_version, override_xcode_version, bazel_
# 1. resolves issues with the linker caused by the swift-objc mixing.
# 2. makes the resulting binaries significantly smaller (up to 9% for this project).
#'--swiftcopt=-num-threads', '--swiftcopt=1',
'--swiftcopt=-j1',
'--features=swift._num_threads_0_in_swiftcopts',
'--swiftcopt=-num-threads', '--swiftcopt=1',

# Strip unsused code.
'--features=dead_strip',
Expand Down
2 changes: 1 addition & 1 deletion build-system/bazel-rules/rules_swift
Submodule rules_swift updated 179 files
9 changes: 6 additions & 3 deletions submodules/AccountContext/Sources/AccountContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ public enum ChatListSearchFilter: Equatable {
case voice
case peer(PeerId, Bool, String, String)
case date(Int32?, Int32, String)
case publicPosts

public var id: Int64 {
switch self {
Expand All @@ -664,6 +665,8 @@ public enum ChatListSearchFilter: Equatable {
return 8
case .voice:
return 9
case .publicPosts:
return 10
case let .peer(peerId, _, _, _):
return peerId.id._internalGetInt64Value()
case let .date(_, date, _):
Expand Down Expand Up @@ -810,7 +813,7 @@ public enum CollectibleItemInfoScreenSubject {


public enum StorySearchControllerScope {
case query(String)
case query(EnginePeer?, String)
case location(coordinates: MediaArea.Coordinates, venue: MediaArea.Venue)
}

Expand Down Expand Up @@ -938,7 +941,7 @@ public protocol SharedAccountContext: AnyObject {
func makeStorageManagementController(context: AccountContext) -> ViewController
func makeAttachmentFileController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, bannedSendMedia: (Int32, Bool)?, presentGallery: @escaping () -> Void, presentFiles: @escaping () -> Void, send: @escaping (AnyMediaReference) -> Void) -> AttachmentFileController
func makeGalleryCaptionPanelView(context: AccountContext, chatLocation: ChatLocation, isScheduledMessages: Bool, isFile: Bool, customEmojiAvailable: Bool, present: @escaping (ViewController) -> Void, presentInGlobalOverlay: @escaping (ViewController) -> Void) -> NSObject?
func makeHashtagSearchController(context: AccountContext, peer: EnginePeer?, query: String, all: Bool) -> ViewController
func makeHashtagSearchController(context: AccountContext, peer: EnginePeer?, query: String, stories: Bool, forceDark: Bool) -> ViewController
func makeStorySearchController(context: AccountContext, scope: StorySearchControllerScope, listContext: SearchStoryListContext?) -> ViewController
func makeMyStoriesController(context: AccountContext, isArchive: Bool) -> ViewController
func makeArchiveSettingsController(context: AccountContext) -> ViewController
Expand Down Expand Up @@ -971,7 +974,7 @@ public protocol SharedAccountContext: AnyObject {
func chatAvailableMessageActions(engine: TelegramEngine, accountPeerId: EnginePeer.Id, messageIds: Set<EngineMessage.Id>, messages: [EngineMessage.Id: EngineMessage], peers: [EnginePeer.Id: EnginePeer]) -> Signal<ChatAvailableMessageActions, NoError>
func resolveUrl(context: AccountContext, peerId: PeerId?, url: String, skipUrlAuth: Bool) -> Signal<ResolvedUrl, NoError>
func resolveUrlWithProgress(context: AccountContext, peerId: PeerId?, url: String, skipUrlAuth: Bool) -> Signal<ResolveUrlResult, NoError>
func openResolvedUrl(_ resolvedUrl: ResolvedUrl, context: AccountContext, urlContext: OpenURLContext, navigationController: NavigationController?, forceExternal: Bool, openPeer: @escaping (EnginePeer, ChatControllerInteractionNavigateToPeer) -> Void, sendFile: ((FileMediaReference) -> Void)?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?, sendEmoji: ((String, ChatTextInputTextCustomEmojiAttribute) -> Void)?, requestMessageActionUrlAuth: ((MessageActionUrlSubject) -> Void)?, joinVoiceChat: ((PeerId, String?, CachedChannelData.ActiveCall) -> Void)?, present: @escaping (ViewController, Any?) -> Void, dismissInput: @escaping () -> Void, contentContext: Any?, progress: Promise<Bool>?, completion: (() -> Void)?)
func openResolvedUrl(_ resolvedUrl: ResolvedUrl, context: AccountContext, urlContext: OpenURLContext, navigationController: NavigationController?, forceExternal: Bool, forceUpdate: Bool, openPeer: @escaping (EnginePeer, ChatControllerInteractionNavigateToPeer) -> Void, sendFile: ((FileMediaReference) -> Void)?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?, sendEmoji: ((String, ChatTextInputTextCustomEmojiAttribute) -> Void)?, requestMessageActionUrlAuth: ((MessageActionUrlSubject) -> Void)?, joinVoiceChat: ((PeerId, String?, CachedChannelData.ActiveCall) -> Void)?, present: @escaping (ViewController, Any?) -> Void, dismissInput: @escaping () -> Void, contentContext: Any?, progress: Promise<Bool>?, completion: (() -> Void)?)
func openAddContact(context: AccountContext, firstName: String, lastName: String, phoneNumber: String, label: String, present: @escaping (ViewController, Any?) -> Void, pushController: @escaping (ViewController) -> Void, completed: @escaping () -> Void)
func openAddPersonContact(context: AccountContext, peerId: PeerId, pushController: @escaping (ViewController) -> Void, present: @escaping (ViewController, Any?) -> Void)
func presentContactsWarningSuppression(context: AccountContext, present: (ViewController, Any?) -> Void)
Expand Down
22 changes: 10 additions & 12 deletions submodules/AccountContext/Sources/ChatController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public final class ChatMessageItemAssociatedData: Equatable {
public let isStandalone: Bool
public let isInline: Bool
public let showSensitiveContent: Bool
public let starGifts: [Int64: TelegramMediaFile]

public init(
automaticDownloadPeerType: MediaAutoDownloadPeerType,
Expand Down Expand Up @@ -97,8 +96,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
deviceContactsNumbers: Set<String> = Set(),
isStandalone: Bool = false,
isInline: Bool = false,
showSensitiveContent: Bool = false,
starGifts: [Int64: TelegramMediaFile] = [:]
showSensitiveContent: Bool = false
) {
self.automaticDownloadPeerType = automaticDownloadPeerType
self.automaticDownloadPeerId = automaticDownloadPeerId
Expand Down Expand Up @@ -132,7 +130,6 @@ public final class ChatMessageItemAssociatedData: Equatable {
self.isStandalone = isStandalone
self.isInline = isInline
self.showSensitiveContent = showSensitiveContent
self.starGifts = starGifts
}

public static func == (lhs: ChatMessageItemAssociatedData, rhs: ChatMessageItemAssociatedData) -> Bool {
Expand Down Expand Up @@ -226,9 +223,6 @@ public final class ChatMessageItemAssociatedData: Equatable {
if lhs.showSensitiveContent != rhs.showSensitiveContent {
return false
}
if lhs.starGifts != rhs.starGifts {
return false
}
return true
}
}
Expand Down Expand Up @@ -870,7 +864,7 @@ public struct ChatInputQueryCommandsResult: Equatable {

public enum ChatPresentationInputQueryResult: Equatable {
case stickers([FoundStickerItem])
case hashtags([String])
case hashtags([String], String)
case mentions([EnginePeer])
case commands(ChatInputQueryCommandsResult)
case emojis([(String, TelegramMediaFile?, String)], NSRange)
Expand All @@ -884,9 +878,9 @@ public enum ChatPresentationInputQueryResult: Equatable {
} else {
return false
}
case let .hashtags(lhsResults):
if case let .hashtags(rhsResults) = rhs {
return lhsResults == rhsResults
case let .hashtags(lhsResults, lhsQuery):
if case let .hashtags(rhsResults, rhsQuery) = rhs {
return lhsResults == rhsResults && lhsQuery == rhsQuery
} else {
return false
}
Expand Down Expand Up @@ -1031,14 +1025,18 @@ public protocol ChatController: ViewController {

var visibleContextController: ViewController? { get }

var contentContainerNode: ASDisplayNode { get }

var searching: ValuePromise<Bool> { get }
var searchResultsCount: ValuePromise<Int32> { get }
var externalSearchResultsCount: Int32? { get set }

var alwaysShowSearchResultsAsList: Bool { get set }
var includeSavedPeersInSearchResults: Bool { get set }
var showListEmptyResults: Bool { get set }
func beginMessageSearch(_ query: String)

func updatePresentationMode(_ mode: ChatControllerPresentationMode)
func beginMessageSearch(_ query: String)
func displayPromoAnnouncement(text: String)

func updatePushedTransition(_ fraction: CGFloat, transition: ContainedViewLayoutTransition)
Expand Down
2 changes: 1 addition & 1 deletion submodules/AccountContext/Sources/IsMediaStreamable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public func isMediaStreamable(message: Message, media: TelegramMediaFile) -> Boo
}
for attribute in media.attributes {
if case let .Video(_, _, flags, _, _, _) = attribute {
if flags.contains(.supportsStreaming) {
if flags.contains(.supportsStreaming) || !media.alternativeRepresentations.isEmpty {
return true
}
break
Expand Down
Loading

0 comments on commit d7fadef

Please sign in to comment.