mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-30 03:44:18 +00:00
32 lines
798 B
Swift
32 lines
798 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
#else
|
|
import Postbox
|
|
#endif
|
|
|
|
public protocol TelegramMediaLocation: Coding {
|
|
var uniqueId: String { get }
|
|
|
|
func equalsTo(_ other: TelegramMediaLocation) -> Bool
|
|
}
|
|
|
|
public protocol TelegramCloudMediaLocation {
|
|
var datacenterId: Int { get }
|
|
var apiInputLocation: Api.InputFileLocation { get }
|
|
}
|
|
|
|
public extension TelegramMediaLocation {
|
|
public var cloudLocation: TelegramCloudMediaLocation! {
|
|
switch self {
|
|
case let location as TelegramCloudFileLocation:
|
|
return location
|
|
case let location as TelegramCloudDocumentLocation:
|
|
return location
|
|
case _:
|
|
assertionFailure("not supported")
|
|
return nil
|
|
}
|
|
}
|
|
}
|