mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix reaction search
This commit is contained in:
parent
8223ac9d50
commit
113733d92d
@ -2028,14 +2028,17 @@ public final class ReactionContextNode: ASDisplayNode, ASScrollViewDelegate {
|
|||||||
))
|
))
|
||||||
return .single(resultGroups)
|
return .single(resultGroups)
|
||||||
} else {
|
} else {
|
||||||
|
let remoteSignal = context.engine.stickers.searchEmoji(emojiString: Array(allEmoticons.keys))
|
||||||
|
|
||||||
return combineLatest(
|
return combineLatest(
|
||||||
context.account.postbox.itemCollectionsView(orderedItemListCollectionIds: [], namespaces: [Namespaces.ItemCollection.CloudEmojiPacks], aroundIndex: nil, count: 10000000) |> take(1),
|
context.account.postbox.itemCollectionsView(orderedItemListCollectionIds: [], namespaces: [Namespaces.ItemCollection.CloudEmojiPacks], aroundIndex: nil, count: 10000000) |> take(1),
|
||||||
context.engine.stickers.availableReactions() |> take(1),
|
context.engine.stickers.availableReactions() |> take(1),
|
||||||
hasPremium |> take(1),
|
hasPremium |> take(1),
|
||||||
remotePacksSignal,
|
remotePacksSignal,
|
||||||
|
remoteSignal,
|
||||||
localPacksSignal
|
localPacksSignal
|
||||||
)
|
)
|
||||||
|> map { view, availableReactions, hasPremium, foundPacks, foundLocalPacks -> [EmojiPagerContentComponent.ItemGroup] in
|
|> map { view, availableReactions, hasPremium, foundPacks, foundEmoji, foundLocalPacks -> [EmojiPagerContentComponent.ItemGroup] in
|
||||||
var result: [(String, TelegramMediaFile?, String)] = []
|
var result: [(String, TelegramMediaFile?, String)] = []
|
||||||
|
|
||||||
var allEmoticons: [String: String] = [:]
|
var allEmoticons: [String: String] = [:]
|
||||||
@ -2045,6 +2048,21 @@ public final class ReactionContextNode: ASDisplayNode, ASScrollViewDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for itemFile in foundEmoji.items {
|
||||||
|
for attribute in itemFile.attributes {
|
||||||
|
switch attribute {
|
||||||
|
case let .CustomEmoji(_, _, alt, _):
|
||||||
|
if !alt.isEmpty, let keyword = allEmoticons[alt] {
|
||||||
|
result.append((alt, itemFile, keyword))
|
||||||
|
} else if alt == query {
|
||||||
|
result.append((alt, itemFile, alt))
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for entry in view.entries {
|
for entry in view.entries {
|
||||||
guard let item = entry.item as? StickerPackItem else {
|
guard let item = entry.item as? StickerPackItem else {
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user