Skip to content

Commit

Permalink
1.5.5 (222)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Feb 5, 2024
1 parent 67319f1 commit 8995a34
Show file tree
Hide file tree
Showing 283 changed files with 10,498 additions and 2,582 deletions.
77 changes: 73 additions & 4 deletions Telegram/Telegram-iOS/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -10860,6 +10860,7 @@ Sorry for the inconvenience.";
"Chat.PanelStatusAuthorHidden" = "Senders of these messages restricted to link\ntheir name when forwarding.";
"Chat.SavedMessagesChatsTooltip" = "Tap to view your Saved Messages organized by type or source";

"Chat.ConfirmationDeleteFromSavedMessages" = "Delete from Saved Messages";
"Chat.ConfirmationRemoveFromSavedMessages" = "Remove from Saved Messages";

"Premium.MaxSavedPinsText" = "Sorry, you can't pin more than **%1$@** chats to the top. Unpin some that are currently pinned or subscribe to **Telegram Premium** to double the limit to **%2$@** chats.";
Expand Down Expand Up @@ -10934,7 +10935,7 @@ Sorry for the inconvenience.";

"Chat.ContextMenuTagsTitle" = "Tag the message with an emoji for quick access later";

"Chat.ReactionContextMenu.FilterByTag" = "Fiter by Tag";
"Chat.ReactionContextMenu.FilterByTag" = "Filter by Tag";
"Chat.ReactionContextMenu.RemoveTag" = "Remove Tag";

"Chat.EmptyStateMessagingRestrictedToPremium.Text" = "Subscribe to **Premium**\nto message **%@**.";
Expand All @@ -10949,9 +10950,6 @@ Sorry for the inconvenience.";

"Chat.SearchTagsPlaceholder" = "Search messages or tags";

"Chat.TagSearchShowMessages" = "Show Other Messages";
"Chat.TagSearchHideMessages" = "Hide Other Messages";

"PrivacyInfo.UpgradeToPremium.Title" = "Upgrade to Premium";
"PrivacyInfo.UpgradeToPremium.ButtonTitle" = "Subscribe to Telegram Premium";

Expand All @@ -10966,9 +10964,80 @@ Sorry for the inconvenience.";
"PrivacyInfo.ShowReadTime.PremiumInfo" = "Subscription will let you see **%@'s** read time without showing yours.";
"PrivacyInfo.ShowReadTime.AlwaysToast.Text" = "Set **Last Seen** privacy to 'Nobody' or 'My Contacts.'";

"Chat.ToastMessageTagged.Text" = "Message tagged with %@";
"Chat.ToastMessagesTagged.Text" = "Messages tagged with %@";
"Chat.ToastMessageTagged.Action" = "View";

"Chat.PrivateMessageSeenTimestamp.Date" = "read %@";
"Chat.PrivateMessageSeenTimestamp.TodayAt" = "read today at %@";
"Chat.PrivateMessageSeenTimestamp.YesterdayAt" = "read yesterday at %@";

"Settings.Privacy.ReadTimePremiumActive" = "Subcribed to Telegram Premium";
"Settings.Privacy.ReadTimePremiumActiveFooter" = "Because you are a Telegram Premium subscriber, you will see the last seen and read time of all users who are sharing it with you – even if you are hiding yours.";

"Privacy.VoiceMessages.NonPremiumHelp" = "Subscribe to Telegram Premium to restrict who can send you voice or video messages.\n\n[What is Telegram Premium?]()";

"ChatList.DeleteSavedPeerMyNotesConfirmation" = "Are you sure you want to delete all messages from %@?";
"ChatList.DeleteSavedPeerMyNotesConfirmationTitle" = "My Notes";

"Conversation.ForwardOptions.SenderNamesRemoved" = "Sender names removed";

"Login.Announce.Info" = "Notify people on Telegram who know my phone number that I signed up.";
"Login.Announce.Notify" = "Notify";
"Login.Announce.DontNotify" = "Do Not Notify";

"Premium.Stories.Quality.Title" = "Higher Quality";
"Premium.Stories.Quality.Text" = "View video stories in double the resolution.";

