mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 11:50:56 +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
|
strongSelf.participantsNode.isHidden = !isLivestream
|
||||||
|
|
||||||
|
let hadPeer = strongSelf.peer != nil
|
||||||
strongSelf.peer = peer
|
strongSelf.peer = peer
|
||||||
strongSelf.currentTitleIsCustom = title != nil
|
strongSelf.currentTitleIsCustom = title != nil
|
||||||
strongSelf.currentTitle = title ?? peer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder)
|
strongSelf.currentTitle = title ?? peer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder)
|
||||||
|
|
||||||
strongSelf.updateTitle(transition: .immediate)
|
strongSelf.updateTitle(transition: .immediate)
|
||||||
strongSelf.titleNode.isRecording = isRecording
|
strongSelf.titleNode.isRecording = isRecording
|
||||||
|
|
||||||
|
if strongSelf.isScheduling && !hadPeer {
|
||||||
|
strongSelf.updateScheduleButtonTitle()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !strongSelf.didSetDataReady {
|
if !strongSelf.didSetDataReady {
|
||||||
strongSelf.didSetDataReady = true
|
strongSelf.didSetDataReady = true
|
||||||
|
|||||||
@ -3401,6 +3401,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if !cachedGroupData.botInfos.isEmpty {
|
if !cachedGroupData.botInfos.isEmpty {
|
||||||
hasBots = true
|
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 {
|
if case let .known(value) = cachedGroupData.autoremoveTimeout {
|
||||||
autoremoveTimeout = value?.effectiveValue
|
autoremoveTimeout = value?.effectiveValue
|
||||||
}
|
}
|
||||||
@ -3409,6 +3415,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if !cachedChannelData.botInfos.isEmpty {
|
if !cachedChannelData.botInfos.isEmpty {
|
||||||
hasBots = true
|
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 {
|
if case let .known(value) = cachedChannelData.autoremoveTimeout {
|
||||||
autoremoveTimeout = value?.effectiveValue
|
autoremoveTimeout = value?.effectiveValue
|
||||||
|
|||||||
@ -311,7 +311,7 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
|
|||||||
stickersEnabled = false
|
stickersEnabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if chatPresentationInterfaceState.hasBots {
|
if chatPresentationInterfaceState.hasBots && chatPresentationInterfaceState.hasBotCommands {
|
||||||
accessoryItems.append(.commands)
|
accessoryItems.append(.commands)
|
||||||
}
|
}
|
||||||
accessoryItems.append(.stickers(stickersEnabled))
|
accessoryItems.append(.stickers(stickersEnabled))
|
||||||
|
|||||||
@ -165,7 +165,7 @@ private struct ThemeSettingsThemeItemNodeTransition {
|
|||||||
|
|
||||||
private func ensureThemeVisible(listNode: ListView, emoticon: String?, animated: Bool) -> Bool {
|
private func ensureThemeVisible(listNode: ListView, emoticon: String?, animated: Bool) -> Bool {
|
||||||
var resultNode: ThemeSettingsThemeItemIconNode?
|
var resultNode: ThemeSettingsThemeItemIconNode?
|
||||||
// var previousNode: ThemeSettingsThemeItemIconNode?
|
var previousNode: ThemeSettingsThemeItemIconNode?
|
||||||
var nextNode: ThemeSettingsThemeItemIconNode?
|
var nextNode: ThemeSettingsThemeItemIconNode?
|
||||||
listNode.forEachItemNode { node in
|
listNode.forEachItemNode { node in
|
||||||
guard let node = node as? ThemeSettingsThemeItemIconNode else {
|
guard let node = node as? ThemeSettingsThemeItemIconNode else {
|
||||||
@ -175,14 +175,22 @@ private func ensureThemeVisible(listNode: ListView, emoticon: String?, animated:
|
|||||||
if node.item?.emoticon == emoticon {
|
if node.item?.emoticon == emoticon {
|
||||||
resultNode = node
|
resultNode = node
|
||||||
} else {
|
} else {
|
||||||
// previousNode = node
|
previousNode = node
|
||||||
}
|
}
|
||||||
} else if nextNode == nil {
|
} else if nextNode == nil {
|
||||||
nextNode = node
|
nextNode = node
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let resultNode = resultNode {
|
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
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user