mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
21 lines
542 B
Swift
21 lines
542 B
Swift
import Foundation
|
|
import Postbox
|
|
import TelegramApi
|
|
|
|
import SyncCore
|
|
|
|
extension PeerGeoLocation {
|
|
init?(apiLocation: Api.ChannelLocation) {
|
|
switch apiLocation {
|
|
case let .channelLocation(geopoint, address):
|
|
if case let .geoPoint(_, longitude, latitude, _, _) = geopoint {
|
|
self.init(latitude: latitude, longitude: longitude, address: address)
|
|
} else {
|
|
return nil
|
|
}
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
}
|