"Premium.MessageTags" = "Tags for Messages";
"Premium.MessageTagsInfo" = "Organize your Saved Messages with tags for quicker access.";
"Premium.MessageTags.Proceed" = "About Telegram Premium";

"Chat.SavedMessagesTabInfoText" = "Messages you send to **Saved Messages**";

"VoiceOver.MessageSelectionButtonTag" = "Tag";

"Chat.ReactionSelectionTitleAddTag" = "Tag a message with emojis for quick search";
"Chat.ReactionSelectionTitleEditTag" = "Edit tags of selected messages";
"Chat.ForwardToSavedMessageTagSelectionTitle" = "You can add a tag to the message";
"Chat.ForwardToSavedMessagesTagSelectionTitle" = "You can add a tag to messages";

"Chat.EditTagTitle.Placeholder" = "Name";
"Chat.EditTagTitle.TitleSet" = "Set Name";
"Chat.EditTagTitle.TitleEdit" = "Edit Name";
"Chat.EditTagTitle.Text" = "You can label your emoji tag with a text name.";

"Chat.SavedMessagesModeMenu.ViewAsChats" = "View as Chats";
"Chat.SavedMessagesModeMenu.ViewAsMessages" = "View as Messages";

"Story.ContextMenuHD" = "Increase Quality";
"Story.ContextMenuSD" = "Decrease Quality";
"Story.ToastQualitySD.Title" = "Quality Lowered";
"Story.ToastQualitySD.Text" = "Stories will now download faster.";
"Story.ToastQualityHD.Title" = "Quality Increased";
"Story.ToastQualityHD.Text" = "You can lower the quality later for faster downloads.";

"Story.UpgradeQuality.Title" = "High-Quality Stories";
"Story.UpgradeQuality.Text" = "Subscribe to premium to view stories in higher resolution.";
"Story.UpgradeQuality.Action" = "Increase Quality";
"Story.UpgradeQuality.ActionSubtitle" = "Premium Required";

"Chat.MessageContextMenu.NonPremiumTagsTitle" = "Organize your Saved Messages with tags for quicker access. [Learn more...]()";

"Chat.TooltipAddTagLabel" = "Tap and hold to add a name to your tag";

"Chat.MessageContextMenu.Remove" = "Remove";

"Chat.TagsHeaderPanel.Unlock" = "Unlock";
"Chat.TagsHeaderPanel.AddTags" = "Add tags";
"Chat.TagsHeaderPanel.AddTagsSuffix" = "to your Saved Messages";
"Chat.ReactionContextMenu.SetTagLabel" = "Set Name";
"Chat.ReactionContextMenu.EditTagLabel" = "Edit Name";

"Chat.BottomSearchPanel.MessageCountFormat" = "%1$@ %2$@";
"Chat.BottomSearchPanel.MessageCount_1" = "message";
"Chat.BottomSearchPanel.MessageCount_any" = "messages";

