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 Apr 23, 2024
2 parents b13397c + 3b719ed commit c5165b0
Show file tree
Hide file tree
Showing 376 changed files with 22,504 additions and 11,121 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "tlogo_24.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.

This file was deleted.

Binary file not shown.
6 changes: 3 additions & 3 deletions Telegram/Telegram-iOS/Icons.xcassets/Shortcuts/Contents.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}
}
130 changes: 130 additions & 0 deletions Telegram/Telegram-iOS/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -11896,6 +11896,7 @@ Sorry for the inconvenience.";
"BusinessLink.ErrorExpired" = "Link Expired";

"WebApp.AlertBiometryAccessText" = "Do you want to allow %@ to use Face ID?";
"WebApp.AlertBiometryAccessTouchIDText" = "Do you want to allow %@ to use Touch ID?";

"StoryList.SubtitleArchived_1" = "1 archived post";
"StoryList.SubtitleArchived_any" = "%d archived posts";
Expand Down Expand Up @@ -12052,3 +12053,132 @@ Sorry for the inconvenience.";

"Premium.Gift.ContactSelection.SendMessage" = "Send Message";
"Premium.Gift.ContactSelection.OpenProfile" = "Open Profile";

"Login.EnterWordTitle" = "Enter Word";
"Login.EnterWordText" = "We've sent you an SMS with a secret word to your phone **%@**.";
"Login.EnterWordBeginningText" = "We've sent you an SMS with a secret word that starts with **\"%1$@\"** to your phone **%2$@**.";
"Login.EnterWordPlaceholder" = "Enter Word from SMS";

"Login.EnterPhraseTitle" = "Enter Phrase";
"Login.EnterPhraseText" = "We've sent you an SMS with a secret phrase to your phone **%@**.";
"Login.EnterPhraseBeginningText" = "We've sent you an SMS with a secret phrase that starts with **\"%1$@\"** to your phone **%2$@**.";
"Login.EnterPhrasePlaceholder" = "Enter Phrase from SMS";

"Login.EnterPhraseHint" = "You can copy and paste the phrase here.";
"Login.BackToWord" = "Back to entering the word";
"Login.BackToPhrase" = "Back to entering the phrase";
"Login.BackToCode" = "Back to entering the code";

"Login.WrongPhraseError" = "Incorrect, please try again.";
"Login.Paste" = "Paste";

"Login.ReturnToWord" = "Return to entering the word";
"Login.ReturnToPhrase" = "Return to entering the phrase";
"Login.ReturnToCode" = "Return to entering the code";

"Map.LiveLocationPrivateNewDescription" = "Choose for how long **%@** will see your accurate location, including when the app is closed.";
"Map.LiveLocationGroupNewDescription" = "Choose for how long people in this chat will see your accurate location, including when the app is closed.";

"Map.LiveLocationExtendDescription" = "For how long do you want to extend sharing your location?";

"Map.LiveLocationForMinutes_1" = "For %@ minute";
"Map.LiveLocationForMinutes_any" = "For %@ minutes";

"Map.LiveLocationForHours_1" = "For %@ hour";
"Map.LiveLocationForHours_any" = "For %@ hours";

"Map.LiveLocationIndefinite" = "Until I turn it off";

"Map.TapToAddTime" = "tap to add time";
"Map.SharingLocation" = "Sharing Location...";

"Channel.AdminLog.Settings" = "Settings";

"ChannelProfile.AboutActionCopy" = "Copy";
"ChannelProfile.ToastAboutCopied" = "Copied to clipboard.";

"Conversation.ContextMenuBanFull" = "Ban";

"Channel.AdminLog.MessageManyDeleted" = "%1$@ deleted %2$@ from %3$@";
"Channel.AdminLog.MessageManyDeletedMore" = "%1$@ deleted %2$@ from %3$@ %4$@";
"Channel.AdminLog.MessageManyDeleted.Messages_1" = "%@ message";
"Channel.AdminLog.MessageManyDeleted.Messages_any" = "%@ messages";
"Channel.AdminLog.MessageManyDeleted.ShowAll" = "show all";
"Channel.AdminLog.MessageManyDeleted.HideAll" = "hide all";

"Shortcut.AppIcon" = "Edit App Icon";

"ReportPeer.BanAndReport" = "Ban and Report";

"ReportPeer.ReportReaction.Text" = "Are you sure you want to report reactions from this user?";
"ReportPeer.ReportReaction.BanAndReport" = "Ban and Report";
"ReportPeer.ReportReaction.Report" = "Report Reaction";

"StoryFeed.ViewAnonymously" = "View Anonymously";

