mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Saved messages highlight text
This commit is contained in:
parent
ad271bf102
commit
68dd428cbd
@ -526,39 +526,6 @@ public final class ChatInlineSearchResultsListComponent: Component {
|
|||||||
let previousContentsState = self.appliedContentsState
|
let previousContentsState = self.appliedContentsState
|
||||||
self.appliedContentsState = self.contentsState
|
self.appliedContentsState = self.contentsState
|
||||||
|
|
||||||
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(
|
|
||||||
leftList: previousContentsState?.entries ?? [],
|
|
||||||
rightList: contentsState.entries,
|
|
||||||
isLess: { lhs, rhs in
|
|
||||||
return lhs < rhs
|
|
||||||
},
|
|
||||||
isEqual: { lhs, rhs in
|
|
||||||
return lhs == rhs
|
|
||||||
},
|
|
||||||
getId: { entry in
|
|
||||||
return entry.id
|
|
||||||
},
|
|
||||||
allUpdated: false
|
|
||||||
)
|
|
||||||
|
|
||||||
let displayMessagesHeader = contentsState.entries.count != contentsState.messages.count
|
|
||||||
|
|
||||||
let chatListPresentationData: ChatListPresentationData
|
|
||||||
if let current = self.currentChatListPresentationData, current.0 == component.presentation {
|
|
||||||
chatListPresentationData = current.1
|
|
||||||
} else {
|
|
||||||
chatListPresentationData = ChatListPresentationData(
|
|
||||||
theme: component.presentation.theme,
|
|
||||||
fontSize: component.presentation.chatListFontSize,
|
|
||||||
strings: component.presentation.strings,
|
|
||||||
dateTimeFormat: component.presentation.dateTimeFormat,
|
|
||||||
nameSortOrder: component.presentation.nameSortOrder,
|
|
||||||
nameDisplayOrder: component.presentation.nameDisplayOrder,
|
|
||||||
disableAnimations: false
|
|
||||||
)
|
|
||||||
self.currentChatListPresentationData = (component.presentation, chatListPresentationData)
|
|
||||||
}
|
|
||||||
|
|
||||||
let chatListNodeInteraction: ChatListNodeInteraction
|
let chatListNodeInteraction: ChatListNodeInteraction
|
||||||
if let current = self.chatListNodeInteraction {
|
if let current = self.chatListNodeInteraction {
|
||||||
chatListNodeInteraction = current
|
chatListNodeInteraction = current
|
||||||
@ -650,6 +617,50 @@ public final class ChatInlineSearchResultsListComponent: Component {
|
|||||||
self.chatListNodeInteraction = chatListNodeInteraction
|
self.chatListNodeInteraction = chatListNodeInteraction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var searchTextHighightState: String?
|
||||||
|
if case let .search(query, _) = component.contents, !query.isEmpty {
|
||||||
|
searchTextHighightState = query.lowercased()
|
||||||
|
}
|
||||||
|
|
||||||
|
var allUpdated = false
|
||||||
|
if chatListNodeInteraction.searchTextHighightState != searchTextHighightState {
|
||||||
|
chatListNodeInteraction.searchTextHighightState = searchTextHighightState
|
||||||
|
allUpdated = true
|
||||||
|
}
|
||||||
|
|
||||||
|
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(
|
||||||
|
leftList: previousContentsState?.entries ?? [],
|
||||||
|
rightList: contentsState.entries,
|
||||||
|
isLess: { lhs, rhs in
|
||||||
|
return lhs < rhs
|
||||||
|
},
|
||||||
|
isEqual: { lhs, rhs in
|
||||||
|
return lhs == rhs
|
||||||
|
},
|
||||||
|
getId: { entry in
|
||||||
|
return entry.id
|
||||||
|
},
|
||||||
|
allUpdated: allUpdated
|
||||||
|
)
|
||||||
|
|
||||||
|
let displayMessagesHeader = contentsState.entries.count != contentsState.messages.count
|
||||||
|
|
||||||
|
let chatListPresentationData: ChatListPresentationData
|
||||||
|
if let current = self.currentChatListPresentationData, current.0 == component.presentation {
|
||||||
|
chatListPresentationData = current.1
|
||||||
|
} else {
|
||||||
|
chatListPresentationData = ChatListPresentationData(
|
||||||
|
theme: component.presentation.theme,
|
||||||
|
fontSize: component.presentation.chatListFontSize,
|
||||||
|
strings: component.presentation.strings,
|
||||||
|
dateTimeFormat: component.presentation.dateTimeFormat,
|
||||||
|
nameSortOrder: component.presentation.nameSortOrder,
|
||||||
|
nameDisplayOrder: component.presentation.nameDisplayOrder,
|
||||||
|
disableAnimations: false
|
||||||
|
)
|
||||||
|
self.currentChatListPresentationData = (component.presentation, chatListPresentationData)
|
||||||
|
}
|
||||||
|
|
||||||
let listPresentationData = ItemListPresentationData(component.context.sharedContext.currentPresentationData.with({ $0 }))
|
let listPresentationData = ItemListPresentationData(component.context.sharedContext.currentPresentationData.with({ $0 }))
|
||||||
let peerSelected = component.peerSelected
|
let peerSelected = component.peerSelected
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user