[WIP] Topics

This commit is contained in:
Ali
2022-10-04 18:19:39 +04:00
parent 533085c77a
commit 62697d4ffb
83 changed files with 1974 additions and 1650 deletions

View File

@@ -76,7 +76,7 @@ func leftNavigationButtonForChatInterfaceState(_ presentationInterfaceState: Cha
return nil
}
func rightNavigationButtonForChatInterfaceState(_ presentationInterfaceState: ChatPresentationInterfaceState, strings: PresentationStrings, currentButton: ChatNavigationButton?, target: Any?, selector: Selector?, chatInfoNavigationButton: ChatNavigationButton?) -> ChatNavigationButton? {
func rightNavigationButtonForChatInterfaceState(_ presentationInterfaceState: ChatPresentationInterfaceState, strings: PresentationStrings, currentButton: ChatNavigationButton?, target: Any?, selector: Selector?, chatInfoNavigationButton: ChatNavigationButton?, moreInfoNavigationButton: ChatNavigationButton?) -> ChatNavigationButton? {
if let _ = presentationInterfaceState.interfaceState.selectionState {
if case .forwardedMessages = presentationInterfaceState.subject {
return nil
@@ -90,6 +90,13 @@ func rightNavigationButtonForChatInterfaceState(_ presentationInterfaceState: Ch
}
}
if let channel = presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, channel.flags.contains(.isForum), let moreInfoNavigationButton = moreInfoNavigationButton {
if case .replyThread = presentationInterfaceState.chatLocation {
} else {
return moreInfoNavigationButton
}
}
var hasMessages = false
if let chatHistoryState = presentationInterfaceState.chatHistoryState {
if case .loaded(false) = chatHistoryState {
@@ -106,7 +113,8 @@ func rightNavigationButtonForChatInterfaceState(_ presentationInterfaceState: Ch
}
if case .replyThread = presentationInterfaceState.chatLocation {
if hasMessages {
if let channel = presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, channel.flags.contains(.isForum) {
} else if hasMessages {
if case .search = currentButton?.action {
return currentButton
} else {