"Channel.AdminLogFilter.EventsAdminRights" = "New Admin Rights";
"Channel.AdminLogFilter.EventsExceptions" = "New Exceptions";
"Channel.AdminLogFilter.EventsLeavingGroup" = "Members Left the Group";
"Channel.AdminLogFilter.EventsLeavingChannel" = "Subscribers Removed";

"Channel.AdminLogFilter.RecentActionsTitle" = "Recent Actions";
"Channel.AdminLogFilter.FilterActionsTypeTitle" = "FILTER ACTIONS BY TYPE";
"Channel.AdminLogFilter.FilterActionsAdminsTitle" = "FILTER ACTIONS BY ADMINS";
"Channel.AdminLogFilter.ShowAllAdminsActions" = "Show Actions by All Admins";
"Channel.AdminLogFilter.ApplyFilter" = "Apply Filter";

"Channel.AdminLogFilter.Section.MembersGroup" = "Members and Admins";
"Channel.AdminLogFilter.Section.MembersChannel" = "Subscribers and Admins";
"Channel.AdminLogFilter.Section.SettingsGroup" = "Group Settings";
"Channel.AdminLogFilter.Section.SettingsChannel" = "Channel Settings";
"Channel.AdminLogFilter.Section.Messages" = "Messages";

"Premium.Gift.ContactSelection.AddBirthday" = "Add Your Birthday";

"Story.StealthMode.EnableAndOpenAction" = "Enable and Open the Story";

"Channel.AdminLog.ShowMoreMessages_1" = "Show %@ More Message";
"Channel.AdminLog.ShowMoreMessages_any" = "Show %@ More Messages";

"CreatePoll.OptionCountFooterFormat_1" = "You can add {count} more option.";
"CreatePoll.OptionCountFooterFormat_any" = "You can add {count} more options.";

"Chat.AdminActionSheet.DeleteTitle_1" = "Delete 1 Message";
"Chat.AdminActionSheet.DeleteTitle_any" = "Delete %d Messages";
"Chat.AdminActionSheet.ReportSpam" = "Report Spam";
"Chat.AdminActionSheet.DeleteAllSingle" = "Delete All from %@";
"Chat.AdminActionSheet.DeleteAllMultiple" = "Delete All from Users";
"Chat.AdminActionSheet.BanSingle" = "Ban %@";
"Chat.AdminActionSheet.BanMultiple" = "Ban Users";
"Chat.AdminActionSheet.RestrictSingle" = "Ban %@";
"Chat.AdminActionSheet.RestrictMultiple" = "Ban Users";
"Chat.AdminActionSheet.RestrictSectionHeader" = "ADDITIONAL ACTIONS";
"Chat.AdminActionSheet.BanFooterSingle" = "Fully ban this user";
"Chat.AdminActionSheet.RestrictFooterSingle" = "Partially restrict this user";
"Chat.AdminActionSheet.BanFooterMultiple" = "Fully ban users";
"Chat.AdminActionSheet.RestrictFooterMultiple" = "Partially restrict users";
"Chat.AdminActionSheet.PermissionsSectionHeader" = "WHAT CAN THIS USER DO?";
"Chat.AdminActionSheet.ActionButton" = "Proceed";

"Chat.AdminAction.ToastMessagesDeletedTitleSingle" = "Message Deleted";
"Chat.AdminAction.ToastMessagesDeletedTitleMultiple" = "Messages Deleted";
"Chat.AdminAction.ToastMessagesDeletedTextSingle" = "Message Deleted.";
"Chat.AdminAction.ToastMessagesDeletedTextMultiple" = "Messages Deleted.";
"Chat.AdminAction.ToastReportedSpamText_1" = "**1** user reported for spam.";
"Chat.AdminAction.ToastReportedSpamText_any" = "**%d** users reported for spam.";
"Chat.AdminAction.ToastBannedText_1" = "**1** user banned.";
"Chat.AdminAction.ToastBannedText_any" = "**%d** users banned.";
"Chat.AdminAction.ToastRestrictedText_1" = "**1** user restricted.";
"Chat.AdminAction.ToastRestrictedText_any" = "**%d** users restricted.";

"Chat.MessageForwardInfo.StoryHeader" = "Forwarded story from";
"Chat.MessageForwardInfo.ExpiredStoryHeader" = "Expired story from";
"Chat.MessageForwardInfo.UnavailableStoryHeader" = "Expired story from";
"Chat.MessageForwardInfo.MessageHeader" = "Forwarded from";

"Chat.NavigationNoTopics" = "You have no unread topics";

