From d5fbd880ec05a551218f4b90258f0a68b9a0fabd Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 15 Oct 2020 18:18:18 +0400 Subject: [PATCH] Api update [skip ci] --- submodules/TelegramApi/Sources/Api0.swift | 2 +- submodules/TelegramApi/Sources/Api1.swift | 24 +++++++++++-------- .../Sources/CachedChannelData.swift | 2 +- .../TelegramCore/Sources/InstantPage.swift | 2 +- .../Sources/TelegramMediaMap.swift | 2 +- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index d82a24b315..8ad7e05cff 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -623,7 +623,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[668375447] = { return Api.InputFileLocation.parse_inputPeerPhotoFileLocation($0) } dict[230353641] = { return Api.InputFileLocation.parse_inputStickerSetThumb($0) } dict[286776671] = { return Api.GeoPoint.parse_geoPointEmpty($0) } - dict[-955487525] = { return Api.GeoPoint.parse_geoPoint($0) } + dict[-1297942941] = { return Api.GeoPoint.parse_geoPoint($0) } dict[506920429] = { return Api.InputPhoneCall.parse_inputPhoneCall($0) } dict[-1551583367] = { return Api.ReceivedNotifyMessage.parse_receivedNotifyMessage($0) } dict[-57668565] = { return Api.ChatParticipants.parse_chatParticipantsForbidden($0) } diff --git a/submodules/TelegramApi/Sources/Api1.swift b/submodules/TelegramApi/Sources/Api1.swift index b6bfa9658f..6adfb5aa76 100644 --- a/submodules/TelegramApi/Sources/Api1.swift +++ b/submodules/TelegramApi/Sources/Api1.swift @@ -18085,7 +18085,7 @@ public extension Api { } public enum GeoPoint: TypeConstructorDescription { case geoPointEmpty - case geoPoint(flags: Int32, long: Double, lat: Double, accuracyRadius: Int32?) + case geoPoint(flags: Int32, long: Double, lat: Double, accessHash: Int64, accuracyRadius: Int32?) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -18095,13 +18095,14 @@ public extension Api { } break - case .geoPoint(let flags, let long, let lat, let accuracyRadius): + case .geoPoint(let flags, let long, let lat, let accessHash, let accuracyRadius): if boxed { - buffer.appendInt32(-955487525) + buffer.appendInt32(-1297942941) } serializeInt32(flags, buffer: buffer, boxed: false) serializeDouble(long, buffer: buffer, boxed: false) serializeDouble(lat, buffer: buffer, boxed: false) + serializeInt64(accessHash, buffer: buffer, boxed: false) if Int(flags) & Int(1 << 0) != 0 {serializeInt32(accuracyRadius!, buffer: buffer, boxed: false)} break } @@ -18111,8 +18112,8 @@ public extension Api { switch self { case .geoPointEmpty: return ("geoPointEmpty", []) - case .geoPoint(let flags, let long, let lat, let accuracyRadius): - return ("geoPoint", [("flags", flags), ("long", long), ("lat", lat), ("accuracyRadius", accuracyRadius)]) + case .geoPoint(let flags, let long, let lat, let accessHash, let accuracyRadius): + return ("geoPoint", [("flags", flags), ("long", long), ("lat", lat), ("accessHash", accessHash), ("accuracyRadius", accuracyRadius)]) } } @@ -18126,14 +18127,17 @@ public extension Api { _2 = reader.readDouble() var _3: Double? _3 = reader.readDouble() - var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } + var _4: Int64? + _4 = reader.readInt64() + var _5: Int32? + if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.GeoPoint.geoPoint(flags: _1!, long: _2!, lat: _3!, accuracyRadius: _4) + let _c4 = _4 != nil + let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.GeoPoint.geoPoint(flags: _1!, long: _2!, lat: _3!, accessHash: _4!, accuracyRadius: _5) } else { return nil diff --git a/submodules/TelegramCore/Sources/CachedChannelData.swift b/submodules/TelegramCore/Sources/CachedChannelData.swift index b74558465c..3653967727 100644 --- a/submodules/TelegramCore/Sources/CachedChannelData.swift +++ b/submodules/TelegramCore/Sources/CachedChannelData.swift @@ -8,7 +8,7 @@ extension PeerGeoLocation { init?(apiLocation: Api.ChannelLocation) { switch apiLocation { case let .channelLocation(geopoint, address): - if case let .geoPoint(_, longitude, latitude, _) = geopoint { + if case let .geoPoint(_, longitude, latitude, _, _) = geopoint { self.init(latitude: latitude, longitude: longitude, address: address) } else { return nil diff --git a/submodules/TelegramCore/Sources/InstantPage.swift b/submodules/TelegramCore/Sources/InstantPage.swift index 350d13aeb8..9366e88376 100644 --- a/submodules/TelegramCore/Sources/InstantPage.swift +++ b/submodules/TelegramCore/Sources/InstantPage.swift @@ -158,7 +158,7 @@ extension InstantPageBlock { self = .relatedArticles(title: RichText(apiText: title), articles: articles.map({ InstantPageRelatedArticle(apiRelatedArticle: $0) })) case let .pageBlockMap(geo, zoom, w, h, caption): switch geo { - case let .geoPoint(_, long, lat, _): + case let .geoPoint(_, long, lat, _, _): self = .map(latitude: lat, longitude: long, zoom: zoom, dimensions: PixelDimensions(width: w, height: h), caption: InstantPageCaption(apiCaption: caption)) default: self = .unsupported diff --git a/submodules/TelegramCore/Sources/TelegramMediaMap.swift b/submodules/TelegramCore/Sources/TelegramMediaMap.swift index 85d757de28..5dc6819290 100644 --- a/submodules/TelegramCore/Sources/TelegramMediaMap.swift +++ b/submodules/TelegramCore/Sources/TelegramMediaMap.swift @@ -10,7 +10,7 @@ func telegramMediaMapFromApiGeoPoint(_ geo: Api.GeoPoint, title: String?, addres venue = MapVenue(title: title, address: address, provider: provider, id: venueId, type: venueType) } switch geo { - case let .geoPoint(_, long, lat, accuracyRadius): + case let .geoPoint(_, long, lat, accessHash, accuracyRadius): return TelegramMediaMap(latitude: lat, longitude: long, geoPlace: nil, venue: venue, liveBroadcastingTimeout: liveBroadcastingTimeout) case .geoPointEmpty: return TelegramMediaMap(latitude: 0.0, longitude: 0.0, geoPlace: nil, venue: venue, liveBroadcastingTimeout: liveBroadcastingTimeout)