From 6789c8b48616a0dee531c4b1aadb8a1426efc2d9 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 28 Sep 2020 09:30:36 +0400 Subject: [PATCH] Search filters fixes --- .../Sources/ChatListSearchItemHeader.swift | 6 ++-- .../Sources/ChatListController.swift | 6 ++-- .../Sources/ChatListControllerNode.swift | 6 ++-- .../Sources/ChatListSearchContainerNode.swift | 10 +++--- .../Sources/ChatListSearchListPaneNode.swift | 4 +-- .../Sources/Node/ChatListItem.swift | 33 ++++++++---------- .../Display/Source/SubstringSearch.swift | 2 +- .../Sources/ListMessageFileItemNode.swift | 34 ++++++++++++------- .../Sources/ListMessageSnippetItemNode.swift | 17 +++++++--- .../Sources/PeerSelectionControllerNode.swift | 2 +- 10 files changed, 69 insertions(+), 51 deletions(-) diff --git a/submodules/ChatListSearchItemHeader/Sources/ChatListSearchItemHeader.swift b/submodules/ChatListSearchItemHeader/Sources/ChatListSearchItemHeader.swift index 4fcfeebe60..8b80d08ed0 100644 --- a/submodules/ChatListSearchItemHeader/Sources/ChatListSearchItemHeader.swift +++ b/submodules/ChatListSearchItemHeader/Sources/ChatListSearchItemHeader.swift @@ -21,7 +21,7 @@ public enum ChatListSearchItemHeaderType { case chats case chatTypes case faq - case messages(Int32) + case messages fileprivate func title(strings: PresentationStrings) -> String { switch self { @@ -57,8 +57,8 @@ public enum ChatListSearchItemHeaderType { return strings.ChatList_ChatTypesSection case .faq: return strings.Settings_FrequentlyAskedQuestions - case let .messages(count): - return strings.ChatList_Search_Messages(count) + case let .messages: + return strings.DialogList_SearchSectionMessages } } diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift index db25532c6f..5e49e76a50 100644 --- a/submodules/ChatListUI/Sources/ChatListController.swift +++ b/submodules/ChatListUI/Sources/ChatListController.swift @@ -659,7 +659,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, } } - self.chatListDisplayNode.requestOpenMessageFromSearch = { [weak self] peer, messageId in + self.chatListDisplayNode.requestOpenMessageFromSearch = { [weak self] peer, messageId, deactivateOnAction in if let strongSelf = self { strongSelf.openMessageFromSearchDisposable.set((storedMessageFromSearchPeer(account: strongSelf.context.account, peer: peer) |> deliverOnMainQueue).start(next: { [weak strongSelf] actualPeerId in @@ -670,7 +670,9 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, scrollToEndIfExists = true } strongSelf.context.sharedContext.navigateToChatController(NavigateToChatControllerParams(navigationController: navigationController, context: strongSelf.context, chatLocation: .peer(actualPeerId), subject: .message(id: messageId, highlight: true), purposefulAction: { - self?.deactivateSearch(animated: false) + if deactivateOnAction { + self?.deactivateSearch(animated: false) + } }, scrollToEndIfExists: scrollToEndIfExists, options: strongSelf.groupId == PeerGroupId.root ? [.removeOnMasterDetails] : [])) strongSelf.chatListDisplayNode.containerNode.currentItemNode.clearHighlightAnimated(true) } diff --git a/submodules/ChatListUI/Sources/ChatListControllerNode.swift b/submodules/ChatListUI/Sources/ChatListControllerNode.swift index 4a47a02090..223df354a4 100644 --- a/submodules/ChatListUI/Sources/ChatListControllerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListControllerNode.swift @@ -1001,7 +1001,7 @@ final class ChatListControllerNode: ASDisplayNode { var requestDeactivateSearch: (() -> Void)? var requestOpenPeerFromSearch: ((Peer, Bool) -> Void)? var requestOpenRecentPeerOptions: ((Peer) -> Void)? - var requestOpenMessageFromSearch: ((Peer, MessageId) -> Void)? + var requestOpenMessageFromSearch: ((Peer, MessageId, Bool) -> Void)? var requestAddContact: ((String) -> Void)? var peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)? var dismissSelfIfCompletedPresentation: (() -> Void)? @@ -1160,9 +1160,9 @@ final class ChatListControllerNode: ASDisplayNode { }, openDisabledPeer: { _ in }, openRecentPeerOptions: { [weak self] peer in self?.requestOpenRecentPeerOptions?(peer) - }, openMessage: { [weak self] peer, messageId in + }, openMessage: { [weak self] peer, messageId, deactivateOnAction in if let requestOpenMessageFromSearch = self?.requestOpenMessageFromSearch { - requestOpenMessageFromSearch(peer, messageId) + requestOpenMessageFromSearch(peer, messageId, deactivateOnAction) } }, addContact: { [weak self] phoneNumber in if let requestAddContact = self?.requestAddContact { diff --git a/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift b/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift index d49783b645..1303a08282 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift @@ -82,7 +82,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo private let context: AccountContext private let peersFilter: ChatListNodePeersFilter private var interaction: ChatListSearchInteraction? - private let openMessage: (Peer, MessageId) -> Void + private let openMessage: (Peer, MessageId, Bool) -> Void private let navigationController: NavigationController? let filterContainerNode: ChatListSearchFiltersContainerNode @@ -122,7 +122,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo private var validLayout: (ContainerViewLayout, CGFloat)? - public init(context: AccountContext, filter: ChatListNodePeersFilter, groupId: PeerGroupId, openPeer originalOpenPeer: @escaping (Peer, Bool) -> Void, openDisabledPeer: @escaping (Peer) -> Void, openRecentPeerOptions: @escaping (Peer) -> Void, openMessage originalOpenMessage: @escaping (Peer, MessageId) -> Void, addContact: ((String) -> Void)?, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?, present: @escaping (ViewController, Any?) -> Void, presentInGlobalOverlay: @escaping (ViewController, Any?) -> Void, navigationController: NavigationController?) { + public init(context: AccountContext, filter: ChatListNodePeersFilter, groupId: PeerGroupId, openPeer originalOpenPeer: @escaping (Peer, Bool) -> Void, openDisabledPeer: @escaping (Peer) -> Void, openRecentPeerOptions: @escaping (Peer) -> Void, openMessage originalOpenMessage: @escaping (Peer, MessageId, Bool) -> Void, addContact: ((String) -> Void)?, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?, present: @escaping (ViewController, Any?) -> Void, presentInGlobalOverlay: @escaping (ViewController, Any?) -> Void, navigationController: NavigationController?) { self.context = context self.peersFilter = filter self.navigationController = navigationController @@ -150,7 +150,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo }, openDisabledPeer: { peer in openDisabledPeer(peer) }, openMessage: { peer, messageId in - originalOpenMessage(peer, messageId) + originalOpenMessage(peer, messageId, true) if peer.id.namespace != Namespaces.Peer.SecretChat { addAppLogEvent(postbox: context.account.postbox, type: "search_global_open_message", peerId: peer.id, data: .dictionary(["msg_id": .number(Double(messageId.id))])) } @@ -627,7 +627,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo }))) items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.SharedMedia_ViewInChat, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/GoToMessage"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in c.dismiss(completion: { [weak self] in - self?.openMessage(message.peers[message.id.peerId]!, message.id) + self?.openMessage(message.peers[message.id.peerId]!, message.id, false) }) }))) @@ -673,7 +673,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo items.append(.action(ContextMenuActionItem(text: strings.SharedMedia_ViewInChat, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/GoToMessage"), color: theme.contextMenu.primaryColor) }, action: { c, f in c.dismiss(completion: { - self?.openMessage(message.peers[message.id.peerId]!, message.id) + self?.openMessage(message.peers[message.id.peerId]!, message.id, false) }) }))) diff --git a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift index e3256ea51a..033f9e5c0c 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift @@ -505,7 +505,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable { } }) case let .message(message, peer, readState, presentationData, totalCount, selected, displayCustomHeader): - let header = ChatListSearchItemHeader(type: .messages(totalCount), theme: presentationData.theme, strings: presentationData.strings, actionTitle: nil, action: nil) + let header = ChatListSearchItemHeader(type: .messages, theme: presentationData.theme, strings: presentationData.strings, actionTitle: nil, action: nil) let selection: ChatHistoryMessageSelection = selected.flatMap { .selectable(selected: $0) } ?? .none if let tagMask = tagMask, tagMask != .photoOrVideo { return ListMessageItem(presentationData: ChatPresentationData(theme: ChatPresentationThemeData(theme: presentationData.theme, wallpaper: .builtin(WallpaperSettings())), fontSize: presentationData.fontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations, largeEmoji: false, chatBubbleCorners: PresentationChatBubbleCorners(mainRadius: 0.0, auxiliaryRadius: 0.0, mergeBubbleCorners: false)), context: context, chatLocation: .peer(peer.peerId), interaction: listInteraction, message: message, selection: selection, displayHeader: enableHeaders && !displayCustomHeader, customHeader: nil, hintIsLink: tagMask == .webPage, isGlobalSearchResult: true) @@ -2260,7 +2260,7 @@ private final class ChatListSearchShimmerNode: ASDisplayNode { gesture?.cancel() }, present: { _ in }) - let items = (0 ..< 1).compactMap { _ -> ListViewItem? in + let items = (0 ..< 2).compactMap { _ -> ListViewItem? in switch key { case .chats: return ChatListItem(presentationData: chatListPresentationData, context: context, peerGroupId: .root, filterData: nil, index: ChatListIndex(pinningIndex: 0, messageIndex: MessageIndex(id: MessageId(peerId: peer1.id, namespace: 0, id: 0), timestamp: timestamp1)), content: .peer(messages: [Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer1.id, namespace: 0, id: 0), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, threadId: nil, timestamp: timestamp1, flags: [], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer1, text: "Text", attributes: [], media: [], peers: peers, associatedMessages: SimpleDictionary(), associatedMessageIds: [])], peer: RenderedPeer(peer: peer1), combinedReadState: CombinedPeerReadState(states: [(Namespaces.Message.Cloud, PeerReadState.idBased(maxIncomingReadId: 0, maxOutgoingReadId: 0, maxKnownId: 0, count: 0, markedUnread: false))]), isRemovedFromTotalUnreadCount: false, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, promoInfo: nil, ignoreUnreadBadge: false, displayAsMessage: false, hasFailedMessages: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction) diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 399a096eb7..cf1a78d25f 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -964,7 +964,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { attributedText = NSAttributedString(string: foldLineBreaks(embeddedState.text.string.replacingOccurrences(of: "\n\n", with: " ")), font: textFont, textColor: theme.messageTextColor) } else if let message = messages.last { - let composedString: NSMutableAttributedString + var composedString: NSMutableAttributedString if let inlineAuthorPrefix = inlineAuthorPrefix { composedString = NSMutableAttributedString() composedString.append(NSAttributedString(string: "\(inlineAuthorPrefix): ", font: textFont, textColor: theme.titleColor)) @@ -984,13 +984,26 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { chatListSearchResult = nil } - if let chatListSearchResult = chatListSearchResult { + if let chatListSearchResult = chatListSearchResult, let firstRange = chatListSearchResult.resultRanges.first { for range in chatListSearchResult.resultRanges { let stringRange = NSRange(range, in: chatListSearchResult.text) if stringRange.location >= 0 && stringRange.location + stringRange.length <= composedString.length { composedString.addAttribute(.foregroundColor, value: theme.messageHighlightedTextColor, range: stringRange) } } + + let firstRangeOrigin = chatListSearchResult.text.distance(from: chatListSearchResult.text.startIndex, to: firstRange.lowerBound) + if firstRangeOrigin > 24 { + var leftOrigin: Int = 0 + (composedString.string as NSString).enumerateSubstrings(in: NSMakeRange(0, firstRangeOrigin), options: [.byWords, .reverse]) { (str, range1, _, _) in + let distanceFromEnd = firstRangeOrigin - range1.location + if (distanceFromEnd > 12 || range1.location == 0) && leftOrigin == 0 { + leftOrigin = range1.location + } + } + composedString = composedString.attributedSubstring(from: NSMakeRange(leftOrigin, composedString.length - leftOrigin)).mutableCopy() as! NSMutableAttributedString + composedString.insert(NSAttributedString(string: "\u{2026}", attributes: [NSAttributedString.Key.font: textFont, NSAttributedString.Key.foregroundColor: theme.messageTextColor]), at: 0) + } } attributedText = composedString @@ -2061,19 +2074,3 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { return result } } - -private func foldLineBreaks(_ text: String) -> String { - let lines = text.split { $0.isNewline } - var result = "" - for line in lines { - if line.isEmpty { - continue - } - if result.isEmpty { - result += line - } else { - result += " " + line - } - } - return result -} diff --git a/submodules/Display/Source/SubstringSearch.swift b/submodules/Display/Source/SubstringSearch.swift index f3fecf8e90..75a1522b7b 100644 --- a/submodules/Display/Source/SubstringSearch.swift +++ b/submodules/Display/Source/SubstringSearch.swift @@ -43,7 +43,7 @@ public func findSubstringRanges(in string: String, query: String) -> ([Range 0 { let difference = abs(length - Double(count)) let rating = difference / length - if rating < 0.33 { + if rating < 0.37 { var range = range if hasLeadingSymbol && range.lowerBound > searchRange.lowerBound { range = text.index(before: range.lowerBound)..= 0 && stringRange.location + stringRange.length <= text.length { text.addAttribute(.foregroundColor, value: item.presentationData.theme.theme.chatList.messageHighlightedTextColor, range: stringRange) } } - captionText = text let firstRangeOrigin = chatListSearchResult.text.distance(from: chatListSearchResult.text.startIndex, to: firstRange.lowerBound) - if firstRangeOrigin > 20 { - captionText = text.attributedSubstring(from: NSMakeRange(firstRangeOrigin - 10, text.length - firstRangeOrigin + 10)).mutableCopy() as? NSMutableAttributedString - captionText?.insert(NSAttributedString(string: "\u{2026}", attributes: [NSAttributedString.Key.font: descriptionFont, NSAttributedString.Key.foregroundColor: item.presentationData.theme.theme.list.itemSecondaryTextColor]), at: 0) + if firstRangeOrigin > 24 { + var leftOrigin: Int = 0 + (text.string as NSString).enumerateSubstrings(in: NSMakeRange(0, firstRangeOrigin), options: [.byWords, .reverse]) { (str, range1, _, _) in + let distanceFromEnd = firstRangeOrigin - range1.location + if (distanceFromEnd > 12 || range1.location == 0) && leftOrigin == 0 { + leftOrigin = range1.location + } + } + text = text.attributedSubstring(from: NSMakeRange(leftOrigin, text.length - leftOrigin)).mutableCopy() as! NSMutableAttributedString + text.insert(NSAttributedString(string: "\u{2026}", attributes: [NSAttributedString.Key.font: descriptionFont, NSAttributedString.Key.foregroundColor: item.presentationData.theme.theme.list.itemSecondaryTextColor]), at: 0) } + + captionText = text } let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970) @@ -616,7 +626,7 @@ public final class ListMessageFileItemNode: ListMessageNode { let (titleNodeLayout, titleNodeApply) = titleNodeMakeLayout(TextNodeLayoutArguments(attributedString: titleText, backgroundColor: nil, maximumNumberOfLines: 2, truncationType: .middle, constrainedSize: CGSize(width: params.width - leftInset - leftOffset - rightInset - dateNodeLayout.size.width - 4.0, height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let (textNodeLayout, textNodeApply) = textNodeMakeLayout(TextNodeLayoutArguments(attributedString: captionText, backgroundColor: nil, maximumNumberOfLines: 3, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset - 30.0, height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (textNodeLayout, textNodeApply) = textNodeMakeLayout(TextNodeLayoutArguments(attributedString: captionText, backgroundColor: nil, maximumNumberOfLines: 2, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset - 30.0, height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (descriptionNodeLayout, descriptionNodeApply) = descriptionNodeMakeLayout(TextNodeLayoutArguments(attributedString: descriptionText, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset - 30.0, height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) diff --git a/submodules/ListMessageItem/Sources/ListMessageSnippetItemNode.swift b/submodules/ListMessageItem/Sources/ListMessageSnippetItemNode.swift index 0498ad606a..bc98f8ce36 100644 --- a/submodules/ListMessageItem/Sources/ListMessageSnippetItemNode.swift +++ b/submodules/ListMessageItem/Sources/ListMessageSnippetItemNode.swift @@ -454,7 +454,8 @@ public final class ListMessageSnippetItemNode: ListMessageNode { chatListSearchResult = nil } - if let chatListSearchResult = chatListSearchResult, !chatListSearchResult.resultRanges.isEmpty, let firstRange = chatListSearchResult.resultRanges.first { + var descriptionMaxNumberOfLines = 3 + if let chatListSearchResult = chatListSearchResult, let firstRange = chatListSearchResult.resultRanges.first { var text = NSMutableAttributedString(string: item.message.text, font: descriptionFont, textColor: item.presentationData.theme.theme.list.itemSecondaryTextColor) for range in chatListSearchResult.resultRanges { let stringRange = NSRange(range, in: chatListSearchResult.text) @@ -464,12 +465,20 @@ public final class ListMessageSnippetItemNode: ListMessageNode { } let firstRangeOrigin = chatListSearchResult.text.distance(from: chatListSearchResult.text.startIndex, to: firstRange.lowerBound) - if firstRangeOrigin > 20 { - text = text.attributedSubstring(from: NSMakeRange(firstRangeOrigin - 10, text.length - firstRangeOrigin + 10)).mutableCopy() as! NSMutableAttributedString + if firstRangeOrigin > 24 { + var leftOrigin: Int = 0 + (text.string as NSString).enumerateSubstrings(in: NSMakeRange(0, firstRangeOrigin), options: [.byWords, .reverse]) { (str, range1, _, _) in + let distanceFromEnd = firstRangeOrigin - range1.location + if (distanceFromEnd > 12 || range1.location == 0) && leftOrigin == 0 { + leftOrigin = range1.location + } + } + text = text.attributedSubstring(from: NSMakeRange(leftOrigin, text.length - leftOrigin)).mutableCopy() as! NSMutableAttributedString text.insert(NSAttributedString(string: "\u{2026}", attributes: [NSAttributedString.Key.font: descriptionFont, NSAttributedString.Key.foregroundColor: item.presentationData.theme.theme.list.itemSecondaryTextColor]), at: 0) } descriptionText = text + descriptionMaxNumberOfLines = 2 } let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970) @@ -480,7 +489,7 @@ public final class ListMessageSnippetItemNode: ListMessageNode { let (titleNodeLayout, titleNodeApply) = titleNodeMakeLayout(TextNodeLayoutArguments(attributedString: title, backgroundColor: nil, maximumNumberOfLines: 2, truncationType: .middle, constrainedSize: CGSize(width: params.width - leftInset - leftOffset - 8.0 - params.rightInset - 16.0 - dateNodeLayout.size.width, height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let (descriptionNodeLayout, descriptionNodeApply) = descriptionNodeMakeLayout(TextNodeLayoutArguments(attributedString: descriptionText, backgroundColor: nil, maximumNumberOfLines: 3, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 16.0 - 8.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0))) + let (descriptionNodeLayout, descriptionNodeApply) = descriptionNodeMakeLayout(TextNodeLayoutArguments(attributedString: descriptionText, backgroundColor: nil, maximumNumberOfLines: descriptionMaxNumberOfLines, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 16.0 - 8.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0))) let (linkNodeLayout, linkNodeApply) = linkNodeMakeLayout(TextNodeLayoutArguments(attributedString: linkText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 16.0 - 8.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: isInstantView ? TextNodeCutout(topLeft: CGSize(width: 14.0, height: 8.0)) : nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0))) var instantViewImage: UIImage? diff --git a/submodules/TelegramUI/Sources/PeerSelectionControllerNode.swift b/submodules/TelegramUI/Sources/PeerSelectionControllerNode.swift index 553a51b2a3..a92e3ff049 100644 --- a/submodules/TelegramUI/Sources/PeerSelectionControllerNode.swift +++ b/submodules/TelegramUI/Sources/PeerSelectionControllerNode.swift @@ -219,7 +219,7 @@ final class PeerSelectionControllerNode: ASDisplayNode { }, openDisabledPeer: { [weak self] peer in self?.requestOpenDisabledPeer?(peer) }, openRecentPeerOptions: { _ in - }, openMessage: { [weak self] peer, messageId in + }, openMessage: { [weak self] peer, messageId, _ in if let requestOpenMessageFromSearch = self?.requestOpenMessageFromSearch { requestOpenMessageFromSearch(peer, messageId) }