Api update [skip ci]

This commit is contained in:
Ali 2020-10-15 18:18:18 +04:00
parent c1210945cd
commit d5fbd880ec
5 changed files with 18 additions and 14 deletions

View File

@ -623,7 +623,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[668375447] = { return Api.InputFileLocation.parse_inputPeerPhotoFileLocation($0) } dict[668375447] = { return Api.InputFileLocation.parse_inputPeerPhotoFileLocation($0) }
dict[230353641] = { return Api.InputFileLocation.parse_inputStickerSetThumb($0) } dict[230353641] = { return Api.InputFileLocation.parse_inputStickerSetThumb($0) }
dict[286776671] = { return Api.GeoPoint.parse_geoPointEmpty($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[506920429] = { return Api.InputPhoneCall.parse_inputPhoneCall($0) }
dict[-1551583367] = { return Api.ReceivedNotifyMessage.parse_receivedNotifyMessage($0) } dict[-1551583367] = { return Api.ReceivedNotifyMessage.parse_receivedNotifyMessage($0) }
dict[-57668565] = { return Api.ChatParticipants.parse_chatParticipantsForbidden($0) } dict[-57668565] = { return Api.ChatParticipants.parse_chatParticipantsForbidden($0) }

View File

@ -18085,7 +18085,7 @@ public extension Api {
} }
public enum GeoPoint: TypeConstructorDescription { public enum GeoPoint: TypeConstructorDescription {
case geoPointEmpty 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) { public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self { switch self {
@ -18095,13 +18095,14 @@ public extension Api {
} }
break 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 { if boxed {
buffer.appendInt32(-955487525) buffer.appendInt32(-1297942941)
} }
serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(flags, buffer: buffer, boxed: false)
serializeDouble(long, buffer: buffer, boxed: false) serializeDouble(long, buffer: buffer, boxed: false)
serializeDouble(lat, 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)} if Int(flags) & Int(1 << 0) != 0 {serializeInt32(accuracyRadius!, buffer: buffer, boxed: false)}
break break
} }
@ -18111,8 +18112,8 @@ public extension Api {
switch self { switch self {
case .geoPointEmpty: case .geoPointEmpty:
return ("geoPointEmpty", []) return ("geoPointEmpty", [])
case .geoPoint(let flags, let long, let lat, let accuracyRadius): case .geoPoint(let flags, let long, let lat, let accessHash, let accuracyRadius):
return ("geoPoint", [("flags", flags), ("long", long), ("lat", lat), ("accuracyRadius", accuracyRadius)]) return ("geoPoint", [("flags", flags), ("long", long), ("lat", lat), ("accessHash", accessHash), ("accuracyRadius", accuracyRadius)])
} }
} }
@ -18126,14 +18127,17 @@ public extension Api {
_2 = reader.readDouble() _2 = reader.readDouble()
var _3: Double? var _3: Double?
_3 = reader.readDouble() _3 = reader.readDouble()
var _4: Int32? var _4: Int64?
if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } _4 = reader.readInt64()
var _5: Int32?
if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() }
let _c1 = _1 != nil let _c1 = _1 != nil
let _c2 = _2 != nil let _c2 = _2 != nil
let _c3 = _3 != nil let _c3 = _3 != nil
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c4 = _4 != nil
if _c1 && _c2 && _c3 && _c4 { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil
return Api.GeoPoint.geoPoint(flags: _1!, long: _2!, lat: _3!, accuracyRadius: _4) if _c1 && _c2 && _c3 && _c4 && _c5 {
return Api.GeoPoint.geoPoint(flags: _1!, long: _2!, lat: _3!, accessHash: _4!, accuracyRadius: _5)
} }
else { else {
return nil return nil

View File

@ -8,7 +8,7 @@ extension PeerGeoLocation {
init?(apiLocation: Api.ChannelLocation) { init?(apiLocation: Api.ChannelLocation) {
switch apiLocation { switch apiLocation {
case let .channelLocation(geopoint, address): 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) self.init(latitude: latitude, longitude: longitude, address: address)
} else { } else {
return nil return nil

View File

@ -158,7 +158,7 @@ extension InstantPageBlock {
self = .relatedArticles(title: RichText(apiText: title), articles: articles.map({ InstantPageRelatedArticle(apiRelatedArticle: $0) })) self = .relatedArticles(title: RichText(apiText: title), articles: articles.map({ InstantPageRelatedArticle(apiRelatedArticle: $0) }))
case let .pageBlockMap(geo, zoom, w, h, caption): case let .pageBlockMap(geo, zoom, w, h, caption):
switch geo { 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)) self = .map(latitude: lat, longitude: long, zoom: zoom, dimensions: PixelDimensions(width: w, height: h), caption: InstantPageCaption(apiCaption: caption))
default: default:
self = .unsupported self = .unsupported

View File

@ -10,7 +10,7 @@ func telegramMediaMapFromApiGeoPoint(_ geo: Api.GeoPoint, title: String?, addres
venue = MapVenue(title: title, address: address, provider: provider, id: venueId, type: venueType) venue = MapVenue(title: title, address: address, provider: provider, id: venueId, type: venueType)
} }
switch geo { 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) return TelegramMediaMap(latitude: lat, longitude: long, geoPlace: nil, venue: venue, liveBroadcastingTimeout: liveBroadcastingTimeout)
case .geoPointEmpty: case .geoPointEmpty:
return TelegramMediaMap(latitude: 0.0, longitude: 0.0, geoPlace: nil, venue: venue, liveBroadcastingTimeout: liveBroadcastingTimeout) return TelegramMediaMap(latitude: 0.0, longitude: 0.0, geoPlace: nil, venue: venue, liveBroadcastingTimeout: liveBroadcastingTimeout)