mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-05-21 18:20:41 +00:00
7b2b74e79b
First build-verified unused-import sweep: speculatively dropped import Postbox from 782 consumer files (plain ^import Postbox$ lines, excluding TelegramCore/Postbox/TelegramApi paths), iterated 18 full project builds with --continueOnError, restored the import on every file that failed to compile. 183 drops survived; 189 consumer modules newly Postbox-free. Bundled: spec + plan + C1 atomic batch drop + C2 CLAUDE.md outcome and permanent methodology guidance under Wave-selection. The methodology subsection captures the reusable playbook (--continueOnError is essential, dependency graphs are deep so expect many iterations, pattern-based preemptive restores accelerate convergence, and CLAUDE.md's engine typealias cheat sheet arrows are migration targets rather than typealiases in TelegramCore). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
44 lines
1.7 KiB
Swift
44 lines
1.7 KiB
Swift
import Foundation
|
|
import UIKit
|
|
import AsyncDisplayKit
|
|
import TelegramCore
|
|
import AccountContext
|
|
import ChatPresentationInterfaceState
|
|
import ChatControllerInteraction
|
|
import ChatInputNode
|
|
import ChatEntityKeyboardInputNode
|
|
import ChatInputPanelNode
|
|
import ChatButtonKeyboardInputNode
|
|
import ChatTextInputPanelNode
|
|
|
|
func inputNodeForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentNode: ChatInputNode?, interfaceInteraction: ChatPanelInterfaceInteraction?, controllerInteraction: ChatControllerInteraction, inputPanelNode: ChatInputPanelNode?, makeMediaInputNode: () -> ChatInputNode?) -> ChatInputNode? {
|
|
if let inputPanelNode = inputPanelNode, !(inputPanelNode is ChatTextInputPanelNode) {
|
|
return nil
|
|
}
|
|
switch chatPresentationInterfaceState.inputMode {
|
|
case .media:
|
|
if let currentNode = currentNode as? ChatEntityKeyboardInputNode {
|
|
return currentNode
|
|
} else if let inputMediaNode = makeMediaInputNode() {
|
|
inputMediaNode.interfaceInteraction = interfaceInteraction
|
|
return inputMediaNode
|
|
} else {
|
|
return nil
|
|
}
|
|
case .inputButtons:
|
|
if chatPresentationInterfaceState.forceInputCommandsHidden {
|
|
return nil
|
|
} else {
|
|
if let currentNode = currentNode as? ChatButtonKeyboardInputNode {
|
|
return currentNode
|
|
} else {
|
|
let inputNode = ChatButtonKeyboardInputNode(context: context, controllerInteraction: controllerInteraction)
|
|
inputNode.interfaceInteraction = interfaceInteraction
|
|
return inputNode
|
|
}
|
|
}
|
|
case .none, .text:
|
|
return nil
|
|
}
|
|
}
|