mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Merge commit 'd8d68722aecdc6dd8d206ebe5c741e607b135302'
This commit is contained in:
@@ -91,7 +91,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
private let context: AccountContext
|
||||
private let peersFilter: ChatListNodePeersFilter
|
||||
private let requestPeerType: [ReplyMarkupButtonRequestPeerType]?
|
||||
private let location: ChatListControllerLocation
|
||||
private var location: ChatListControllerLocation
|
||||
private let displaySearchFilters: Bool
|
||||
private let hasDownloads: Bool
|
||||
private var interaction: ChatListSearchInteraction?
|
||||
@@ -577,6 +577,12 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
for token in tokens {
|
||||
tokensIdSet.insert(token.id)
|
||||
}
|
||||
|
||||
if case .chatList(.archive) = self.location, !tokens.contains(where: { $0.id == AnyHashable(ChatListTokenId.archive.rawValue) }) {
|
||||
self.location = .chatList(groupId: .root)
|
||||
self.paneContainerNode.location = self.location
|
||||
}
|
||||
|
||||
if !tokensIdSet.contains(ChatListTokenId.date.rawValue) && updatedOptions?.date != nil {
|
||||
updatedOptions = updatedOptions?.withUpdatedDate(nil)
|
||||
}
|
||||
@@ -590,7 +596,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
var options = options
|
||||
var tokens: [SearchBarToken] = []
|
||||
if case .chatList(.archive) = self.location {
|
||||
tokens.append(SearchBarToken(id: ChatListTokenId.archive.rawValue, icon: UIImage(bundleImageName: "Chat List/Search/Archive"), iconOffset: -1.0, title: self.presentationData.strings.ChatList_Archive, permanent: true))
|
||||
tokens.append(SearchBarToken(id: ChatListTokenId.archive.rawValue, icon: UIImage(bundleImageName: "Chat List/Search/Archive"), iconOffset: -1.0, title: self.presentationData.strings.ChatList_Archive, permanent: false))
|
||||
} else if case .forum = self.location, let forumPeer = self.forumPeer {
|
||||
tokens.append(SearchBarToken(id: ChatListTokenId.forum.rawValue, icon: nil, iconOffset: -1.0, peer: (forumPeer, self.context, self.presentationData.theme), title: self.presentationData.strings.ChatList_Archive, permanent: true))
|
||||
}
|
||||
@@ -670,7 +676,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
|
||||
var tokens: [SearchBarToken] = []
|
||||
if case .chatList(.archive) = self.location {
|
||||
tokens.append(SearchBarToken(id: ChatListTokenId.archive.rawValue, icon: UIImage(bundleImageName: "Chat List/Search/Archive"), iconOffset: -1.0, title: self.presentationData.strings.ChatList_Archive, permanent: true))
|
||||
tokens.append(SearchBarToken(id: ChatListTokenId.archive.rawValue, icon: UIImage(bundleImageName: "Chat List/Search/Archive"), iconOffset: -1.0, title: self.presentationData.strings.ChatList_Archive, permanent: false))
|
||||
} else if case .forum = self.location, let forumPeer = self.forumPeer {
|
||||
tokens.append(SearchBarToken(id: ChatListTokenId.forum.rawValue, icon: nil, iconOffset: -1.0, peer: (forumPeer, self.context, self.presentationData.theme), title: self.presentationData.strings.ChatList_Archive, permanent: true))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user