mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-19 13:14:09 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
491 B
Swift
17 lines
491 B
Swift
import Foundation
|
|
import Postbox
|
|
|
|
public func decryptedResourceData(data: MediaResourceData, resource: MediaResource, params: Any) -> Data? {
|
|
guard data.complete else {
|
|
return nil
|
|
}
|
|
guard let data = try? Data(contentsOf: URL(fileURLWithPath: data.path), options: [.mappedRead]) else {
|
|
return nil
|
|
}
|
|
if let resource = resource as? EncryptedMediaResource {
|
|
return resource.decrypt(data: data, params: params)
|
|
} else {
|
|
return data
|
|
}
|
|
}
|