mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Initial public API refactoring experiment
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
import TelegramApi
|
||||
|
||||
import SyncCore
|
||||
|
||||
extension SecureFileMediaResource: TelegramCloudMediaResource, TelegramMultipartFetchableResource, EncryptedMediaResource {
|
||||
func apiInputLocation(fileReference: Data?) -> Api.InputFileLocation? {
|
||||
return Api.InputFileLocation.inputSecureFileLocation(id: self.file.id, accessHash: self.file.accessHash)
|
||||
}
|
||||
|
||||
public func decrypt(data: Data, params: Any) -> Data? {
|
||||
guard let context = params as? SecureIdAccessContext else {
|
||||
return nil
|
||||
}
|
||||
return decryptedSecureIdFile(context: context, encryptedData: data, fileHash: self.file.fileHash, encryptedSecret: self.file.encryptedSecret)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user