From 26e15ebe406b98fd1f6195b050ba3b0be84f2670 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 15 Feb 2024 08:56:55 -0400 Subject: [PATCH] Various fixes --- submodules/AttachmentUI/Sources/AttachmentPanel.swift | 1 + .../Sources/ChatPanelInterfaceInteraction.swift | 4 ++++ .../Sources/ChatRecentActionsController.swift | 1 + .../PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift | 1 + .../Sources/PeerSelectionControllerNode.swift | 1 + submodules/TelegramUI/Sources/ChatController.swift | 4 ++++ .../Sources/ChatRecordingPreviewInputPanelNode.swift | 6 ++++-- 7 files changed, 16 insertions(+), 2 deletions(-) diff --git a/submodules/AttachmentUI/Sources/AttachmentPanel.swift b/submodules/AttachmentUI/Sources/AttachmentPanel.swift index 7bbc49b32c..77938c59f7 100644 --- a/submodules/AttachmentUI/Sources/AttachmentPanel.swift +++ b/submodules/AttachmentUI/Sources/AttachmentPanel.swift @@ -983,6 +983,7 @@ final class AttachmentPanel: ASDisplayNode, UIScrollViewDelegate { }, openPremiumGift: { }, openPremiumRequiredForMessaging: { }, openBoostToUnrestrict: { + }, updateVideoTrimRange: { _, _, _, _ in }, updateHistoryFilter: { _ in }, updateDisplayHistoryFilterAsList: { _ in }, requestLayout: { _ in diff --git a/submodules/ChatPresentationInterfaceState/Sources/ChatPanelInterfaceInteraction.swift b/submodules/ChatPresentationInterfaceState/Sources/ChatPanelInterfaceInteraction.swift index efdb69cdfb..02ad1afa74 100644 --- a/submodules/ChatPresentationInterfaceState/Sources/ChatPanelInterfaceInteraction.swift +++ b/submodules/ChatPresentationInterfaceState/Sources/ChatPanelInterfaceInteraction.swift @@ -176,6 +176,7 @@ public final class ChatPanelInterfaceInteraction { public let updateHistoryFilter: ((ChatPresentationInterfaceState.HistoryFilter?) -> ChatPresentationInterfaceState.HistoryFilter?) -> Void public let updateDisplayHistoryFilterAsList: (Bool) -> Void public let openBoostToUnrestrict: () -> Void + public let updateVideoTrimRange: (Double, Double, Bool, Bool) -> Void public let requestLayout: (ContainedViewLayoutTransition) -> Void public let chatController: () -> ViewController? public let statuses: ChatPanelInterfaceInteractionStatuses? @@ -286,6 +287,7 @@ public final class ChatPanelInterfaceInteraction { openPremiumGift: @escaping () -> Void, openPremiumRequiredForMessaging: @escaping () -> Void, openBoostToUnrestrict: @escaping () -> Void, + updateVideoTrimRange: @escaping (Double, Double, Bool, Bool) -> Void, updateHistoryFilter: @escaping ((ChatPresentationInterfaceState.HistoryFilter?) -> ChatPresentationInterfaceState.HistoryFilter?) -> Void, updateDisplayHistoryFilterAsList: @escaping (Bool) -> Void, requestLayout: @escaping (ContainedViewLayoutTransition) -> Void, @@ -397,6 +399,7 @@ public final class ChatPanelInterfaceInteraction { self.openPremiumGift = openPremiumGift self.openPremiumRequiredForMessaging = openPremiumRequiredForMessaging self.openBoostToUnrestrict = openBoostToUnrestrict + self.updateVideoTrimRange = updateVideoTrimRange self.updateHistoryFilter = updateHistoryFilter self.updateDisplayHistoryFilterAsList = updateDisplayHistoryFilterAsList self.requestLayout = requestLayout @@ -516,6 +519,7 @@ public final class ChatPanelInterfaceInteraction { }, openPremiumGift: { }, openPremiumRequiredForMessaging: { }, openBoostToUnrestrict: { + }, updateVideoTrimRange: { _, _, _, _ in }, updateHistoryFilter: { _ in }, updateDisplayHistoryFilterAsList: { _ in }, requestLayout: { _ in diff --git a/submodules/TelegramUI/Components/Chat/ChatRecentActionsController/Sources/ChatRecentActionsController.swift b/submodules/TelegramUI/Components/Chat/ChatRecentActionsController/Sources/ChatRecentActionsController.swift index 5ddd2090b0..76bab24066 100644 --- a/submodules/TelegramUI/Components/Chat/ChatRecentActionsController/Sources/ChatRecentActionsController.swift +++ b/submodules/TelegramUI/Components/Chat/ChatRecentActionsController/Sources/ChatRecentActionsController.swift @@ -169,6 +169,7 @@ public final class ChatRecentActionsController: TelegramBaseController { }, openPremiumGift: { }, openPremiumRequiredForMessaging: { }, openBoostToUnrestrict: { + }, updateVideoTrimRange: { _, _, _, _ in }, updateHistoryFilter: { _ in }, updateDisplayHistoryFilterAsList: { _ in }, requestLayout: { _ in diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 4a7aa3cf5d..b25119e8fa 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -419,6 +419,7 @@ final class PeerInfoSelectionPanelNode: ASDisplayNode { }, openPremiumGift: { }, openPremiumRequiredForMessaging: { }, openBoostToUnrestrict: { + }, updateVideoTrimRange: { _, _, _, _ in }, updateHistoryFilter: { _ in }, updateDisplayHistoryFilterAsList: { _ in }, requestLayout: { _ in diff --git a/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift b/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift index 6cb9794bee..a062fe259d 100644 --- a/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift +++ b/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift @@ -733,6 +733,7 @@ final class PeerSelectionControllerNode: ASDisplayNode { }, openPremiumGift: { }, openPremiumRequiredForMessaging: { }, openBoostToUnrestrict: { + }, updateVideoTrimRange: { _, _, _, _ in }, updateHistoryFilter: { _ in }, updateDisplayHistoryFilterAsList: { _ in }, requestLayout: { _ in diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 6ea3fb7ff7..8bb7463ceb 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -11096,6 +11096,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G ) self.push(boostController) }) + }, updateVideoTrimRange: { [weak self] start, end, updatedEnd, apply in + if let videoRecorder = self?.videoRecorderValue { + videoRecorder.updateTrimRange(start: start, end: end, updatedEnd: updatedEnd, apply: apply) + } }, updateHistoryFilter: { [weak self] update in guard let self else { return diff --git a/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift index 3789f17201..6f11af4fe4 100644 --- a/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift @@ -328,8 +328,10 @@ final class ChatRecordingPreviewInputPanelNode: ChatInputPanelNode { ) ], positionUpdated: { _, _ in }, - trackTrimUpdated: { _, start, end, updatedEnd, apply in -// video.control.updateTrimRange(start, end, updatedEnd, apply) + trackTrimUpdated: { [weak self] _, start, end, updatedEnd, apply in + if let self { + self.interfaceInteraction?.updateVideoTrimRange(start, end, updatedEnd, apply) + } }, trackOffsetUpdated: { _, _, _ in }, trackLongPressed: { _, _ in }