Resource API refactoring

This commit is contained in:
Ali
2021-03-29 21:20:08 +04:00
parent 76b8cba0c9
commit d1160beadf
52 changed files with 365 additions and 494 deletions

View File

@@ -32,26 +32,6 @@ private func setupSharedLogger(rootPath: String, path: String) {
}
}
private func parseFileLocationResource(_ dict: [AnyHashable: Any]) -> TelegramMediaResource? {
guard let datacenterId = dict["datacenterId"] as? Int32 else {
return nil
}
guard let volumeId = dict["volumeId"] as? Int64 else {
return nil
}
guard let localId = dict["localId"] as? Int32 else {
return nil
}
guard let secret = dict["secret"] as? Int64 else {
return nil
}
var fileReference: Data?
if let fileReferenceString = dict["fileReference"] as? String {
fileReference = dataWithHexString(fileReferenceString)
}
return CloudFileMediaResource(datacenterId: Int(datacenterId), volumeId: volumeId, localId: localId, secret: secret, size: nil, fileReference: fileReference)
}
public struct NotificationViewControllerInitializationData {
public let appGroupPath: String
public let apiId: Int32