From 556002df68eea288bfa74e9e1ce2ce7ab3c9b341 Mon Sep 17 00:00:00 2001 From: overtake Date: Fri, 5 Mar 2021 15:02:28 +0400 Subject: [PATCH] update api --- submodules/TelegramApi/Sources/Api0.swift | 2 +- submodules/TelegramApi/Sources/Api2.swift | 12 ++++---- submodules/TelegramApi/Sources/Api4.swift | 28 +++++++++---------- .../TelegramCore/Sources/GroupCalls.swift | 11 ++++---- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index 9d38265344..6ce5491a37 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -142,7 +142,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[767652808] = { return Api.InputEncryptedFile.parse_inputEncryptedFileBigUploaded($0) } dict[1304052993] = { return Api.account.Takeout.parse_takeout($0) } dict[-1456996667] = { return Api.messages.InactiveChats.parse_inactiveChats($0) } - dict[2085094779] = { return Api.GroupCallParticipant.parse_groupCallParticipant($0) } + dict[430815881] = { return Api.GroupCallParticipant.parse_groupCallParticipant($0) } dict[1443858741] = { return Api.messages.SentEncryptedMessage.parse_sentEncryptedMessage($0) } dict[-1802240206] = { return Api.messages.SentEncryptedMessage.parse_sentEncryptedFile($0) } dict[289586518] = { return Api.SavedContact.parse_savedPhoneContact($0) } diff --git a/submodules/TelegramApi/Sources/Api2.swift b/submodules/TelegramApi/Sources/Api2.swift index ca971baefa..24a6329118 100644 --- a/submodules/TelegramApi/Sources/Api2.swift +++ b/submodules/TelegramApi/Sources/Api2.swift @@ -3604,19 +3604,19 @@ public extension Api { } public enum GroupCallParticipant: TypeConstructorDescription { - case groupCallParticipant(flags: Int32, peer: Api.Peer, date: Int32, activeDate: Int32?, source: Int32?, volume: Int32?, about: String?, raiseHandRating: Int64?) + case groupCallParticipant(flags: Int32, peer: Api.Peer, date: Int32, activeDate: Int32?, source: Int32, volume: Int32?, about: String?, raiseHandRating: Int64?) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { case .groupCallParticipant(let flags, let peer, let date, let activeDate, let source, let volume, let about, let raiseHandRating): if boxed { - buffer.appendInt32(2085094779) + buffer.appendInt32(430815881) } serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) serializeInt32(date, buffer: buffer, boxed: false) if Int(flags) & Int(1 << 3) != 0 {serializeInt32(activeDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt32(source!, buffer: buffer, boxed: false)} + serializeInt32(source, buffer: buffer, boxed: false) if Int(flags) & Int(1 << 7) != 0 {serializeInt32(volume!, buffer: buffer, boxed: false)} if Int(flags) & Int(1 << 11) != 0 {serializeString(about!, buffer: buffer, boxed: false)} if Int(flags) & Int(1 << 13) != 0 {serializeInt64(raiseHandRating!, buffer: buffer, boxed: false)} @@ -3643,7 +3643,7 @@ public extension Api { var _4: Int32? if Int(_1!) & Int(1 << 3) != 0 {_4 = reader.readInt32() } var _5: Int32? - if Int(_1!) & Int(1 << 12) != 0 {_5 = reader.readInt32() } + _5 = reader.readInt32() var _6: Int32? if Int(_1!) & Int(1 << 7) != 0 {_6 = reader.readInt32() } var _7: String? @@ -3654,12 +3654,12 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 12) == 0) || _5 != nil + let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 7) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 11) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 13) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.GroupCallParticipant.groupCallParticipant(flags: _1!, peer: _2!, date: _3!, activeDate: _4, source: _5, volume: _6, about: _7, raiseHandRating: _8) + return Api.GroupCallParticipant.groupCallParticipant(flags: _1!, peer: _2!, date: _3!, activeDate: _4, source: _5!, volume: _6, about: _7, raiseHandRating: _8) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api4.swift b/submodules/TelegramApi/Sources/Api4.swift index 234b9a7805..6b458629fb 100644 --- a/submodules/TelegramApi/Sources/Api4.swift +++ b/submodules/TelegramApi/Sources/Api4.swift @@ -1803,20 +1803,6 @@ public struct phone { public extension Api { public struct functions { public struct messages { - public static func checkHistoryImportPeer(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1573261059) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.checkHistoryImportPeer", parameters: [("peer", peer)]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.CheckedHistoryImportPeer? in - let reader = BufferReader(buffer) - var result: Api.messages.CheckedHistoryImportPeer? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.CheckedHistoryImportPeer - } - return result - }) - } - public static func getMessages(id: [Api.InputMessage]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() buffer.appendInt32(1673946374) @@ -4174,6 +4160,20 @@ public extension Api { return result }) } + + public static func checkHistoryImportPeer(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1573261059) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.checkHistoryImportPeer", parameters: [("peer", peer)]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.CheckedHistoryImportPeer? in + let reader = BufferReader(buffer) + var result: Api.messages.CheckedHistoryImportPeer? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.CheckedHistoryImportPeer + } + return result + }) + } } public struct channels { public static func readHistory(channel: Api.InputChannel, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { diff --git a/submodules/TelegramCore/Sources/GroupCalls.swift b/submodules/TelegramCore/Sources/GroupCalls.swift index 6a80037bdb..7064580dbd 100644 --- a/submodules/TelegramCore/Sources/GroupCalls.swift +++ b/submodules/TelegramCore/Sources/GroupCalls.swift @@ -147,7 +147,8 @@ public func getCurrentGroupCall(account: Account, callId: Int64, accessHash: Int activityRank: nil, muteState: muteState, volume: volume, - about: about + about: about, + raiseHandRating: raiseHandRating )) } } @@ -667,7 +668,7 @@ public final class GroupCallParticipantsContext { public var muteState: MuteState? public var volume: Int32? public var about: String? - public var raiseHandRating: Int32? + public var raiseHandRating: Int64? public init( peer: Peer, ssrc: UInt32, @@ -678,7 +679,7 @@ public final class GroupCallParticipantsContext { muteState: MuteState?, volume: Int32?, about: String?, - raiseHandRating: Int32? + raiseHandRating: Int64? ) { self.peer = peer self.ssrc = ssrc @@ -822,7 +823,7 @@ public final class GroupCallParticipantsContext { public var participationStatusChange: ParticipationStatusChange public var volume: Int32? public var about: String? - public var raiseHandRating: Int32? + public var raiseHandRating: Int64? init( peerId: PeerId, ssrc: UInt32, @@ -833,7 +834,7 @@ public final class GroupCallParticipantsContext { participationStatusChange: ParticipationStatusChange, volume: Int32?, about: String?, - raiseHandRating: Int32? + raiseHandRating: Int64? ) { self.peerId = peerId self.ssrc = ssrc