Merge branch 'beta'

# Conflicts:
#	submodules/AvatarNode/Sources/AvatarNode.swift
#	submodules/ChatListUI/Sources/ChatListFilterPresetController.swift
#	submodules/TelegramUI/Sources/EditableTokenListNode.swift
This commit is contained in:
Ali
2023-01-10 13:40:45 +04:00
28 changed files with 315 additions and 208 deletions

View File

@@ -539,6 +539,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
return title
}
private var currentSpeechHolder: SpeechSynthesizerHolder?
public init(context: AccountContext, chatLocation: ChatLocation, chatLocationContextHolder: Atomic<ChatLocationContextHolder?> = Atomic<ChatLocationContextHolder?>(value: nil), subject: ChatControllerSubject? = nil, botStart: ChatControllerInitialBotStart? = nil, attachBotStart: ChatControllerInitialAttachBotStart? = nil, mode: ChatControllerPresentationMode = .standard(previewing: false), peekData: ChatPeekTimeout? = nil, peerNearbyData: ChatPeerNearbyData? = nil, chatListFilter: Int32? = nil, chatNavigationStack: [ChatNavigationStackItem] = []) {
let _ = ChatControllerCount.modify { value in
return value + 1
@@ -3534,7 +3536,14 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
window.rootViewController?.present(controller, animated: true)
}
case .speak:
let _ = speakText(context: strongSelf.context, text: text.string)
if let speechHolder = speakText(context: strongSelf.context, text: text.string) {
speechHolder.completion = { [weak self, weak speechHolder] in
if let strongSelf = self, strongSelf.currentSpeechHolder == speechHolder {
strongSelf.currentSpeechHolder = nil
}
}
strongSelf.currentSpeechHolder = speechHolder
}
case .translate:
strongSelf.chatDisplayNode.dismissInput()
let f = {