diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift index f2a5171029..2dc45059bc 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift @@ -1995,12 +1995,17 @@ public final class VoiceChatController: ViewController { } strongSelf.participantsNode.isHidden = !isLivestream + let hadPeer = strongSelf.peer != nil strongSelf.peer = peer strongSelf.currentTitleIsCustom = title != nil strongSelf.currentTitle = title ?? peer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder) strongSelf.updateTitle(transition: .immediate) strongSelf.titleNode.isRecording = isRecording + + if strongSelf.isScheduling && !hadPeer { + strongSelf.updateScheduleButtonTitle() + } } if !strongSelf.didSetDataReady { strongSelf.didSetDataReady = true diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 9601003efa..e8ee0a53ce 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -3401,6 +3401,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if !cachedGroupData.botInfos.isEmpty { hasBots = true } + let botCommands = cachedGroupData.botInfos.reduce(into: [], { result, info in + result.append(contentsOf: info.botInfo.commands) + }) + if !botCommands.isEmpty { + hasBotCommands = true + } if case let .known(value) = cachedGroupData.autoremoveTimeout { autoremoveTimeout = value?.effectiveValue } @@ -3409,6 +3415,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if !cachedChannelData.botInfos.isEmpty { hasBots = true } + let botCommands = cachedChannelData.botInfos.reduce(into: [], { result, info in + result.append(contentsOf: info.botInfo.commands) + }) + if !botCommands.isEmpty { + hasBotCommands = true + } } if case let .known(value) = cachedChannelData.autoremoveTimeout { autoremoveTimeout = value?.effectiveValue diff --git a/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift b/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift index 31eeb06242..fdc6118485 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift @@ -311,7 +311,7 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte stickersEnabled = false } } - if chatPresentationInterfaceState.hasBots { + if chatPresentationInterfaceState.hasBots && chatPresentationInterfaceState.hasBotCommands { accessoryItems.append(.commands) } accessoryItems.append(.stickers(stickersEnabled)) diff --git a/submodules/TelegramUI/Sources/ChatThemeScreen.swift b/submodules/TelegramUI/Sources/ChatThemeScreen.swift index 43f8c64dc5..f69128b307 100644 --- a/submodules/TelegramUI/Sources/ChatThemeScreen.swift +++ b/submodules/TelegramUI/Sources/ChatThemeScreen.swift @@ -165,7 +165,7 @@ private struct ThemeSettingsThemeItemNodeTransition { private func ensureThemeVisible(listNode: ListView, emoticon: String?, animated: Bool) -> Bool { var resultNode: ThemeSettingsThemeItemIconNode? -// var previousNode: ThemeSettingsThemeItemIconNode? + var previousNode: ThemeSettingsThemeItemIconNode? var nextNode: ThemeSettingsThemeItemIconNode? listNode.forEachItemNode { node in guard let node = node as? ThemeSettingsThemeItemIconNode else { @@ -175,14 +175,22 @@ private func ensureThemeVisible(listNode: ListView, emoticon: String?, animated: if node.item?.emoticon == emoticon { resultNode = node } else { -// previousNode = node + previousNode = node } } else if nextNode == nil { nextNode = node } } if let resultNode = resultNode { - listNode.ensureItemNodeVisible(resultNode, animated: animated, overflow: 57.0) + var nodeToEnsure = resultNode + if case let .visible(resultVisibility) = resultNode.visibility, resultVisibility == 1.0 { + if let previousNode = previousNode, case let .visible(previousVisibility) = previousNode.visibility, previousVisibility < 0.5 { + nodeToEnsure = previousNode + } else if let nextNode = nextNode, case let .visible(nextVisibility) = nextNode.visibility, nextVisibility < 0.5 { + nodeToEnsure = nextNode + } + } + listNode.ensureItemNodeVisible(nodeToEnsure, animated: animated, overflow: 57.0) return true } else { return false