mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[WIP] Entity input panel
This commit is contained in:
@@ -72,6 +72,8 @@ func managedSynchronizeInstalledStickerPacksOperations(postbox: Postbox, network
|
||||
tag = OperationLogTags.SynchronizeInstalledStickerPacks
|
||||
case .masks:
|
||||
tag = OperationLogTags.SynchronizeInstalledMasks
|
||||
case .emoji:
|
||||
tag = OperationLogTags.SynchronizeInstalledEmoji
|
||||
}
|
||||
|
||||
let helper = Atomic<ManagedSynchronizeInstalledStickerPacksOperationsHelper>(value: ManagedSynchronizeInstalledStickerPacksOperationsHelper())
|
||||
@@ -126,7 +128,7 @@ private func hashForStickerPackInfos(_ infos: [StickerPackCollectionInfo]) -> In
|
||||
var acc: UInt64 = 0
|
||||
|
||||
for info in infos {
|
||||
combineInt64Hash(&acc, with: UInt64(UInt32(bitPattern: info.hash)))
|
||||
combineInt64Hash(&acc, with: UInt64(bitPattern: Int64(info.hash)))
|
||||
}
|
||||
|
||||
return finalizeInt64Hash(acc)
|
||||
@@ -295,6 +297,8 @@ private func reorderRemoteStickerPacks(network: Network, namespace: SynchronizeI
|
||||
break
|
||||
case .masks:
|
||||
flags |= (1 << 0)
|
||||
case .emoji:
|
||||
flags |= (1 << 1)
|
||||
}
|
||||
return network.request(Api.functions.messages.reorderStickerSets(flags: flags, order: ids.map { $0.id }))
|
||||
|> `catch` { _ -> Signal<Api.Bool, NoError> in
|
||||
@@ -312,6 +316,8 @@ private func synchronizeInstalledStickerPacks(transaction: Transaction, postbox:
|
||||
collectionNamespace = Namespaces.ItemCollection.CloudStickerPacks
|
||||
case .masks:
|
||||
collectionNamespace = Namespaces.ItemCollection.CloudMaskPacks
|
||||
case .emoji:
|
||||
collectionNamespace = Namespaces.ItemCollection.CloudEmojiPacks
|
||||
}
|
||||
|
||||
let localCollectionInfos = transaction.getItemCollectionsInfos(namespace: collectionNamespace).map { $0.1 as! StickerPackCollectionInfo }
|
||||
@@ -435,6 +441,8 @@ private func continueSynchronizeInstalledStickerPacks(transaction: Transaction,
|
||||
collectionNamespace = Namespaces.ItemCollection.CloudStickerPacks
|
||||
case .masks:
|
||||
collectionNamespace = Namespaces.ItemCollection.CloudMaskPacks
|
||||
case .emoji:
|
||||
collectionNamespace = Namespaces.ItemCollection.CloudEmojiPacks
|
||||
}
|
||||
|
||||
let localCollectionInfos = transaction.getItemCollectionsInfos(namespace: collectionNamespace).map { $0.1 as! StickerPackCollectionInfo }
|
||||
@@ -446,6 +454,8 @@ private func continueSynchronizeInstalledStickerPacks(transaction: Transaction,
|
||||
request = network.request(Api.functions.messages.getAllStickers(hash: initialLocalHash))
|
||||
case .masks:
|
||||
request = network.request(Api.functions.messages.getMaskStickers(hash: initialLocalHash))
|
||||
case .emoji:
|
||||
request = network.request(Api.functions.messages.getEmojiStickers(hash: initialLocalHash))
|
||||
}
|
||||
|
||||
let sequence = request
|
||||
|
||||
Reference in New Issue
Block a user