mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Search filters fixes
This commit is contained in:
parent
acdac9e757
commit
a6a9a2f7af
@ -792,6 +792,13 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
|||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
// strongSelf.headerNode.navigationButtonContainer.performAction?(.selectionDone)
|
// strongSelf.headerNode.navigationButtonContainer.performAction?(.selectionDone)
|
||||||
let _ = deleteMessagesInteractively(account: strongSelf.context.account, messageIds: Array(messageIds), type: .forEveryone).start()
|
let _ = deleteMessagesInteractively(account: strongSelf.context.account, messageIds: Array(messageIds), type: .forEveryone).start()
|
||||||
|
|
||||||
|
strongSelf.updateState { state in
|
||||||
|
return state.withUpdatedSelectedMessageIds(nil)
|
||||||
|
}
|
||||||
|
if let (layout, navigationBarHeight) = strongSelf.validLayout {
|
||||||
|
strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .animated(duration: 0.3, curve: .easeInOut))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@ -809,6 +816,13 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
|||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
// strongSelf.headerNode.navigationButtonContainer.performAction?(.selectionDone)
|
// strongSelf.headerNode.navigationButtonContainer.performAction?(.selectionDone)
|
||||||
let _ = deleteMessagesInteractively(account: strongSelf.context.account, messageIds: Array(messageIds), type: .forLocalPeer).start()
|
let _ = deleteMessagesInteractively(account: strongSelf.context.account, messageIds: Array(messageIds), type: .forLocalPeer).start()
|
||||||
|
|
||||||
|
strongSelf.updateState { state in
|
||||||
|
return state.withUpdatedSelectedMessageIds(nil)
|
||||||
|
}
|
||||||
|
if let (layout, navigationBarHeight) = strongSelf.validLayout {
|
||||||
|
strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .animated(duration: 0.3, curve: .easeInOut))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
@ -657,6 +657,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
private let searchStatePromise = ValuePromise<ChatListSearchListPaneNodeState>()
|
private let searchStatePromise = ValuePromise<ChatListSearchListPaneNodeState>()
|
||||||
private let searchContextValue = Atomic<ChatListSearchMessagesContext?>(value: nil)
|
private let searchContextValue = Atomic<ChatListSearchMessagesContext?>(value: nil)
|
||||||
var searchCurrentMessages: [Message]?
|
var searchCurrentMessages: [Message]?
|
||||||
|
var currentEntries: [ChatListSearchEntry]?
|
||||||
|
|
||||||
private var deletedMessagesDisposable: Disposable?
|
private var deletedMessagesDisposable: Disposable?
|
||||||
|
|
||||||
@ -1367,6 +1368,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
}, searchQuery: strongSelf.searchQueryValue, searchOptions: strongSelf.searchOptionsValue, messageContextAction: { message, node, rect, gesture in
|
}, searchQuery: strongSelf.searchQueryValue, searchOptions: strongSelf.searchOptionsValue, messageContextAction: { message, node, rect, gesture in
|
||||||
interaction.messageContextAction(message, node, rect, gesture)
|
interaction.messageContextAction(message, node, rect, gesture)
|
||||||
})
|
})
|
||||||
|
strongSelf.currentEntries = newEntries
|
||||||
strongSelf.enqueueTransition(transition, firstTime: firstTime)
|
strongSelf.enqueueTransition(transition, firstTime: firstTime)
|
||||||
|
|
||||||
var messages: [Message] = []
|
var messages: [Message] = []
|
||||||
@ -1966,7 +1968,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
if !strongSelf.didSetReady && !strongSelf.recentListNode.isHidden {
|
if !strongSelf.didSetReady && !strongSelf.recentListNode.isHidden {
|
||||||
var ready: Signal<Bool, NoError>?
|
var ready: Signal<Bool, NoError>?
|
||||||
strongSelf.recentListNode.forEachItemNode { node in
|
strongSelf.recentListNode.forEachItemNode { node in
|
||||||
if let node = node as? ChatListSearchRecentPeersNode {
|
if let node = node as? ChatListRecentPeersListItemNode {
|
||||||
ready = node.isReady
|
ready = node.isReady
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2058,7 +2060,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
strongSelf.emptyResultsTextNode.isHidden = !emptyResults
|
strongSelf.emptyResultsTextNode.isHidden = !emptyResults
|
||||||
strongSelf.emptyResultsAnimationNode.visibility = emptyResults
|
strongSelf.emptyResultsAnimationNode.visibility = emptyResults
|
||||||
|
|
||||||
let displayPlaceholder = transition.isLoading && (strongSelf.key != .chats || strongSelf.searchOptionsValue?.peer != nil || strongSelf.searchOptionsValue?.date != nil)
|
let displayPlaceholder = transition.isLoading && (strongSelf.key != .chats || (strongSelf.currentEntries?.isEmpty ?? true))
|
||||||
ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut).updateAlpha(node: strongSelf.shimmerNode, alpha: displayPlaceholder ? 1.0 : 0.0)
|
ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut).updateAlpha(node: strongSelf.shimmerNode, alpha: displayPlaceholder ? 1.0 : 0.0)
|
||||||
|
|
||||||
strongSelf.recentListNode.isHidden = displayingResults || strongSelf.peersFilter.contains(.excludeRecent)
|
strongSelf.recentListNode.isHidden = displayingResults || strongSelf.peersFilter.contains(.excludeRecent)
|
||||||
|
@ -116,7 +116,7 @@ public func chatMessageGalleryControllerData(context: AccountContext, chatLocati
|
|||||||
if let file = content.file {
|
if let file = content.file {
|
||||||
galleryMedia = file
|
galleryMedia = file
|
||||||
} else if let image = content.image {
|
} else if let image = content.image {
|
||||||
if case .link = mode {
|
if case .link = mode, !["video"].contains(content.type) {
|
||||||
} else if ["photo", "document", "video", "gif", "telegram_album"].contains(content.type) {
|
} else if ["photo", "document", "video", "gif", "telegram_album"].contains(content.type) {
|
||||||
galleryMedia = image
|
galleryMedia = image
|
||||||
}
|
}
|
||||||
|
@ -1334,7 +1334,7 @@ private final class NotificationExceptionsSearchContainerNode: SearchDisplayCont
|
|||||||
let (duration, curve) = listViewAnimationDurationAndCurve(transition: transition)
|
let (duration, curve) = listViewAnimationDurationAndCurve(transition: transition)
|
||||||
|
|
||||||
self.listNode.frame = CGRect(origin: CGPoint(), size: layout.size)
|
self.listNode.frame = CGRect(origin: CGPoint(), size: layout.size)
|
||||||
self.listNode.transaction(deleteIndices: [], insertIndicesAndItems: [], updateIndicesAndItems: [], options: [.Synchronous], scrollToItem: nil, updateSizeAndInsets: ListViewUpdateSizeAndInsets(size: layout.size, insets: UIEdgeInsets(top: navigationBarHeight, left: 0.0, bottom: layout.insets(options: [.input]).bottom, right: 0.0), duration: duration, curve: curve), stationaryItemRange: nil, updateOpaqueState: nil, completion: { _ in })
|
self.listNode.transaction(deleteIndices: [], insertIndicesAndItems: [], updateIndicesAndItems: [], options: [.Synchronous], scrollToItem: nil, updateSizeAndInsets: ListViewUpdateSizeAndInsets(size: layout.size, insets: UIEdgeInsets(top: navigationBarHeight, left: layout.safeInsets.left, bottom: layout.insets(options: [.input]).bottom, right: layout.safeInsets.right), duration: duration, curve: curve), stationaryItemRange: nil, updateOpaqueState: nil, completion: { _ in })
|
||||||
|
|
||||||
if !self.hasValidLayout {
|
if !self.hasValidLayout {
|
||||||
self.hasValidLayout = true
|
self.hasValidLayout = true
|
||||||
|
@ -268,7 +268,7 @@ private func mappedInsertEntries(context: AccountContext, chatLocation: ChatLoca
|
|||||||
switch mode {
|
switch mode {
|
||||||
case .bubbles:
|
case .bubbles:
|
||||||
item = ChatMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, content: .group(messages: messages))
|
item = ChatMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, content: .group(messages: messages))
|
||||||
case let .list(_, _, _, _, _):
|
case .list:
|
||||||
assertionFailure()
|
assertionFailure()
|
||||||
item = ListMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, interaction: ListMessageItemInteraction(controllerInteraction: controllerInteraction), message: messages[0].0, selection: .none, displayHeader: false)
|
item = ListMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, interaction: ListMessageItemInteraction(controllerInteraction: controllerInteraction), message: messages[0].0, selection: .none, displayHeader: false)
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ private func mappedUpdateEntries(context: AccountContext, chatLocation: ChatLoca
|
|||||||
switch mode {
|
switch mode {
|
||||||
case .bubbles:
|
case .bubbles:
|
||||||
item = ChatMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, content: .group(messages: messages))
|
item = ChatMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, content: .group(messages: messages))
|
||||||
case let .list(_, _, _, _, _):
|
case .list:
|
||||||
assertionFailure()
|
assertionFailure()
|
||||||
item = ListMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, interaction: ListMessageItemInteraction(controllerInteraction: controllerInteraction), message: messages[0].0, selection: .none, displayHeader: false)
|
item = ListMessageItem(presentationData: presentationData, context: context, chatLocation: chatLocation, interaction: ListMessageItemInteraction(controllerInteraction: controllerInteraction), message: messages[0].0, selection: .none, displayHeader: false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user