Tag search fixes

This commit is contained in:
Isaac 2024-01-28 00:35:14 +01:00
parent 9ee9845439
commit ea9c9ae777
2 changed files with 15 additions and 2 deletions

View File

@ -173,7 +173,9 @@ class MessageHistoryTagsSummaryTable: Table {
}
func getCustomTags(tag: MessageTags, peerId: PeerId, threadId: Int64?, namespace: MessageId.Namespace) -> [MemoryBuffer] {
let peerKey = self.keyInternal(key: MessageHistoryTagsSummaryKey(tag: tag, peerId: peerId, threadId: threadId, namespace: namespace, customTag: nil), allowShared: false)
let key = MessageHistoryTagsSummaryKey(tag: tag, peerId: peerId, threadId: threadId, namespace: namespace, customTag: nil)
let peerKey = self.keyInternal(key: key, allowShared: false)
let prefixLength = 4 + 8 + 4 + 8
var result: [MemoryBuffer] = []
self.valueBox.range(self.table, start: peerKey.predecessor, end: peerKey.successor, keys: { key in
@ -187,6 +189,17 @@ class MessageHistoryTagsSummaryTable: Table {
}
return true
}, limit: 0)
for updatedKey in self.updatedKeys {
if updatedKey.peerId == peerId && updatedKey.tag == tag && updatedKey.threadId == threadId && updatedKey.namespace == namespace {
if let customTag = updatedKey.customTag {
if !result.contains(customTag) {
result.append(customTag)
}
}
}
}
return result
}

View File

@ -287,7 +287,7 @@ final class PeerInfoHeaderNavigationButton: HighlightableButtonNode {
self.textNode.attributedText = NSAttributedString(string: text, font: font, textColor: .white)
transition.updateTintColor(layer: self.textNode.layer, color: self.contentsColor)
self.iconNode.image = icon
transition.updateTintColor(layer: self.iconNode.layer, color: self.contentsColor)
transition.updateTintColor(view: self.iconNode.view, color: self.contentsColor)
if isAnimation {
self.iconNode.isHidden = true