Update API

This commit is contained in:
Ali
2021-07-23 18:41:15 +02:00
parent cdc2ce8447
commit e4043b28e4
14 changed files with 102 additions and 91 deletions

View File

@@ -3,18 +3,13 @@ import Postbox
import TelegramApi
import SwiftSignalKit
private func hashForIds(_ ids: [Int64]) -> Int32 {
var acc: UInt32 = 0
var acc: UInt64 = 0
for id in ids {
let low = UInt32(UInt64(bitPattern: id) & (0xffffffff as UInt64))
let high = UInt32((UInt64(bitPattern: id) >> 32) & (0xffffffff as UInt64))
acc = (acc &* 20261) &+ high
acc = (acc &* 20261) &+ low
acc = (acc &* 20261) &+ UInt64(bitPattern: id)
}
return Int32(bitPattern: acc & UInt32(0x7FFFFFFF))
return Int32(bitPattern: UInt32(clamping: acc & UInt64(0xFFFFFFFF)))
}
private func managedRecentMedia(postbox: Postbox, network: Network, collectionId: Int32, reverseHashOrder: Bool, forceFetch: Bool, fetch: @escaping (Int32) -> Signal<[OrderedItemListEntry]?, NoError>) -> Signal<Void, NoError> {