[WIP] General UI improvements

This commit is contained in:
Ali
2022-09-16 22:59:16 +04:00
parent f05031cc9d
commit ff22c7e981
34 changed files with 497 additions and 171 deletions

View File

@@ -3604,7 +3604,7 @@ func replayFinalState(
let namespace: ItemCollectionId.Namespace
var items: [ItemCollectionItem] = []
let info: StickerPackCollectionInfo
if case let .stickerSet(set, packs, documents) = apiSet {
if case let .stickerSet(set, packs, keywords, documents) = apiSet {
var indexKeysByFile: [MediaId: [MemoryBuffer]] = [:]
for pack in packs {
switch pack {
@@ -3621,6 +3621,20 @@ func replayFinalState(
break
}
}
for keyword in keywords {
switch keyword {
case let .stickerKeyword(documentId, texts):
for text in texts {
let key = ValueBoxKey(text).toMemoryBuffer()
let mediaId = MediaId(namespace: Namespaces.Media.CloudFile, id: documentId)
if indexKeysByFile[mediaId] == nil {
indexKeysByFile[mediaId] = [key]
} else {
indexKeysByFile[mediaId]!.append(key)
}
}
}
}
for apiDocument in documents {
if let file = telegramMediaFileFromApiDocument(apiDocument), let id = file.id {