mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-24 06:21:55 +00:00
Various fixes
This commit is contained in:
parent
ba3a6d9b9d
commit
4e96f34992
@ -54,7 +54,8 @@ final class HashtagSearchControllerNode: ASDisplayNode {
|
||||
self.shimmerNode.allowsGroupOpacity = true
|
||||
|
||||
self.recentListNode = HashtagSearchRecentListNode(context: context)
|
||||
|
||||
self.recentListNode.alpha = 0.0
|
||||
|
||||
let navigationController = controller.navigationController as? NavigationController
|
||||
if let peer {
|
||||
self.currentController = context.sharedContext.makeChatController(context: context, chatLocation: .peer(id: peer.id), subject: nil, botStart: nil, mode: .inline(navigationController))
|
||||
@ -150,6 +151,10 @@ final class HashtagSearchControllerNode: ASDisplayNode {
|
||||
}
|
||||
self.searchContentNode.query = query
|
||||
self.updateSearchQuery(query)
|
||||
|
||||
Queue.mainQueue().after(0.4) {
|
||||
let _ = addRecentHashtagSearchQuery(engine: context.engine, string: query).startStandalone()
|
||||
}
|
||||
}
|
||||
|
||||
self.currentController?.isSelectingMessagesUpdated = { [weak self] isSelecting in
|
||||
@ -303,9 +308,20 @@ final class HashtagSearchControllerNode: ASDisplayNode {
|
||||
self.insertSubnode(self.recentListNode, aboveSubnode: self.shimmerNode)
|
||||
}
|
||||
|
||||
self.recentListNode.frame = CGRect(origin: .zero, size: layout.size)
|
||||
transition.updateFrame(node: self.recentListNode, frame: CGRect(origin: .zero, size: layout.size))
|
||||
self.recentListNode.updateLayout(layout: ContainerViewLayout(size: layout.size, metrics: layout.metrics, deviceMetrics: layout.deviceMetrics, intrinsicInsets: UIEdgeInsets(top: insets.top - 35.0, left: layout.safeInsets.left, bottom: layout.intrinsicInsets.bottom, right: layout.safeInsets.right), safeInsets: layout.safeInsets, additionalInsets: layout.additionalInsets, statusBarHeight: nil, inputHeight: layout.inputHeight, inputHeightIsInteractivellyChanging: false, inVoiceOver: false), transition: transition)
|
||||
self.recentListNode.isHidden = !self.query.isEmpty
|
||||
|
||||
let recentTransition = ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut)
|
||||
if self.query.isEmpty {
|
||||
recentTransition.updateAlpha(node: self.recentListNode, alpha: 1.0)
|
||||
} else if self.recentListNode.alpha > 0.0 {
|
||||
Queue.mainQueue().after(0.1, {
|
||||
if !self.query.isEmpty {
|
||||
recentTransition.updateAlpha(node: self.recentListNode, alpha: 0.0)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if !self.hasValidLayout {
|
||||
self.hasValidLayout = true
|
||||
|
@ -768,10 +768,14 @@ public final class ChatInlineSearchResultsListComponent: Component {
|
||||
}
|
||||
|
||||
let renderedPeer: EngineRenderedPeer
|
||||
if let effectiveAuthor {
|
||||
if let effectiveAuthor, !component.showEmptyResults {
|
||||
renderedPeer = EngineRenderedPeer(peer: effectiveAuthor)
|
||||
} else {
|
||||
renderedPeer = EngineRenderedPeer(peerId: message.id.peerId, peers: [:], associatedMedia: [:])
|
||||
var peers: [EnginePeer.Id: EnginePeer] = [:]
|
||||
if let peer = message.peers[message.id.peerId] {
|
||||
peers[message.id.peerId] = EnginePeer(peer)
|
||||
}
|
||||
renderedPeer = EngineRenderedPeer(peerId: message.id.peerId, peers: peers, associatedMedia: [:])
|
||||
}
|
||||
|
||||
return ChatListItem(
|
||||
@ -800,7 +804,7 @@ public final class ChatInlineSearchResultsListComponent: Component {
|
||||
inputActivities: nil,
|
||||
promoInfo: nil,
|
||||
ignoreUnreadBadge: false,
|
||||
displayAsMessage: component.peerId != component.context.account.peerId,
|
||||
displayAsMessage: component.peerId != component.context.account.peerId && !component.showEmptyResults,
|
||||
hasFailedMessages: false,
|
||||
forumTopicData: nil,
|
||||
topForumTopicItems: [],
|
||||
|
@ -281,10 +281,12 @@ private func canViewReadStats(message: Message, participantCount: Int?, isMessag
|
||||
}
|
||||
|
||||
func canReplyInChat(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, accountPeerId: PeerId) -> Bool {
|
||||
if case let .customChatContents(contents) = chatPresentationInterfaceState.subject, case .hashTagSearch = contents.kind {
|
||||
return false
|
||||
}
|
||||
if case .customChatContents = chatPresentationInterfaceState.chatLocation {
|
||||
return true
|
||||
}
|
||||
|
||||
guard let peer = chatPresentationInterfaceState.renderedPeer?.peer else {
|
||||
return false
|
||||
}
|
||||
|
@ -228,7 +228,15 @@ final class ChatTagSearchInputPanelNode: ChatInputPanelNode {
|
||||
if let currentId = results.currentId, let index = results.messageIndices.firstIndex(where: { $0.id == currentId }) {
|
||||
canChangeListMode = true
|
||||
|
||||
if params.interfaceState.displayHistoryFilterAsList || self.alwaysShowTotalMessagesCount {
|
||||
if self.alwaysShowTotalMessagesCount {
|
||||
let value = presentationStringsFormattedNumber(Int32(displayTotalCount), params.interfaceState.dateTimeFormat.groupingSeparator)
|
||||
let suffix = params.interfaceState.strings.Chat_BottomSearchPanel_MessageCount(Int32(displayTotalCount))
|
||||
resultsTextString = [AnimatedTextComponent.Item(
|
||||
id: "text",
|
||||
isUnbreakable: true,
|
||||
content: .text(params.interfaceState.strings.Chat_BottomSearchPanel_MessageCountFormat(value, suffix).string)
|
||||
)]
|
||||
} else if params.interfaceState.displayHistoryFilterAsList {
|
||||
resultsTextString = extractAnimatedTextString(string: params.interfaceState.strings.Chat_BottomSearchPanel_MessageCountFormat(
|
||||
".",
|
||||
"."
|
||||
|
Loading…
x
Reference in New Issue
Block a user