"Chat.BottomSearchPanel.DisplayModeFormat" = "Show as %@";
"Chat.BottomSearchPanel.DisplayModeChat" = "Chat";
"Chat.BottomSearchPanel.DisplayModeList" = "List";
4 changes: 3 additions & 1 deletion build-system/GenerateStrings/GenerateStrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ def generate(header_path: str, implementation_path: str, data_path: str, entries

if entry.is_pluralized:
argument_format_type = ''
if entry.positional_arguments[0].kind == 'd':
if len(entry.positional_arguments) == 0:
argument_format_type = '1'
elif entry.positional_arguments[0].kind == 'd':
argument_format_type = '0'
elif entry.positional_arguments[0].kind == '@':
argument_format_type = '1'
Expand Down
19 changes: 16 additions & 3 deletions submodules/AccountContext/Sources/AccountContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,16 @@ public struct ChatAvailableMessageActions {
public var banAuthor: Peer?
public var disableDelete: Bool
public var isCopyProtected: Bool
public var setTag: Bool
public var editTags: Set<MessageReaction.Reaction>

public init(options: ChatAvailableMessageActionOptions, banAuthor: Peer?, disableDelete: Bool, isCopyProtected: Bool) {
public init(options: ChatAvailableMessageActionOptions, banAuthor: Peer?, disableDelete: Bool, isCopyProtected: Bool, setTag: Bool, editTags: Set<MessageReaction.Reaction>) {
self.options = options
self.banAuthor = banAuthor
self.disableDelete = disableDelete
self.isCopyProtected = isCopyProtected
self.setTag = setTag
self.editTags = editTags
}
}

Expand Down Expand Up @@ -356,6 +360,7 @@ public enum ChatSearchDomain: Equatable {
case everything
case members
case member(Peer)
case tag(MessageReaction.Reaction)

public static func ==(lhs: ChatSearchDomain, rhs: ChatSearchDomain) -> Bool {
switch lhs {
Expand All @@ -377,6 +382,12 @@ public enum ChatSearchDomain: Equatable {
} else {
return false
}
case let .tag(reaction):
if case .tag(reaction) = rhs {
return true
} else {
return false
}
}
}
}
Expand Down Expand Up @@ -476,8 +487,9 @@ public final class NavigateToChatControllerParams {
public let completion: (ChatController) -> Void
public let chatListCompletion: ((ChatListController) -> Void)?
public let pushController: ((ChatController, Bool, @escaping () -> Void) -> Void)?
public let forceOpenChat: Bool

public init(navigationController: NavigationController, chatController: ChatController? = nil, context: AccountContext, chatLocation: Location, chatLocationContextHolder: Atomic<ChatLocationContextHolder?> = Atomic<ChatLocationContextHolder?>(value: nil), subject: ChatControllerSubject? = nil, botStart: ChatControllerInitialBotStart? = nil, attachBotStart: ChatControllerInitialAttachBotStart? = nil, botAppStart: ChatControllerInitialBotAppStart? = nil, updateTextInputState: ChatTextInputState? = nil, activateInput: ChatControllerActivateInput? = nil, keepStack: NavigateToChatKeepStack = .default, useExisting: Bool = true, useBackAnimation: Bool = false, purposefulAction: (() -> Void)? = nil, scrollToEndIfExists: Bool = false, activateMessageSearch: (ChatSearchDomain, String)? = nil, peekData: ChatPeekTimeout? = nil, peerNearbyData: ChatPeerNearbyData? = nil, reportReason: ReportReason? = nil, animated: Bool = true, options: NavigationAnimationOptions = [], parentGroupId: PeerGroupId? = nil, chatListFilter: Int32? = nil, chatNavigationStack: [ChatNavigationStackItem] = [], changeColors: Bool = false, setupController: @escaping (ChatController) -> Void = { _ in }, pushController: ((ChatController, Bool, @escaping () -> Void) -> Void)? = nil, completion: @escaping (ChatController) -> Void = { _ in }, chatListCompletion: @escaping (ChatListController) -> Void = { _ in }) {
public init(navigationController: NavigationController, chatController: ChatController? = nil, context: AccountContext, chatLocation: Location, chatLocationContextHolder: Atomic<ChatLocationContextHolder?> = Atomic<ChatLocationContextHolder?>(value: nil), subject: ChatControllerSubject? = nil, botStart: ChatControllerInitialBotStart? = nil, attachBotStart: ChatControllerInitialAttachBotStart? = nil, botAppStart: ChatControllerInitialBotAppStart? = nil, updateTextInputState: ChatTextInputState? = nil, activateInput: ChatControllerActivateInput? = nil, keepStack: NavigateToChatKeepStack = .default, useExisting: Bool = true, useBackAnimation: Bool = false, purposefulAction: (() -> Void)? = nil, scrollToEndIfExists: Bool = false, activateMessageSearch: (ChatSearchDomain, String)? = nil, peekData: ChatPeekTimeout? = nil, peerNearbyData: ChatPeerNearbyData? = nil, reportReason: ReportReason? = nil, animated: Bool = true, options: NavigationAnimationOptions = [], parentGroupId: PeerGroupId? = nil, chatListFilter: Int32? = nil, chatNavigationStack: [ChatNavigationStackItem] = [], changeColors: Bool = false, setupController: @escaping (ChatController) -> Void = { _ in }, pushController: ((ChatController, Bool, @escaping () -> Void) -> Void)? = nil, completion: @escaping (ChatController) -> Void = { _ in }, chatListCompletion: @escaping (ChatListController) -> Void = { _ in }, forceOpenChat: Bool = false) {
self.navigationController = navigationController
self.chatController = chatController
self.chatLocationContextHolder = chatLocationContextHolder
Expand Down Expand Up @@ -508,6 +520,7 @@ public final class NavigateToChatControllerParams {
self.pushController = pushController
self.completion = completion
self.chatListCompletion = chatListCompletion
self.forceOpenChat = forceOpenChat
}
}

Expand Down Expand Up @@ -930,7 +943,7 @@ public protocol SharedAccountContext: AnyObject {
func openStorageUsage(context: AccountContext)
func openLocationScreen(context: AccountContext, messageId: MessageId, navigationController: NavigationController)
func openExternalUrl(context: AccountContext, urlContext: OpenURLContext, url: String, forceExternal: Bool, presentationData: PresentationData, navigationController: NavigationController?, dismissInput: @escaping () -> Void)
func chatAvailableMessageActions(engine: TelegramEngine, accountPeerId: EnginePeer.Id, messageIds: Set<EngineMessage.Id>) -> Signal<ChatAvailableMessageActions, NoError>
func chatAvailableMessageActions(engine: TelegramEngine, accountPeerId: EnginePeer.Id, messageIds: Set<EngineMessage.Id>, keepUpdated: Bool) -> Signal<ChatAvailableMessageActions, NoError>
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>
Expand Down
41 changes: 40 additions & 1 deletion submodules/AccountContext/Sources/ChatController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
public let currentlyPlayingMessageId: EngineMessage.Index?
public let isCopyProtectionEnabled: Bool
public let availableReactions: AvailableReactions?
public let savedMessageTags: SavedMessageTags?
public let defaultReaction: MessageReaction.Reaction?
public let isPremium: Bool
public let forceInlineReactions: Bool
Expand All @@ -55,6 +56,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
public let chatThemes: [TelegramTheme]
public let deviceContactsNumbers: Set<String>
public let isStandalone: Bool
public let isInline: Bool

public init(
automaticDownloadPeerType: MediaAutoDownloadPeerType,
Expand All @@ -70,6 +72,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
currentlyPlayingMessageId: EngineMessage.Index? = nil,
isCopyProtectionEnabled: Bool = false,
availableReactions: AvailableReactions?,
savedMessageTags: SavedMessageTags?,
defaultReaction: MessageReaction.Reaction?,
isPremium: Bool,
accountPeer: EnginePeer?,
Expand All @@ -83,7 +86,8 @@ public final class ChatMessageItemAssociatedData: Equatable {
audioTranscriptionTrial: AudioTranscription.TrialState = .defaultValue,
chatThemes: [TelegramTheme] = [],
deviceContactsNumbers: Set<String> = Set(),
isStandalone: Bool = false
isStandalone: Bool = false,
isInline: Bool = false
) {
self.automaticDownloadPeerType = automaticDownloadPeerType
self.automaticDownloadPeerId = automaticDownloadPeerId
Expand All @@ -98,6 +102,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
self.currentlyPlayingMessageId = currentlyPlayingMessageId
self.isCopyProtectionEnabled = isCopyProtectionEnabled
self.availableReactions = availableReactions
self.savedMessageTags = savedMessageTags
self.defaultReaction = defaultReaction
self.isPremium = isPremium
self.accountPeer = accountPeer
Expand All @@ -112,6 +117,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
self.chatThemes = chatThemes
self.deviceContactsNumbers = deviceContactsNumbers
self.isStandalone = isStandalone
self.isInline = isInline
}

public static func == (lhs: ChatMessageItemAssociatedData, rhs: ChatMessageItemAssociatedData) -> Bool {
Expand Down Expand Up @@ -154,6 +160,9 @@ public final class ChatMessageItemAssociatedData: Equatable {
if lhs.availableReactions != rhs.availableReactions {
return false
}
if lhs.savedMessageTags != rhs.savedMessageTags {
return false
}
if lhs.isPremium != rhs.isPremium {
return false
}
Expand Down Expand Up @@ -193,6 +202,9 @@ public final class ChatMessageItemAssociatedData: Equatable {
if lhs.isStandalone != rhs.isStandalone {
return false
}
if lhs.isInline != rhs.isInline {
return false
}
return true
}
}
Expand Down Expand Up @@ -911,16 +923,43 @@ public extension Peer {
}
}

public struct ChatControllerCustomNavigationPanelNodeLayoutResult {
public var backgroundHeight: CGFloat
public var insetHeight: CGFloat
public var hitTestSlop: CGFloat

public init(backgroundHeight: CGFloat, insetHeight: CGFloat, hitTestSlop: CGFloat) {
self.backgroundHeight = backgroundHeight
self.insetHeight = insetHeight
self.hitTestSlop = hitTestSlop
}
}

public protocol ChatControllerCustomNavigationPanelNode: ASDisplayNode {
typealias LayoutResult = ChatControllerCustomNavigationPanelNodeLayoutResult

func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition, chatController: ChatController) -> LayoutResult
}

public protocol ChatController: ViewController {
var chatLocation: ChatLocation { get }
var canReadHistory: ValuePromise<Bool> { get }
var parentController: ViewController? { get set }

var purposefulAction: (() -> Void)? { get set }

var stateUpdated: ((ContainedViewLayoutTransition) -> Void)? { get set }

var selectedMessageIds: Set<EngineMessage.Id>? { get }
var presentationInterfaceStateSignal: Signal<Any, NoError> { get }

var customNavigationBarContentNode: NavigationBarContentNode? { get }
var customNavigationPanelNode: ChatControllerCustomNavigationPanelNode? { get }

var visibleContextController: ViewController? { get }

var alwaysShowSearchResultsAsList: Bool { get set }

func updatePresentationMode(_ mode: ChatControllerPresentationMode)
func beginMessageSearch(_ query: String)
func displayPromoAnnouncement(text: String)
Expand Down
3 changes: 3 additions & 0 deletions submodules/AccountContext/Sources/OpenChatMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public final class OpenChatMessageParams {
public let context: AccountContext
public let updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?
public let chatLocation: ChatLocation?
public let chatFilterTag: MemoryBuffer?
public let chatLocationContextHolder: Atomic<ChatLocationContextHolder?>?
public let message: Message
public let standalone: Bool
Expand Down Expand Up @@ -51,6 +52,7 @@ public final class OpenChatMessageParams {
context: AccountContext,
updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil,
chatLocation: ChatLocation?,
chatFilterTag: MemoryBuffer?,
chatLocationContextHolder: Atomic<ChatLocationContextHolder?>?,
message: Message,
standalone: Bool,
Expand Down Expand Up @@ -79,6 +81,7 @@ public final class OpenChatMessageParams {
self.context = context
self.updatedPresentationData = updatedPresentationData
self.chatLocation = chatLocation
self.chatFilterTag = chatFilterTag
self.chatLocationContextHolder = chatLocationContextHolder
self.message = message
self.standalone = standalone
Expand Down
3 changes: 3 additions & 0 deletions submodules/AccountContext/Sources/Premium.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ public enum PremiumIntroSource {
case storiesFormatting
case storiesExpirationDurations
case storiesSuggestedReactions
case storiesHigherQuality
case channelBoost(EnginePeer.Id)
case nameColor
case similarChannels
case wallpapers
case presence
case readTime
case messageTags
}

public enum PremiumGiftSource: Equatable {
Expand Down Expand Up @@ -65,6 +67,7 @@ public enum PremiumDemoSubject {
case stories
case colors
case wallpapers
case messageTags
}

public enum PremiumLimitSubject {
Expand Down

0 comments on commit 8995a34

Please sign in to comment.