mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Squashes 79 sequential refactor waves into a single commit. Highlights: - Drop `import Postbox` (and matching `//submodules/Postbox` BUILD deps) from a wide swath of consumer files: ChatList, ChatMessage*BubbleContentNode subclasses, ListMessageNode/ListMessageItem, GalleryData, ChatHistorySearchContainerNode, ChatPanelInterfaceInteraction, ChatControllerInteraction, ChatMessageStickerItemNode, ChatMessageReplyInfoNode, ChatMessageInstantVideoItemNode, ChatPresentationInterfaceState, BrowserMarkdown/Readability, MediaResources, LocalMediaResources, ICloudResources, FetchManager, ShareController, OpenChatMessage, GalleryController, GroupStickerSearchContainerNode, GroupStickerPackCurrentItem, ChatPinnedMessageTitlePanelNode, OverlayAudioPlayerController, PresentationThemeSettings, StatisticsUI/StoryIconNode, TextFormat/StringWithAppliedEntities, GalleryUI/VideoAdComponent, StickerPackPreviewUI, WallpaperPreviewMedia, WallpaperResources, YoutubeEmbedImplementation, InstantPageExternalMediaResource, PlatformRestrictionMatching, TelegramUIDeclareEncodables, ChatListNode/ChatListSearchContainerNode. - Add `TelegramEngine` facades: `Themes.wallpapers`, `Themes.themes`, `AccountData.addAppLogEvent`. - Add `EngineMessageHistoryEntryLocation` wrapper. - Add `EngineRaw*` escape-hatch typealiases (`EngineRawMessage`, `EngineRawPeer`, `EngineRawMedia`, `EngineRawMediaResource`, `EngineRawMediaResourceData`, `EngineRawItemCollectionItem`, `EngineRawItemCollectionInfo`) and `engineDeclareEncodable` forwarder. - Drop unused `account:`/`postbox:`/`network:` parameters from several public functions and delete the dead overloads/types/functions left over: `automaticThemeShouldSwitchNow`, `cancelFreeMediaFileInteractiveFetch`, `legacyEnqueueVideoMessage`, `TelegramMediaFileReference`, plus assorted dead public TelegramCore/AccountContext SecureId entry points. - Delete entire dead modules: `LegacyDataImport`, `TonBinding`, `SpotlightSupport`, `SvgRendering`, third-party `AppCenter`/`VectorPlus`/`SwiftColor`/`SwiftSVG`. - Drop orphan `//submodules/Postbox` BUILD deps across 3 cleanup rounds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
74 lines
2.7 KiB
Swift
74 lines
2.7 KiB
Swift
import Foundation
|
|
import UIKit
|
|
import Display
|
|
import SwiftSignalKit
|
|
import TelegramCore
|
|
|
|
public enum GalleryMediaSubject: Hashable {
|
|
case paidMediaIndex(Int)
|
|
case pollDescription
|
|
case pollOption(Data)
|
|
case pollSolution
|
|
case instantPageMedia(EngineMedia.Id)
|
|
}
|
|
|
|
public enum GalleryControllerItemSource {
|
|
case peerMessagesAtId(messageId: EngineMessage.Id, chatLocation: ChatLocation, customTag: EngineMemoryBuffer?, chatLocationContextHolder: Atomic<ChatLocationContextHolder?>)
|
|
case standaloneMessage(EngineRawMessage, GalleryMediaSubject?)
|
|
case custom(messages: Signal<([EngineRawMessage], Int32, Bool), NoError>, messageId: EngineMessage.Id, loadMore: (() -> Void)?)
|
|
}
|
|
|
|
public final class GalleryControllerActionInteraction {
|
|
public let openUrl: (String, Bool, Bool) -> Void
|
|
public let openUrlIn: (String) -> Void
|
|
public let openPeerMention: (String) -> Void
|
|
public let openPeer: (EnginePeer) -> Void
|
|
public let openHashtag: (String?, String) -> Void
|
|
public let openBotCommand: (String) -> Void
|
|
public let openAd: (EngineMessage.Id) -> Void
|
|
public let addContact: (String) -> Void
|
|
public let storeMediaPlaybackState: (EngineMessage.Id, Double?, Double) -> Void
|
|
public let editMedia: (EngineMessage.Id, [UIView], @escaping () -> Void) -> Void
|
|
public let updateCanReadHistory: (Bool) -> Void
|
|
public let sendSticker: ((FileMediaReference) -> Void)?
|
|
|
|
public init(
|
|
openUrl: @escaping (String, Bool, Bool) -> Void,
|
|
openUrlIn: @escaping (String) -> Void,
|
|
openPeerMention: @escaping (String) -> Void,
|
|
openPeer: @escaping (EnginePeer) -> Void,
|
|
openHashtag: @escaping (String?, String) -> Void,
|
|
openBotCommand: @escaping (String) -> Void,
|
|
openAd: @escaping (EngineMessage.Id) -> Void,
|
|
addContact: @escaping (String) -> Void,
|
|
storeMediaPlaybackState: @escaping (EngineMessage.Id, Double?, Double) -> Void,
|
|
editMedia: @escaping (EngineMessage.Id, [UIView], @escaping () -> Void) -> Void,
|
|
updateCanReadHistory: @escaping (Bool) -> Void,
|
|
sendSticker: ((FileMediaReference) -> Void)?
|
|
) {
|
|
self.openUrl = openUrl
|
|
self.openUrlIn = openUrlIn
|
|
self.openPeerMention = openPeerMention
|
|
self.openPeer = openPeer
|
|
self.openHashtag = openHashtag
|
|
self.openBotCommand = openBotCommand
|
|
self.openAd = openAd
|
|
self.addContact = addContact
|
|
self.storeMediaPlaybackState = storeMediaPlaybackState
|
|
self.editMedia = editMedia
|
|
self.updateCanReadHistory = updateCanReadHistory
|
|
self.sendSticker = sendSticker
|
|
}
|
|
}
|
|
|
|
public protocol GalleryControllerProtocol: ViewController {
|
|
|
|
}
|
|
|
|
public protocol StickerPackScreen {
|
|
|
|
}
|
|
|
|
public protocol StickerPickerInput {
|
|
|
|
}
|