mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -173,6 +173,24 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
|
||||
var accessoryItems: [ChatTextInputAccessoryItem] = []
|
||||
let isTextEmpty = chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0
|
||||
let hasForward = chatPresentationInterfaceState.interfaceState.forwardMessageIds != nil
|
||||
|
||||
var extendedSearchLayout = false
|
||||
loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults {
|
||||
if case let .contextRequestResult(peer, _) = result, peer != nil {
|
||||
extendedSearchLayout = true
|
||||
break loop
|
||||
}
|
||||
}
|
||||
if !extendedSearchLayout {
|
||||
if case .scheduledMessages = chatPresentationInterfaceState.subject {
|
||||
} else if chatPresentationInterfaceState.renderedPeer?.peerId != context.account.peerId {
|
||||
if let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramSecretChat, chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(peer.messageAutoremoveTimeout))
|
||||
} else if currentAutoremoveTimeout != nil && chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(currentAutoremoveTimeout))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if case .scheduledMessages = chatPresentationInterfaceState.subject {
|
||||
} else {
|
||||
@@ -191,24 +209,6 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
|
||||
accessoryItems.append(.gift)
|
||||
}
|
||||
}
|
||||
|
||||
var extendedSearchLayout = false
|
||||
loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults {
|
||||
if case let .contextRequestResult(peer, _) = result, peer != nil {
|
||||
extendedSearchLayout = true
|
||||
break loop
|
||||
}
|
||||
}
|
||||
if !extendedSearchLayout {
|
||||
if case .scheduledMessages = chatPresentationInterfaceState.subject {
|
||||
} else if chatPresentationInterfaceState.renderedPeer?.peerId != context.account.peerId {
|
||||
if let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramSecretChat, chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(peer.messageAutoremoveTimeout))
|
||||
} else if currentAutoremoveTimeout != nil && chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(currentAutoremoveTimeout))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if isTextEmpty && chatPresentationInterfaceState.hasScheduledMessages && !hasForward {
|
||||
accessoryItems.append(.scheduledMessages)
|
||||
|
||||
Reference in New Issue
Block a user