"Chat.NextSuggestedChannelSwipeProgress" = "Swipe up to go to the next channel";
"Chat.NextSuggestedChannelSwipeAction" = "Release to go to the next channel";
"Chat.NextUnreadTopicSwipeProgress" = "Swipe up to go to the next topic";
"Chat.NextUnreadTopicSwipeAction" = "Release to go to the next topic";
6 changes: 4 additions & 2 deletions submodules/AccountContext/Sources/AccountContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,16 @@ public struct ChatAvailableMessageActionOptions: OptionSet {
public struct ChatAvailableMessageActions {
public var options: ChatAvailableMessageActionOptions
public var banAuthor: Peer?
public var banAuthors: [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, setTag: Bool, editTags: Set<MessageReaction.Reaction>) {
public init(options: ChatAvailableMessageActionOptions, banAuthor: Peer?, banAuthors: [Peer], disableDelete: Bool, isCopyProtected: Bool, setTag: Bool, editTags: Set<MessageReaction.Reaction>) {
self.options = options
self.banAuthor = banAuthor
self.banAuthors = banAuthors
self.disableDelete = disableDelete
self.isCopyProtected = isCopyProtected
self.setTag = setTag
Expand Down Expand Up @@ -1010,7 +1012,7 @@ public protocol SharedAccountContext: AnyObject {
func makeChatQrCodeScreen(context: AccountContext, peer: Peer, threadId: Int64?, temporary: Bool) -> ViewController

func makePremiumIntroController(context: AccountContext, source: PremiumIntroSource, forceDark: Bool, dismissed: (() -> Void)?) -> ViewController
func makePremiumDemoController(context: AccountContext, subject: PremiumDemoSubject, action: @escaping () -> Void) -> ViewController
func makePremiumDemoController(context: AccountContext, subject: PremiumDemoSubject, forceDark: Bool, action: @escaping () -> Void, dismissed: (() -> Void)?) -> ViewController
func makePremiumLimitController(context: AccountContext, subject: PremiumLimitSubject, count: Int32, forceDark: Bool, cancel: @escaping () -> Void, action: @escaping () -> Bool) -> ViewController
func makePremiumGiftController(context: AccountContext, source: PremiumGiftSource, completion: (() -> Void)?) -> ViewController
func makePremiumPrivacyControllerController(context: AccountContext, subject: PremiumPrivacySubject, peerId: EnginePeer.Id) -> ViewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public final class ContactMultiselectionControllerParams {
public let context: AccountContext
public let updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?
public let mode: ContactMultiselectionControllerMode
public let options: [ContactListAdditionalOption]
public let options: Signal<[ContactListAdditionalOption], NoError>
public let filters: [ContactListFilter]
public let onlyWriteable: Bool
public let isGroupInvitation: Bool
Expand All @@ -105,7 +105,7 @@ public final class ContactMultiselectionControllerParams {
public let openProfile: ((EnginePeer) -> Void)?
public let sendMessage: ((EnginePeer) -> Void)?

public init(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil, mode: ContactMultiselectionControllerMode, options: [ContactListAdditionalOption], filters: [ContactListFilter] = [.excludeSelf], onlyWriteable: Bool = false, isGroupInvitation: Bool = false, isPeerEnabled: ((EnginePeer) -> Bool)? = nil, attemptDisabledItemSelection: ((EnginePeer, ChatListDisabledPeerReason) -> Void)? = nil, alwaysEnabled: Bool = false, limit: Int32? = nil, reachedLimit: ((Int32) -> Void)? = nil, openProfile: ((EnginePeer) -> Void)? = nil, sendMessage: ((EnginePeer) -> Void)? = nil) {
public init(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil, mode: ContactMultiselectionControllerMode, options: Signal<[ContactListAdditionalOption], NoError> = .single([]), filters: [ContactListFilter] = [.excludeSelf], onlyWriteable: Bool = false, isGroupInvitation: Bool = false, isPeerEnabled: ((EnginePeer) -> Bool)? = nil, attemptDisabledItemSelection: ((EnginePeer, ChatListDisabledPeerReason) -> Void)? = nil, alwaysEnabled: Bool = false, limit: Int32? = nil, reachedLimit: ((Int32) -> Void)? = nil, openProfile: ((EnginePeer) -> Void)? = nil, sendMessage: ((EnginePeer) -> Void)? = nil) {
self.context = context
self.updatedPresentationData = updatedPresentationData
self.mode = mode
Expand Down
2 changes: 2 additions & 0 deletions submodules/AccountContext/Sources/Premium.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public enum PremiumIntroSource {
case readTime
case messageTags
case folderTags
case animatedEmoji
}

public enum PremiumGiftSource: Equatable {
Expand Down Expand Up @@ -72,6 +73,7 @@ public enum PremiumDemoSubject {
case lastSeen
case messagePrivacy
case folderTags
case business

case businessLocation
case businessHours
Expand Down
7 changes: 7 additions & 0 deletions submodules/AttachmentUI/Sources/AttachmentContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate {

var isPanningUpdated: (Bool) -> Void = { _ in }
var isExpandedUpdated: (Bool) -> Void = { _ in }
var isPanGestureEnabled: (() -> Bool)?
var onExpandAnimationCompleted: () -> Void = {}

override init() {
Expand Down Expand Up @@ -132,6 +133,12 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate {
if case .regular = layout.metrics.widthClass {
return false
}

if let isPanGestureEnabled = self.isPanGestureEnabled {
if !isPanGestureEnabled() {
return false
}
}
}
return true
}
Expand Down
45 changes: 45 additions & 0 deletions submodules/AttachmentUI/Sources/AttachmentController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ public enum AttachmentButtonType: Equatable {
public protocol AttachmentContainable: ViewController {
var requestAttachmentMenuExpansion: () -> Void { get set }
var updateNavigationStack: (@escaping ([AttachmentContainable]) -> ([AttachmentContainable], AttachmentMediaPickerContext?)) -> Void { get set }
var parentController: () -> ViewController? { get set }
var updateTabBarAlpha: (CGFloat, ContainedViewLayoutTransition) -> Void { get set }
var updateTabBarVisibility: (Bool, ContainedViewLayoutTransition) -> Void { get set }
var cancelPanGesture: () -> Void { get set }
var isContainerPanning: () -> Bool { get set }
var isContainerExpanded: () -> Bool { get set }
var isPanGestureEnabled: (() -> Bool)? { get }
var mediaPickerContext: AttachmentMediaPickerContext? { get }

func isContainerPanningUpdated(_ panning: Bool)
Expand Down Expand Up @@ -124,6 +127,10 @@ public extension AttachmentContainable {
func shouldDismissImmediately() -> Bool {
return true
}

var isPanGestureEnabled: (() -> Bool)? {
return nil
}
}

public enum AttachmentMediaPickerSendMode {
Expand Down Expand Up @@ -351,6 +358,17 @@ public class AttachmentController: ViewController {
}
}

self.container.isPanGestureEnabled = { [weak self] in
guard let self, let currentController = self.currentControllers.last else {
return true
}
if let isPanGestureEnabled = currentController.isPanGestureEnabled {
return isPanGestureEnabled()
} else {
return true
}
}

self.container.shouldCancelPanGesture = { [weak self] in
if let strongSelf = self, let currentController = strongSelf.currentControllers.last {
if !currentController.shouldDismissImmediately() {
Expand Down Expand Up @@ -543,11 +561,23 @@ public class AttachmentController: ViewController {
}
}
}
controller.parentController = { [weak self] in
guard let self else {
return nil
}
return self.controller
}
controller.updateTabBarAlpha = { [weak self, weak controller] alpha, transition in
if let strongSelf = self, strongSelf.currentControllers.contains(where: { $0 === controller }) {
strongSelf.panel.updateBackgroundAlpha(alpha, transition: transition)
}
}
controller.updateTabBarVisibility = { [weak self, weak controller] isVisible, transition in
if let strongSelf = self, strongSelf.currentControllers.contains(where: { $0 === controller }) {
strongSelf.updateIsPanelVisible(isVisible, transition: transition)
}
}

controller.cancelPanGesture = { [weak self] in
if let strongSelf = self {
strongSelf.container.cancelPanGesture()
Expand Down Expand Up @@ -731,6 +761,18 @@ public class AttachmentController: ViewController {

private var hasButton = false

private var isPanelVisible: Bool = true

private func updateIsPanelVisible(_ isVisible: Bool, transition: ContainedViewLayoutTransition) {
if self.isPanelVisible == isVisible {
return
}
self.isPanelVisible = isVisible
if let layout = self.validLayout {
self.containerLayoutUpdated(layout, transition: transition)
}
}

func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
self.validLayout = layout

Expand Down Expand Up @@ -820,6 +862,9 @@ public class AttachmentController: ViewController {
if let controller = self.controller, controller.buttons.count > 1 || controller.hasTextInput {
hasPanel = true
}
if !self.isPanelVisible {
hasPanel = false
}

let isEffecitvelyCollapsedUpdated = (self.selectionCount > 0) != (self.panel.isSelecting)
var panelHeight = self.panel.update(layout: containerLayout, buttons: self.controller?.buttons ?? [], isSelecting: self.selectionCount > 0, elevateProgress: !hasPanel && !hasButton, transition: transition)
Expand Down
Loading

0 comments on commit c5165b0

Please sign in to comment.