mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various Fixes
This commit is contained in:
parent
667aec4df0
commit
9aa4256dbf
@ -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
|
||||
|
@ -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
|
||||
|
@ -311,7 +311,7 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
|
||||
stickersEnabled = false
|
||||
}
|
||||
}
|
||||
if chatPresentationInterfaceState.hasBots {
|
||||
if chatPresentationInterfaceState.hasBots && chatPresentationInterfaceState.hasBotCommands {
|
||||
accessoryItems.append(.commands)
|
||||
}
|
||||
accessoryItems.append(.stickers(stickersEnabled))
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user