mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[WIP] Release changes
This commit is contained in:
@@ -72,7 +72,15 @@ func rightNavigationButtonForChatInterfaceState(context: AccountContext, present
|
||||
}
|
||||
|
||||
if case let .replyThread(message) = presentationInterfaceState.chatLocation, message.peerId == context.account.peerId {
|
||||
return chatInfoNavigationButton
|
||||
let isTags = presentationInterfaceState.hasSearchTags
|
||||
|
||||
if case .search(isTags) = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
let buttonItem = UIBarButtonItem(image: isTags ? PresentationResourcesRootController.navigationCompactTagsSearchIcon(presentationInterfaceState.theme) : PresentationResourcesRootController.navigationCompactSearchIcon(presentationInterfaceState.theme), style: .plain, target: target, action: selector)
|
||||
buttonItem.accessibilityLabel = strings.Conversation_Search
|
||||
return ChatNavigationButton(action: .search(hasTags: isTags), buttonItem: buttonItem)
|
||||
}
|
||||
}
|
||||
|
||||
if let channel = presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, channel.flags.contains(.isForum), let moreInfoNavigationButton = moreInfoNavigationButton {
|
||||
@@ -144,27 +152,29 @@ func rightNavigationButtonForChatInterfaceState(context: AccountContext, present
|
||||
|
||||
if case .standard(.previewing) = presentationInterfaceState.mode {
|
||||
return chatInfoNavigationButton
|
||||
} else if let peer = presentationInterfaceState.renderedPeer?.peer {
|
||||
if presentationInterfaceState.accountPeerId == peer.id {
|
||||
} else if let peerId = presentationInterfaceState.chatLocation.peerId {
|
||||
if presentationInterfaceState.accountPeerId == peerId {
|
||||
var displaySearchButton = false
|
||||
|
||||
if case .replyThread = presentationInterfaceState.chatLocation {
|
||||
displaySearchButton = true
|
||||
}
|
||||
|
||||
if case .scheduledMessages = presentationInterfaceState.subject {
|
||||
return chatInfoNavigationButton
|
||||
} else {
|
||||
displaySearchButton = true
|
||||
}
|
||||
|
||||
if displaySearchButton {
|
||||
let isTags = presentationInterfaceState.hasSearchTags
|
||||
|
||||
if presentationInterfaceState.hasPlentyOfMessages || isTags {
|
||||
if case .search(isTags) = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
let buttonItem = UIBarButtonItem(image: isTags ? PresentationResourcesRootController.navigationCompactTagsSearchIcon(presentationInterfaceState.theme) : PresentationResourcesRootController.navigationCompactSearchIcon(presentationInterfaceState.theme), style: .plain, target: target, action: selector)
|
||||
buttonItem.accessibilityLabel = strings.Conversation_Search
|
||||
return ChatNavigationButton(action: .search(hasTags: isTags), buttonItem: buttonItem)
|
||||
}
|
||||
if case .search(isTags) = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
if case .spacer = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
return ChatNavigationButton(action: .spacer, buttonItem: UIBarButtonItem(title: "", style: .plain, target: target, action: selector))
|
||||
}
|
||||
let buttonItem = UIBarButtonItem(image: isTags ? PresentationResourcesRootController.navigationCompactTagsSearchIcon(presentationInterfaceState.theme) : PresentationResourcesRootController.navigationCompactSearchIcon(presentationInterfaceState.theme), style: .plain, target: target, action: selector)
|
||||
buttonItem.accessibilityLabel = strings.Conversation_Search
|
||||
return ChatNavigationButton(action: .search(hasTags: isTags), buttonItem: buttonItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user