Skip to content

Commit 894e0e4

Browse files
author
Isaac
committed
Various improvements
1 parent 3c077c2 commit 894e0e4

File tree

18 files changed

+310
-245
lines changed

18 files changed

+310
-245
lines changed

submodules/ChatListUI/Sources/ChatListFilterTabContainerNode.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ private final class ItemNode: ASDisplayNode {
298298
self.shortTitleActiveNode.visibility = title.enableAnimations
299299

300300
if themeUpdated || titleUpdated {
301-
//TODO:release
302301
self.titleNode.attributedText = title.attributedString(font: Font.medium(14.0), textColor: presentationData.theme.list.itemSecondaryTextColor)
303302
self.titleActiveNode.attributedText = title.attributedString(font: Font.medium(14.0), textColor: presentationData.theme.list.itemAccentColor)
304303

submodules/TelegramCallsUI/Sources/VideoChatParticipantsComponent.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ final class VideoChatParticipantsComponent: Component {
637637

638638
private var ignoreScrolling: Bool = false
639639

640-
//TODO:release
641640
private var gridParticipants: [VideoParticipant] = []
642641
private var listParticipants: [GroupCallParticipantsContext.Participant] = []
643642

submodules/TelegramCallsUI/Sources/VideoChatScreen.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2420,7 +2420,6 @@ final class VideoChatScreenComponent: Component {
24202420
}
24212421
videoButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
24222422
} else {
2423-
//TODO:release
24242423
videoButtonContent = .video(isActive: false)
24252424
}
24262425
let _ = self.videoButton.update(

submodules/TelegramCallsUI/Sources/VideoChatScreenMoreMenu.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ extension VideoChatScreenComponent.View {
285285
}
286286

287287
//let isScheduled = strongSelf.isScheduled
288-
//TODO:release
289288
let isScheduled: Bool = !"".isEmpty
290289

291290
let canSpeak: Bool

submodules/TelegramUI/Components/BatchVideoRendering/Sources/BatchVideoRenderingContext.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public final class BatchVideoRenderingContext {
9090

9191
private final class TargetContext {
9292
weak var target: Target?
93-
let file: TelegramMediaFile
93+
let file: FileMediaReference
9494
let userLocation: MediaResourceUserLocation
9595

9696
var readingContext: QueueLocalObject<ReadingContext>?
@@ -100,7 +100,7 @@ public final class BatchVideoRenderingContext {
100100

101101
init(
102102
target: Target,
103-
file: TelegramMediaFile,
103+
file: FileMediaReference,
104104
userLocation: MediaResourceUserLocation
105105
) {
106106
self.target = target
@@ -128,7 +128,7 @@ public final class BatchVideoRenderingContext {
128128
self.context = context
129129
}
130130

131-
public func add(target: Target, file: TelegramMediaFile, userLocation: MediaResourceUserLocation) -> TargetHandle {
131+
public func add(target: Target, file: FileMediaReference, userLocation: MediaResourceUserLocation) -> TargetHandle {
132132
let id = self.nextId
133133
self.nextId += 1
134134

@@ -158,11 +158,11 @@ public final class BatchVideoRenderingContext {
158158
mediaBox: self.context.account.postbox.mediaBox,
159159
userLocation: targetContext.userLocation,
160160
userContentType: .sticker,
161-
reference: .media(media: .standalone(media: targetContext.file), resource: targetContext.file.resource)
161+
reference: targetContext.file.resourceReference(targetContext.file.media.resource)
162162
).startStrict()
163163
}
164164
if targetContext.dataDisposable == nil {
165-
targetContext.dataDisposable = (self.context.account.postbox.mediaBox.resourceData(targetContext.file.resource)
165+
targetContext.dataDisposable = (self.context.account.postbox.mediaBox.resourceData(targetContext.file.media.resource)
166166
|> deliverOnMainQueue).startStrict(next: { [weak self, weak targetContext] data in
167167
guard let self, let targetContext else {
168168
return

submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ swift_library(
4040
"//submodules/TelegramUI/Components/EntityKeyboardGifContent:EntityKeyboardGifContent",
4141
"//submodules/TelegramUI/Components/LegacyMessageInputPanelInputView:LegacyMessageInputPanelInputView",
4242
"//submodules/AttachmentTextInputPanelNode",
43+
"//submodules/TelegramUI/Components/BatchVideoRendering",
4344
],
4445
visibility = [
4546
"//visibility:public",

submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,6 +1912,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
19121912
interaction: interaction,
19131913
inputNodeInteraction: inputNodeInteraction,
19141914
mode: mappedMode,
1915+
batchVideoRenderingContext: nil,
19151916
trendingGifsPromise: trendingGifsPromise,
19161917
cancel: {
19171918
},

submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/GifPaneSearchContentNode.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ import ChatControllerInteraction
1212
import MultiplexedVideoNode
1313
import ChatPresentationInterfaceState
1414
import EntityKeyboardGifContent
15+
import BatchVideoRendering
1516

1617
final class GifPaneSearchContentNode: ASDisplayNode & PaneSearchContentNode {
1718
private let context: AccountContext
1819
private let interaction: ChatEntityKeyboardInputNode.Interaction
1920
private let inputNodeInteraction: ChatMediaInputNodeInteraction
2021

22+
private let batchVideoRenderingContext: BatchVideoRenderingContext
23+
2124
private var theme: PresentationTheme
2225
private var strings: PresentationStrings
2326

@@ -45,10 +48,11 @@ final class GifPaneSearchContentNode: ASDisplayNode & PaneSearchContentNode {
4548

4649
private var hasInitialText = false
4750

48-
init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, interaction: ChatEntityKeyboardInputNode.Interaction, inputNodeInteraction: ChatMediaInputNodeInteraction, trendingPromise: Promise<ChatMediaInputGifPaneTrendingState?>) {
51+
init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, interaction: ChatEntityKeyboardInputNode.Interaction, inputNodeInteraction: ChatMediaInputNodeInteraction, batchVideoRenderingContext: BatchVideoRenderingContext, trendingPromise: Promise<ChatMediaInputGifPaneTrendingState?>) {
4952
self.context = context
5053
self.interaction = interaction
5154
self.inputNodeInteraction = inputNodeInteraction
55+
self.batchVideoRenderingContext = batchVideoRenderingContext
5256
self.trendingPromise = trendingPromise
5357

5458
self.theme = theme
@@ -217,7 +221,7 @@ final class GifPaneSearchContentNode: ASDisplayNode & PaneSearchContentNode {
217221
super.willEnterHierarchy()
218222

219223
if self.multiplexedNode == nil {
220-
let multiplexedNode = MultiplexedVideoNode(account: self.context.account, theme: self.theme, strings: self.strings)
224+
let multiplexedNode = MultiplexedVideoNode(context: self.context, theme: self.theme, strings: self.strings, batchVideoRenderingContext: self.batchVideoRenderingContext)
221225
self.multiplexedNode = multiplexedNode
222226
if let layout = self.validLayout {
223227
multiplexedNode.frame = CGRect(origin: CGPoint(), size: layout)

submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/PaneSearchContainerNode.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import MultiplexedVideoNode
1414
import FeaturedStickersScreen
1515
import StickerPeekUI
1616
import EntityKeyboardGifContent
17+
import BatchVideoRendering
1718

1819
private let searchBarHeight: CGFloat = 52.0
1920

@@ -54,15 +55,15 @@ public final class PaneSearchContainerNode: ASDisplayNode, EntitySearchContainer
5455
return self.contentNode.ready
5556
}
5657

57-
public init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, interaction: ChatEntityKeyboardInputNode.Interaction, inputNodeInteraction: ChatMediaInputNodeInteraction, mode: ChatMediaInputSearchMode, stickerActionTitle: String? = nil, trendingGifsPromise: Promise<ChatMediaInputGifPaneTrendingState?>, cancel: @escaping () -> Void, peekBehavior: EmojiContentPeekBehavior?) {
58+
public init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, interaction: ChatEntityKeyboardInputNode.Interaction, inputNodeInteraction: ChatMediaInputNodeInteraction, mode: ChatMediaInputSearchMode, batchVideoRenderingContext: BatchVideoRenderingContext?, stickerActionTitle: String? = nil, trendingGifsPromise: Promise<ChatMediaInputGifPaneTrendingState?>, cancel: @escaping () -> Void, peekBehavior: EmojiContentPeekBehavior?) {
5859
self.context = context
5960
self.mode = mode
6061
self.interaction = interaction
6162
self.inputNodeInteraction = inputNodeInteraction
6263
self.peekBehavior = peekBehavior
6364
switch mode {
6465
case .gif:
65-
self.contentNode = GifPaneSearchContentNode(context: context, theme: theme, strings: strings, interaction: interaction, inputNodeInteraction: inputNodeInteraction, trendingPromise: trendingGifsPromise)
66+
self.contentNode = GifPaneSearchContentNode(context: context, theme: theme, strings: strings, interaction: interaction, inputNodeInteraction: inputNodeInteraction, batchVideoRenderingContext: batchVideoRenderingContext ?? BatchVideoRenderingContext(context: context), trendingPromise: trendingGifsPromise)
6667
case .sticker, .trending:
6768
self.contentNode = StickerPaneSearchContentNode(context: context, theme: theme, strings: strings, interaction: interaction, inputNodeInteraction: inputNodeInteraction, stickerActionTitle: stickerActionTitle)
6869
}

submodules/TelegramUI/Components/EntityKeyboard/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ swift_library(
5151
"//submodules/TelegramCore/FlatBuffers",
5252
"//submodules/TelegramCore/FlatSerialization",
5353
"//submodules/TelegramUI/Components/BatchVideoRendering",
54+
"//submodules/TelegramUI/Components/GifVideoLayer",
5455
],
5556
visibility = [
5657
"//visibility:public",

0 commit comments

Comments
 (0)