[WIP] Release changes

This commit is contained in:
Isaac
2024-01-26 15:33:01 +01:00
parent ce83d7510f
commit 953e1598f7
93 changed files with 4096 additions and 556 deletions

View File

@@ -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)
}
}
}