mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Update API
This commit is contained in:
parent
cb7560a34e
commit
f8196ba656
@ -110,6 +110,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-867328308] = { return Api.BusinessAwayMessageSchedule.parse_businessAwayMessageScheduleCustom($0) }
|
||||
dict[-1007487743] = { return Api.BusinessAwayMessageSchedule.parse_businessAwayMessageScheduleOutsideWorkHours($0) }
|
||||
dict[-1198722189] = { return Api.BusinessBotRecipients.parse_businessBotRecipients($0) }
|
||||
dict[-1263638929] = { return Api.BusinessChatLink.parse_businessChatLink($0) }
|
||||
dict[-451302485] = { return Api.BusinessGreetingMessage.parse_businessGreetingMessage($0) }
|
||||
dict[1510606445] = { return Api.BusinessIntro.parse_businessIntro($0) }
|
||||
dict[-1403249929] = { return Api.BusinessLocation.parse_businessLocation($0) }
|
||||
@ -316,6 +317,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-1462213465] = { return Api.InputBotInlineResult.parse_inputBotInlineResultPhoto($0) }
|
||||
dict[-2094959136] = { return Api.InputBusinessAwayMessage.parse_inputBusinessAwayMessage($0) }
|
||||
dict[-991587810] = { return Api.InputBusinessBotRecipients.parse_inputBusinessBotRecipients($0) }
|
||||
dict[292003751] = { return Api.InputBusinessChatLink.parse_inputBusinessChatLink($0) }
|
||||
dict[26528571] = { return Api.InputBusinessGreetingMessage.parse_inputBusinessGreetingMessage($0) }
|
||||
dict[163867085] = { return Api.InputBusinessIntro.parse_inputBusinessIntro($0) }
|
||||
dict[1871393450] = { return Api.InputBusinessRecipients.parse_inputBusinessRecipients($0) }
|
||||
@ -472,6 +474,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[736157604] = { return Api.JSONValue.parse_jsonNumber($0) }
|
||||
dict[-1715350371] = { return Api.JSONValue.parse_jsonObject($0) }
|
||||
dict[-1222740358] = { return Api.JSONValue.parse_jsonString($0) }
|
||||
dict[-916050683] = { return Api.KeyboardButton.parse_inputKeyboardButtonRequestPeer($0) }
|
||||
dict[-802258988] = { return Api.KeyboardButton.parse_inputKeyboardButtonUrlAuth($0) }
|
||||
dict[-376962181] = { return Api.KeyboardButton.parse_inputKeyboardButtonUserProfile($0) }
|
||||
dict[-1560655744] = { return Api.KeyboardButton.parse_keyboardButton($0) }
|
||||
@ -537,6 +540,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-2132731265] = { return Api.MessageAction.parse_messageActionPhoneCall($0) }
|
||||
dict[-1799538451] = { return Api.MessageAction.parse_messageActionPinMessage($0) }
|
||||
dict[827428507] = { return Api.MessageAction.parse_messageActionRequestedPeer($0) }
|
||||
dict[-1816979384] = { return Api.MessageAction.parse_messageActionRequestedPeerSentMe($0) }
|
||||
dict[1200788123] = { return Api.MessageAction.parse_messageActionScreenshotTaken($0) }
|
||||
dict[-648257196] = { return Api.MessageAction.parse_messageActionSecureValuesSent($0) }
|
||||
dict[455635795] = { return Api.MessageAction.parse_messageActionSecureValuesSentMe($0) }
|
||||
@ -615,6 +619,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[2129714567] = { return Api.MessagesFilter.parse_inputMessagesFilterUrl($0) }
|
||||
dict[-1614803355] = { return Api.MessagesFilter.parse_inputMessagesFilterVideo($0) }
|
||||
dict[1358283666] = { return Api.MessagesFilter.parse_inputMessagesFilterVoice($0) }
|
||||
dict[1653379620] = { return Api.MissingInvitee.parse_missingInvitee($0) }
|
||||
dict[-1001897636] = { return Api.MyBoost.parse_myBoost($0) }
|
||||
dict[-1910892683] = { return Api.NearestDc.parse_nearestDc($0) }
|
||||
dict[-1746354498] = { return Api.NotificationSound.parse_notificationSoundDefault($0) }
|
||||
@ -681,7 +686,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-1721619444] = { return Api.PeerNotifySettings.parse_peerNotifySettings($0) }
|
||||
dict[-1395233698] = { return Api.PeerSettings.parse_peerSettings($0) }
|
||||
dict[-1707742823] = { return Api.PeerStories.parse_peerStories($0) }
|
||||
dict[-1770029977] = { return Api.PhoneCall.parse_phoneCall($0) }
|
||||
dict[810769141] = { return Api.PhoneCall.parse_phoneCall($0) }
|
||||
dict[912311057] = { return Api.PhoneCall.parse_phoneCallAccepted($0) }
|
||||
dict[1355435489] = { return Api.PhoneCall.parse_phoneCallDiscarded($0) }
|
||||
dict[1399245077] = { return Api.PhoneCall.parse_phoneCallEmpty($0) }
|
||||
@ -766,6 +771,9 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[865857388] = { return Api.RequestPeerType.parse_requestPeerTypeBroadcast($0) }
|
||||
dict[-906990053] = { return Api.RequestPeerType.parse_requestPeerTypeChat($0) }
|
||||
dict[1597737472] = { return Api.RequestPeerType.parse_requestPeerTypeUser($0) }
|
||||
dict[-1952185372] = { return Api.RequestedPeer.parse_requestedPeerChannel($0) }
|
||||
dict[1929860175] = { return Api.RequestedPeer.parse_requestedPeerChat($0) }
|
||||
dict[-701500310] = { return Api.RequestedPeer.parse_requestedPeerUser($0) }
|
||||
dict[-797791052] = { return Api.RestrictionReason.parse_restrictionReason($0) }
|
||||
dict[894777186] = { return Api.RichText.parse_textAnchor($0) }
|
||||
dict[1730456516] = { return Api.RichText.parse_textBold($0) }
|
||||
@ -847,6 +855,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-2010155333] = { return Api.SimpleWebViewResult.parse_simpleWebViewResultUrl($0) }
|
||||
dict[-425595208] = { return Api.SmsJob.parse_smsJob($0) }
|
||||
dict[-313293833] = { return Api.SponsoredMessage.parse_sponsoredMessage($0) }
|
||||
dict[1124938064] = { return Api.SponsoredMessageReportOption.parse_sponsoredMessageReportOption($0) }
|
||||
dict[1035529315] = { return Api.SponsoredWebPage.parse_sponsoredWebPage($0) }
|
||||
dict[-884757282] = { return Api.StatsAbsValueAndPrev.parse_statsAbsValueAndPrev($0) }
|
||||
dict[-1237848657] = { return Api.StatsDateRangeDays.parse_statsDateRangeDays($0) }
|
||||
@ -1038,7 +1047,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-1831650802] = { return Api.UrlAuthResult.parse_urlAuthResultRequest($0) }
|
||||
dict[559694904] = { return Api.User.parse_user($0) }
|
||||
dict[-742634630] = { return Api.User.parse_userEmpty($0) }
|
||||
dict[-321200917] = { return Api.UserFull.parse_userFull($0) }
|
||||
dict[-862357728] = { return Api.UserFull.parse_userFull($0) }
|
||||
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
|
||||
dict[1326562017] = { return Api.UserProfilePhoto.parse_userProfilePhotoEmpty($0) }
|
||||
dict[164646985] = { return Api.UserStatus.parse_userStatusEmpty($0) }
|
||||
@ -1069,6 +1078,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1275039392] = { return Api.account.Authorizations.parse_authorizations($0) }
|
||||
dict[1674235686] = { return Api.account.AutoDownloadSettings.parse_autoDownloadSettings($0) }
|
||||
dict[1279133341] = { return Api.account.AutoSaveSettings.parse_autoSaveSettings($0) }
|
||||
dict[-331111727] = { return Api.account.BusinessChatLinks.parse_businessChatLinks($0) }
|
||||
dict[400029819] = { return Api.account.ConnectedBots.parse_connectedBots($0) }
|
||||
dict[1474462241] = { return Api.account.ContentSettings.parse_contentSettings($0) }
|
||||
dict[731303195] = { return Api.account.EmailVerified.parse_emailVerified($0) }
|
||||
@ -1082,6 +1092,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-478701471] = { return Api.account.ResetPasswordResult.parse_resetPasswordFailedWait($0) }
|
||||
dict[-383330754] = { return Api.account.ResetPasswordResult.parse_resetPasswordOk($0) }
|
||||
dict[-370148227] = { return Api.account.ResetPasswordResult.parse_resetPasswordRequestedWait($0) }
|
||||
dict[-1708937439] = { return Api.account.ResolvedBusinessChatLinks.parse_resolvedBusinessChatLinks($0) }
|
||||
dict[-1222230163] = { return Api.account.SavedRingtone.parse_savedRingtone($0) }
|
||||
dict[523271863] = { return Api.account.SavedRingtone.parse_savedRingtoneConverted($0) }
|
||||
dict[-1041683259] = { return Api.account.SavedRingtones.parse_savedRingtones($0) }
|
||||
@ -1124,6 +1135,9 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-1699676497] = { return Api.channels.ChannelParticipants.parse_channelParticipants($0) }
|
||||
dict[-266911767] = { return Api.channels.ChannelParticipants.parse_channelParticipantsNotModified($0) }
|
||||
dict[-191450938] = { return Api.channels.SendAsPeers.parse_sendAsPeers($0) }
|
||||
dict[1044107055] = { return Api.channels.SponsoredMessageReportResult.parse_sponsoredMessageReportResultAdsHidden($0) }
|
||||
dict[-2073059774] = { return Api.channels.SponsoredMessageReportResult.parse_sponsoredMessageReportResultChooseOption($0) }
|
||||
dict[-1384544183] = { return Api.channels.SponsoredMessageReportResult.parse_sponsoredMessageReportResultReported($0) }
|
||||
dict[500007837] = { return Api.chatlists.ChatlistInvite.parse_chatlistInvite($0) }
|
||||
dict[-91752871] = { return Api.chatlists.ChatlistInvite.parse_chatlistInviteAlready($0) }
|
||||
dict[-1816295539] = { return Api.chatlists.ChatlistUpdates.parse_chatlistUpdates($0) }
|
||||
@ -1212,6 +1226,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[375566091] = { return Api.messages.HistoryImport.parse_historyImport($0) }
|
||||
dict[1578088377] = { return Api.messages.HistoryImportParsed.parse_historyImportParsed($0) }
|
||||
dict[-1456996667] = { return Api.messages.InactiveChats.parse_inactiveChats($0) }
|
||||
dict[2136862630] = { return Api.messages.InvitedUsers.parse_invitedUsers($0) }
|
||||
dict[649453030] = { return Api.messages.MessageEditData.parse_messageEditData($0) }
|
||||
dict[834488621] = { return Api.messages.MessageReactionsList.parse_messageReactionsList($0) }
|
||||
dict[-1228606141] = { return Api.messages.MessageViews.parse_messageViews($0) }
|
||||
@ -1332,7 +1347,7 @@ public extension Api {
|
||||
return parser(reader)
|
||||
}
|
||||
else {
|
||||
telegramApiLog("Type constructor \(String(UInt32(bitPattern: signature), radix: 16, uppercase: false)) not found")
|
||||
telegramApiLog("Type constructor \(String(signature, radix: 16, uppercase: false)) not found")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@ -1432,6 +1447,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.BusinessBotRecipients:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.BusinessChatLink:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.BusinessGreetingMessage:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.BusinessIntro:
|
||||
@ -1600,6 +1617,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputBusinessBotRecipients:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputBusinessChatLink:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputBusinessGreetingMessage:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputBusinessIntro:
|
||||
@ -1744,6 +1763,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MessagesFilter:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MissingInvitee:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MyBoost:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.NearestDc:
|
||||
@ -1852,6 +1873,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.RequestPeerType:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.RequestedPeer:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.RestrictionReason:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.RichText:
|
||||
@ -1900,6 +1923,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SponsoredMessage:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SponsoredMessageReportOption:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SponsoredWebPage:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.StatsAbsValueAndPrev:
|
||||
@ -1994,6 +2019,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.AutoSaveSettings:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.BusinessChatLinks:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.ConnectedBots:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.ContentSettings:
|
||||
@ -2012,6 +2039,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.ResetPasswordResult:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.ResolvedBusinessChatLinks:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.SavedRingtone:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.SavedRingtones:
|
||||
@ -2054,6 +2083,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.channels.SendAsPeers:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.channels.SponsoredMessageReportResult:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.chatlists.ChatlistInvite:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.chatlists.ChatlistUpdates:
|
||||
@ -2176,6 +2207,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.InactiveChats:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.InvitedUsers:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.MessageEditData:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.MessageReactionsList:
|
||||
|
@ -904,6 +904,7 @@ public extension Api {
|
||||
}
|
||||
public extension Api {
|
||||
indirect enum KeyboardButton: TypeConstructorDescription {
|
||||
case inputKeyboardButtonRequestPeer(flags: Int32, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32)
|
||||
case inputKeyboardButtonUrlAuth(flags: Int32, text: String, fwdText: String?, url: String, bot: Api.InputUser)
|
||||
case inputKeyboardButtonUserProfile(text: String, userId: Api.InputUser)
|
||||
case keyboardButton(text: String)
|
||||
@ -923,6 +924,16 @@ public extension Api {
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .inputKeyboardButtonRequestPeer(let flags, let text, let buttonId, let peerType, let maxQuantity):
|
||||
if boxed {
|
||||
buffer.appendInt32(-916050683)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeString(text, buffer: buffer, boxed: false)
|
||||
serializeInt32(buttonId, buffer: buffer, boxed: false)
|
||||
peerType.serialize(buffer, true)
|
||||
serializeInt32(maxQuantity, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .inputKeyboardButtonUrlAuth(let flags, let text, let fwdText, let url, let bot):
|
||||
if boxed {
|
||||
buffer.appendInt32(-802258988)
|
||||
@ -1051,6 +1062,8 @@ public extension Api {
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .inputKeyboardButtonRequestPeer(let flags, let text, let buttonId, let peerType, let maxQuantity):
|
||||
return ("inputKeyboardButtonRequestPeer", [("flags", flags as Any), ("text", text as Any), ("buttonId", buttonId as Any), ("peerType", peerType as Any), ("maxQuantity", maxQuantity as Any)])
|
||||
case .inputKeyboardButtonUrlAuth(let flags, let text, let fwdText, let url, let bot):
|
||||
return ("inputKeyboardButtonUrlAuth", [("flags", flags as Any), ("text", text as Any), ("fwdText", fwdText as Any), ("url", url as Any), ("bot", bot as Any)])
|
||||
case .inputKeyboardButtonUserProfile(let text, let userId):
|
||||
@ -1086,6 +1099,31 @@ public extension Api {
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_inputKeyboardButtonRequestPeer(_ reader: BufferReader) -> KeyboardButton? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
var _4: Api.RequestPeerType?
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.RequestPeerType
|
||||
}
|
||||
var _5: Int32?
|
||||
_5 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.KeyboardButton.inputKeyboardButtonRequestPeer(flags: _1!, text: _2!, buttonId: _3!, peerType: _4!, maxQuantity: _5!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputKeyboardButtonUrlAuth(_ reader: BufferReader) -> KeyboardButton? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
|
@ -911,6 +911,7 @@ public extension Api {
|
||||
case messageActionPhoneCall(flags: Int32, callId: Int64, reason: Api.PhoneCallDiscardReason?, duration: Int32?)
|
||||
case messageActionPinMessage
|
||||
case messageActionRequestedPeer(buttonId: Int32, peers: [Api.Peer])
|
||||
case messageActionRequestedPeerSentMe(buttonId: Int32, peers: [Api.RequestedPeer])
|
||||
case messageActionScreenshotTaken
|
||||
case messageActionSecureValuesSent(types: [Api.SecureValueType])
|
||||
case messageActionSecureValuesSentMe(values: [Api.SecureValue], credentials: Api.SecureCredentialsEncrypted)
|
||||
@ -1164,6 +1165,17 @@ public extension Api {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .messageActionRequestedPeerSentMe(let buttonId, let peers):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1816979384)
|
||||
}
|
||||
serializeInt32(buttonId, buffer: buffer, boxed: false)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(peers.count))
|
||||
for item in peers {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .messageActionScreenshotTaken:
|
||||
if boxed {
|
||||
buffer.appendInt32(1200788123)
|
||||
@ -1317,6 +1329,8 @@ public extension Api {
|
||||
return ("messageActionPinMessage", [])
|
||||
case .messageActionRequestedPeer(let buttonId, let peers):
|
||||
return ("messageActionRequestedPeer", [("buttonId", buttonId as Any), ("peers", peers as Any)])
|
||||
case .messageActionRequestedPeerSentMe(let buttonId, let peers):
|
||||
return ("messageActionRequestedPeerSentMe", [("buttonId", buttonId as Any), ("peers", peers as Any)])
|
||||
case .messageActionScreenshotTaken:
|
||||
return ("messageActionScreenshotTaken", [])
|
||||
case .messageActionSecureValuesSent(let types):
|
||||
@ -1768,6 +1782,22 @@ public extension Api {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_messageActionRequestedPeerSentMe(_ reader: BufferReader) -> MessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: [Api.RequestedPeer]?
|
||||
if let _ = reader.readInt32() {
|
||||
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RequestedPeer.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.MessageAction.messageActionRequestedPeerSentMe(buttonId: _1!, peers: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_messageActionScreenshotTaken(_ reader: BufferReader) -> MessageAction? {
|
||||
return Api.MessageAction.messageActionScreenshotTaken
|
||||
}
|
||||
|
@ -704,6 +704,46 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum MissingInvitee: TypeConstructorDescription {
|
||||
case missingInvitee(flags: Int32, userId: Int64)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .missingInvitee(let flags, let userId):
|
||||
if boxed {
|
||||
buffer.appendInt32(1653379620)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt64(userId, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .missingInvitee(let flags, let userId):
|
||||
return ("missingInvitee", [("flags", flags as Any), ("userId", userId as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_missingInvitee(_ reader: BufferReader) -> MissingInvitee? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.MissingInvitee.missingInvitee(flags: _1!, userId: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum MyBoost: TypeConstructorDescription {
|
||||
case myBoost(flags: Int32, slot: Int32, peer: Api.Peer?, date: Int32, expires: Int32, cooldownUntilDate: Int32?)
|
||||
|
@ -1010,7 +1010,7 @@ public extension Api {
|
||||
}
|
||||
public extension Api {
|
||||
enum PhoneCall: TypeConstructorDescription {
|
||||
case phoneCall(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64, protocol: Api.PhoneCallProtocol, connections: [Api.PhoneConnection], startDate: Int32)
|
||||
case phoneCall(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64, protocol: Api.PhoneCallProtocol, connections: [Api.PhoneConnection], startDate: Int32, customParameters: Api.DataJSON?)
|
||||
case phoneCallAccepted(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gB: Buffer, protocol: Api.PhoneCallProtocol)
|
||||
case phoneCallDiscarded(flags: Int32, id: Int64, reason: Api.PhoneCallDiscardReason?, duration: Int32?)
|
||||
case phoneCallEmpty(id: Int64)
|
||||
@ -1019,9 +1019,9 @@ public extension Api {
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .phoneCall(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint, let `protocol`, let connections, let startDate):
|
||||
case .phoneCall(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint, let `protocol`, let connections, let startDate, let customParameters):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1770029977)
|
||||
buffer.appendInt32(810769141)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt64(id, buffer: buffer, boxed: false)
|
||||
@ -1038,6 +1038,7 @@ public extension Api {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
serializeInt32(startDate, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 7) != 0 {customParameters!.serialize(buffer, true)}
|
||||
break
|
||||
case .phoneCallAccepted(let flags, let id, let accessHash, let date, let adminId, let participantId, let gB, let `protocol`):
|
||||
if boxed {
|
||||
@ -1098,8 +1099,8 @@ public extension Api {
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .phoneCall(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint, let `protocol`, let connections, let startDate):
|
||||
return ("phoneCall", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gAOrB", gAOrB as Any), ("keyFingerprint", keyFingerprint as Any), ("`protocol`", `protocol` as Any), ("connections", connections as Any), ("startDate", startDate as Any)])
|
||||
case .phoneCall(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint, let `protocol`, let connections, let startDate, let customParameters):
|
||||
return ("phoneCall", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gAOrB", gAOrB as Any), ("keyFingerprint", keyFingerprint as Any), ("`protocol`", `protocol` as Any), ("connections", connections as Any), ("startDate", startDate as Any), ("customParameters", customParameters as Any)])
|
||||
case .phoneCallAccepted(let flags, let id, let accessHash, let date, let adminId, let participantId, let gB, let `protocol`):
|
||||
return ("phoneCallAccepted", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gB", gB as Any), ("`protocol`", `protocol` as Any)])
|
||||
case .phoneCallDiscarded(let flags, let id, let reason, let duration):
|
||||
@ -1140,6 +1141,10 @@ public extension Api {
|
||||
}
|
||||
var _11: Int32?
|
||||
_11 = reader.readInt32()
|
||||
var _12: Api.DataJSON?
|
||||
if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() {
|
||||
_12 = Api.parse(reader, signature: signature) as? Api.DataJSON
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
@ -1151,8 +1156,9 @@ public extension Api {
|
||||
let _c9 = _9 != nil
|
||||
let _c10 = _10 != nil
|
||||
let _c11 = _11 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 {
|
||||
return Api.PhoneCall.phoneCall(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAOrB: _7!, keyFingerprint: _8!, protocol: _9!, connections: _10!, startDate: _11!)
|
||||
let _c12 = (Int(_1!) & Int(1 << 7) == 0) || _12 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 {
|
||||
return Api.PhoneCall.phoneCall(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAOrB: _7!, keyFingerprint: _8!, protocol: _9!, connections: _10!, startDate: _11!, customParameters: _12)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
@ -896,6 +896,68 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum BusinessChatLink: TypeConstructorDescription {
|
||||
case businessChatLink(flags: Int32, link: String, message: String, entities: [Api.MessageEntity]?, title: String?, views: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .businessChatLink(let flags, let link, let message, let entities, let title, let views):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1263638929)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeString(link, buffer: buffer, boxed: false)
|
||||
serializeString(message, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
for item in entities! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
||||
serializeInt32(views, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .businessChatLink(let flags, let link, let message, let entities, let title, let views):
|
||||
return ("businessChatLink", [("flags", flags as Any), ("link", link as Any), ("message", message as Any), ("entities", entities as Any), ("title", title as Any), ("views", views as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_businessChatLink(_ reader: BufferReader) -> BusinessChatLink? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: String?
|
||||
_3 = parseString(reader)
|
||||
var _4: [Api.MessageEntity]?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() {
|
||||
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||
} }
|
||||
var _5: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) }
|
||||
var _6: Int32?
|
||||
_6 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
||||
let _c6 = _6 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
||||
return Api.BusinessChatLink.businessChatLink(flags: _1!, link: _2!, message: _3!, entities: _4, title: _5, views: _6!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum BusinessGreetingMessage: TypeConstructorDescription {
|
||||
case businessGreetingMessage(shortcutId: Int32, recipients: Api.BusinessRecipients, noActivityDays: Int32)
|
||||
@ -1174,45 +1236,3 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum CdnConfig: TypeConstructorDescription {
|
||||
case cdnConfig(publicKeys: [Api.CdnPublicKey])
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .cdnConfig(let publicKeys):
|
||||
if boxed {
|
||||
buffer.appendInt32(1462101002)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(publicKeys.count))
|
||||
for item in publicKeys {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .cdnConfig(let publicKeys):
|
||||
return ("cdnConfig", [("publicKeys", publicKeys as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_cdnConfig(_ reader: BufferReader) -> CdnConfig? {
|
||||
var _1: [Api.CdnPublicKey]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.CdnPublicKey.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.CdnConfig.cdnConfig(publicKeys: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -128,6 +128,136 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum RequestedPeer: TypeConstructorDescription {
|
||||
case requestedPeerChannel(flags: Int32, channelId: Int64, title: String?, username: String?, photo: Api.Photo?)
|
||||
case requestedPeerChat(flags: Int32, chatId: Int64, title: String?, photo: Api.Photo?)
|
||||
case requestedPeerUser(flags: Int32, userId: Int64, firstName: String?, lastName: String?, username: String?, photo: Api.Photo?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .requestedPeerChannel(let flags, let channelId, let title, let username, let photo):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1952185372)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt64(channelId, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(username!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)}
|
||||
break
|
||||
case .requestedPeerChat(let flags, let chatId, let title, let photo):
|
||||
if boxed {
|
||||
buffer.appendInt32(1929860175)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt64(chatId, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)}
|
||||
break
|
||||
case .requestedPeerUser(let flags, let userId, let firstName, let lastName, let username, let photo):
|
||||
if boxed {
|
||||
buffer.appendInt32(-701500310)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt64(userId, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(firstName!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(lastName!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(username!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .requestedPeerChannel(let flags, let channelId, let title, let username, let photo):
|
||||
return ("requestedPeerChannel", [("flags", flags as Any), ("channelId", channelId as Any), ("title", title as Any), ("username", username as Any), ("photo", photo as Any)])
|
||||
case .requestedPeerChat(let flags, let chatId, let title, let photo):
|
||||
return ("requestedPeerChat", [("flags", flags as Any), ("chatId", chatId as Any), ("title", title as Any), ("photo", photo as Any)])
|
||||
case .requestedPeerUser(let flags, let userId, let firstName, let lastName, let username, let photo):
|
||||
return ("requestedPeerUser", [("flags", flags as Any), ("userId", userId as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("username", username as Any), ("photo", photo as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_requestedPeerChannel(_ reader: BufferReader) -> RequestedPeer? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
var _3: String?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) }
|
||||
var _4: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) }
|
||||
var _5: Api.Photo?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
||||
_5 = Api.parse(reader, signature: signature) as? Api.Photo
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.RequestedPeer.requestedPeerChannel(flags: _1!, channelId: _2!, title: _3, username: _4, photo: _5)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_requestedPeerChat(_ reader: BufferReader) -> RequestedPeer? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
var _3: String?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) }
|
||||
var _4: Api.Photo?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.Photo
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.RequestedPeer.requestedPeerChat(flags: _1!, chatId: _2!, title: _3, photo: _4)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_requestedPeerUser(_ reader: BufferReader) -> RequestedPeer? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
var _3: String?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) }
|
||||
var _4: String?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) }
|
||||
var _5: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) }
|
||||
var _6: Api.Photo?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
||||
_6 = Api.parse(reader, signature: signature) as? Api.Photo
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
||||
let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
||||
return Api.RequestedPeer.requestedPeerUser(flags: _1!, userId: _2!, firstName: _3, lastName: _4, username: _5, photo: _6)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum RestrictionReason: TypeConstructorDescription {
|
||||
case restrictionReason(platform: String, reason: String, text: String)
|
||||
@ -954,71 +1084,3 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum SecurePasswordKdfAlgo: TypeConstructorDescription {
|
||||
case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: Buffer)
|
||||
case securePasswordKdfAlgoSHA512(salt: Buffer)
|
||||
case securePasswordKdfAlgoUnknown
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let salt):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1141711456)
|
||||
}
|
||||
serializeBytes(salt, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .securePasswordKdfAlgoSHA512(let salt):
|
||||
if boxed {
|
||||
buffer.appendInt32(-2042159726)
|
||||
}
|
||||
serializeBytes(salt, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .securePasswordKdfAlgoUnknown:
|
||||
if boxed {
|
||||
buffer.appendInt32(4883767)
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let salt):
|
||||
return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", salt as Any)])
|
||||
case .securePasswordKdfAlgoSHA512(let salt):
|
||||
return ("securePasswordKdfAlgoSHA512", [("salt", salt as Any)])
|
||||
case .securePasswordKdfAlgoUnknown:
|
||||
return ("securePasswordKdfAlgoUnknown", [])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(_ reader: BufferReader) -> SecurePasswordKdfAlgo? {
|
||||
var _1: Buffer?
|
||||
_1 = parseBytes(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_securePasswordKdfAlgoSHA512(_ reader: BufferReader) -> SecurePasswordKdfAlgo? {
|
||||
var _1: Buffer?
|
||||
_1 = parseBytes(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoSHA512(salt: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_securePasswordKdfAlgoUnknown(_ reader: BufferReader) -> SecurePasswordKdfAlgo? {
|
||||
return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoUnknown
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,71 @@
|
||||
public extension Api {
|
||||
enum SecurePasswordKdfAlgo: TypeConstructorDescription {
|
||||
case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: Buffer)
|
||||
case securePasswordKdfAlgoSHA512(salt: Buffer)
|
||||
case securePasswordKdfAlgoUnknown
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let salt):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1141711456)
|
||||
}
|
||||
serializeBytes(salt, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .securePasswordKdfAlgoSHA512(let salt):
|
||||
if boxed {
|
||||
buffer.appendInt32(-2042159726)
|
||||
}
|
||||
serializeBytes(salt, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .securePasswordKdfAlgoUnknown:
|
||||
if boxed {
|
||||
buffer.appendInt32(4883767)
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let salt):
|
||||
return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", salt as Any)])
|
||||
case .securePasswordKdfAlgoSHA512(let salt):
|
||||
return ("securePasswordKdfAlgoSHA512", [("salt", salt as Any)])
|
||||
case .securePasswordKdfAlgoUnknown:
|
||||
return ("securePasswordKdfAlgoUnknown", [])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(_ reader: BufferReader) -> SecurePasswordKdfAlgo? {
|
||||
var _1: Buffer?
|
||||
_1 = parseBytes(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_securePasswordKdfAlgoSHA512(_ reader: BufferReader) -> SecurePasswordKdfAlgo? {
|
||||
var _1: Buffer?
|
||||
_1 = parseBytes(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoSHA512(salt: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_securePasswordKdfAlgoUnknown(_ reader: BufferReader) -> SecurePasswordKdfAlgo? {
|
||||
return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoUnknown
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum SecurePlainData: TypeConstructorDescription {
|
||||
case securePlainEmail(email: String)
|
||||
@ -780,351 +848,3 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum SendAsPeer: TypeConstructorDescription {
|
||||
case sendAsPeer(flags: Int32, peer: Api.Peer)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .sendAsPeer(let flags, let peer):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1206095820)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
peer.serialize(buffer, true)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .sendAsPeer(let flags, let peer):
|
||||
return ("sendAsPeer", [("flags", flags as Any), ("peer", peer as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_sendAsPeer(_ reader: BufferReader) -> SendAsPeer? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.Peer?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Peer
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.SendAsPeer.sendAsPeer(flags: _1!, peer: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum SendMessageAction: TypeConstructorDescription {
|
||||
case sendMessageCancelAction
|
||||
case sendMessageChooseContactAction
|
||||
case sendMessageChooseStickerAction
|
||||
case sendMessageEmojiInteraction(emoticon: String, msgId: Int32, interaction: Api.DataJSON)
|
||||
case sendMessageEmojiInteractionSeen(emoticon: String)
|
||||
case sendMessageGamePlayAction
|
||||
case sendMessageGeoLocationAction
|
||||
case sendMessageHistoryImportAction(progress: Int32)
|
||||
case sendMessageRecordAudioAction
|
||||
case sendMessageRecordRoundAction
|
||||
case sendMessageRecordVideoAction
|
||||
case sendMessageTypingAction
|
||||
case sendMessageUploadAudioAction(progress: Int32)
|
||||
case sendMessageUploadDocumentAction(progress: Int32)
|
||||
case sendMessageUploadPhotoAction(progress: Int32)
|
||||
case sendMessageUploadRoundAction(progress: Int32)
|
||||
case sendMessageUploadVideoAction(progress: Int32)
|
||||
case speakingInGroupCallAction
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .sendMessageCancelAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-44119819)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageChooseContactAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(1653390447)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageChooseStickerAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-1336228175)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageEmojiInteraction(let emoticon, let msgId, let interaction):
|
||||
if boxed {
|
||||
buffer.appendInt32(630664139)
|
||||
}
|
||||
serializeString(emoticon, buffer: buffer, boxed: false)
|
||||
serializeInt32(msgId, buffer: buffer, boxed: false)
|
||||
interaction.serialize(buffer, true)
|
||||
break
|
||||
case .sendMessageEmojiInteractionSeen(let emoticon):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1234857938)
|
||||
}
|
||||
serializeString(emoticon, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .sendMessageGamePlayAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-580219064)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageGeoLocationAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(393186209)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageHistoryImportAction(let progress):
|
||||
if boxed {
|
||||
buffer.appendInt32(-606432698)
|
||||
}
|
||||
serializeInt32(progress, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .sendMessageRecordAudioAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-718310409)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageRecordRoundAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-1997373508)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageRecordVideoAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-1584933265)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageTypingAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(381645902)
|
||||
}
|
||||
|
||||
break
|
||||
case .sendMessageUploadAudioAction(let progress):
|
||||
if boxed {
|
||||
buffer.appendInt32(-212740181)
|
||||
}
|
||||
serializeInt32(progress, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .sendMessageUploadDocumentAction(let progress):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1441998364)
|
||||
}
|
||||
serializeInt32(progress, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .sendMessageUploadPhotoAction(let progress):
|
||||
if boxed {
|
||||
buffer.appendInt32(-774682074)
|
||||
}
|
||||
serializeInt32(progress, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .sendMessageUploadRoundAction(let progress):
|
||||
if boxed {
|
||||
buffer.appendInt32(608050278)
|
||||
}
|
||||
serializeInt32(progress, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .sendMessageUploadVideoAction(let progress):
|
||||
if boxed {
|
||||
buffer.appendInt32(-378127636)
|
||||
}
|
||||
serializeInt32(progress, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .speakingInGroupCallAction:
|
||||
if boxed {
|
||||
buffer.appendInt32(-651419003)
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .sendMessageCancelAction:
|
||||
return ("sendMessageCancelAction", [])
|
||||
case .sendMessageChooseContactAction:
|
||||
return ("sendMessageChooseContactAction", [])
|
||||
case .sendMessageChooseStickerAction:
|
||||
return ("sendMessageChooseStickerAction", [])
|
||||
case .sendMessageEmojiInteraction(let emoticon, let msgId, let interaction):
|
||||
return ("sendMessageEmojiInteraction", [("emoticon", emoticon as Any), ("msgId", msgId as Any), ("interaction", interaction as Any)])
|
||||
case .sendMessageEmojiInteractionSeen(let emoticon):
|
||||
return ("sendMessageEmojiInteractionSeen", [("emoticon", emoticon as Any)])
|
||||
case .sendMessageGamePlayAction:
|
||||
return ("sendMessageGamePlayAction", [])
|
||||
case .sendMessageGeoLocationAction:
|
||||
return ("sendMessageGeoLocationAction", [])
|
||||
case .sendMessageHistoryImportAction(let progress):
|
||||
return ("sendMessageHistoryImportAction", [("progress", progress as Any)])
|
||||
case .sendMessageRecordAudioAction:
|
||||
return ("sendMessageRecordAudioAction", [])
|
||||
case .sendMessageRecordRoundAction:
|
||||
return ("sendMessageRecordRoundAction", [])
|
||||
case .sendMessageRecordVideoAction:
|
||||
return ("sendMessageRecordVideoAction", [])
|
||||
case .sendMessageTypingAction:
|
||||
return ("sendMessageTypingAction", [])
|
||||
case .sendMessageUploadAudioAction(let progress):
|
||||
return ("sendMessageUploadAudioAction", [("progress", progress as Any)])
|
||||
case .sendMessageUploadDocumentAction(let progress):
|
||||
return ("sendMessageUploadDocumentAction", [("progress", progress as Any)])
|
||||
case .sendMessageUploadPhotoAction(let progress):
|
||||
return ("sendMessageUploadPhotoAction", [("progress", progress as Any)])
|
||||
case .sendMessageUploadRoundAction(let progress):
|
||||
return ("sendMessageUploadRoundAction", [("progress", progress as Any)])
|
||||
case .sendMessageUploadVideoAction(let progress):
|
||||
return ("sendMessageUploadVideoAction", [("progress", progress as Any)])
|
||||
case .speakingInGroupCallAction:
|
||||
return ("speakingInGroupCallAction", [])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_sendMessageCancelAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageCancelAction
|
||||
}
|
||||
public static func parse_sendMessageChooseContactAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageChooseContactAction
|
||||
}
|
||||
public static func parse_sendMessageChooseStickerAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageChooseStickerAction
|
||||
}
|
||||
public static func parse_sendMessageEmojiInteraction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
var _3: Api.DataJSON?
|
||||
if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.DataJSON
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.SendMessageAction.sendMessageEmojiInteraction(emoticon: _1!, msgId: _2!, interaction: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageEmojiInteractionSeen(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageEmojiInteractionSeen(emoticon: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageGamePlayAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageGamePlayAction
|
||||
}
|
||||
public static func parse_sendMessageGeoLocationAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageGeoLocationAction
|
||||
}
|
||||
public static func parse_sendMessageHistoryImportAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageHistoryImportAction(progress: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageRecordAudioAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageRecordAudioAction
|
||||
}
|
||||
public static func parse_sendMessageRecordRoundAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageRecordRoundAction
|
||||
}
|
||||
public static func parse_sendMessageRecordVideoAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageRecordVideoAction
|
||||
}
|
||||
public static func parse_sendMessageTypingAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.sendMessageTypingAction
|
||||
}
|
||||
public static func parse_sendMessageUploadAudioAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageUploadAudioAction(progress: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageUploadDocumentAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageUploadDocumentAction(progress: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageUploadPhotoAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageUploadPhotoAction(progress: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageUploadRoundAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageUploadRoundAction(progress: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_sendMessageUploadVideoAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.SendMessageAction.sendMessageUploadVideoAction(progress: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_speakingInGroupCallAction(_ reader: BufferReader) -> SendMessageAction? {
|
||||
return Api.SendMessageAction.speakingInGroupCallAction
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,45 @@
|
||||
public extension Api {
|
||||
enum CdnConfig: TypeConstructorDescription {
|
||||
case cdnConfig(publicKeys: [Api.CdnPublicKey])
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .cdnConfig(let publicKeys):
|
||||
if boxed {
|
||||
buffer.appendInt32(1462101002)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(publicKeys.count))
|
||||
for item in publicKeys {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .cdnConfig(let publicKeys):
|
||||
return ("cdnConfig", [("publicKeys", publicKeys as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_cdnConfig(_ reader: BufferReader) -> CdnConfig? {
|
||||
var _1: [Api.CdnPublicKey]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.CdnPublicKey.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.CdnConfig.cdnConfig(publicKeys: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum CdnPublicKey: TypeConstructorDescription {
|
||||
case cdnPublicKey(dcId: Int32, publicKey: String)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
112
submodules/TelegramApi/Sources/Api34.swift
Normal file
112
submodules/TelegramApi/Sources/Api34.swift
Normal file
@ -0,0 +1,112 @@
|
||||
public extension Api.upload {
|
||||
enum WebFile: TypeConstructorDescription {
|
||||
case webFile(size: Int32, mimeType: String, fileType: Api.storage.FileType, mtime: Int32, bytes: Buffer)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .webFile(let size, let mimeType, let fileType, let mtime, let bytes):
|
||||
if boxed {
|
||||
buffer.appendInt32(568808380)
|
||||
}
|
||||
serializeInt32(size, buffer: buffer, boxed: false)
|
||||
serializeString(mimeType, buffer: buffer, boxed: false)
|
||||
fileType.serialize(buffer, true)
|
||||
serializeInt32(mtime, buffer: buffer, boxed: false)
|
||||
serializeBytes(bytes, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .webFile(let size, let mimeType, let fileType, let mtime, let bytes):
|
||||
return ("webFile", [("size", size as Any), ("mimeType", mimeType as Any), ("fileType", fileType as Any), ("mtime", mtime as Any), ("bytes", bytes as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_webFile(_ reader: BufferReader) -> WebFile? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: Api.storage.FileType?
|
||||
if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.storage.FileType
|
||||
}
|
||||
var _4: Int32?
|
||||
_4 = reader.readInt32()
|
||||
var _5: Buffer?
|
||||
_5 = parseBytes(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.upload.WebFile.webFile(size: _1!, mimeType: _2!, fileType: _3!, mtime: _4!, bytes: _5!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.users {
|
||||
enum UserFull: TypeConstructorDescription {
|
||||
case userFull(fullUser: Api.UserFull, chats: [Api.Chat], users: [Api.User])
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .userFull(let fullUser, let chats, let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(997004590)
|
||||
}
|
||||
fullUser.serialize(buffer, true)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(chats.count))
|
||||
for item in chats {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .userFull(let fullUser, let chats, let users):
|
||||
return ("userFull", [("fullUser", fullUser as Any), ("chats", chats as Any), ("users", users as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_userFull(_ reader: BufferReader) -> UserFull? {
|
||||
var _1: Api.UserFull?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.UserFull
|
||||
}
|
||||
var _2: [Api.Chat]?
|
||||
if let _ = reader.readInt32() {
|
||||
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
||||
}
|
||||
var _3: [Api.User]?
|
||||
if let _ = reader.readInt32() {
|
||||
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.users.UserFull.userFull(fullUser: _1!, chats: _2!, users: _3!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
10446
submodules/TelegramApi/Sources/Api35.swift
Normal file
10446
submodules/TelegramApi/Sources/Api35.swift
Normal file
File diff suppressed because it is too large
Load Diff
@ -370,6 +370,60 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum InputBusinessChatLink: TypeConstructorDescription {
|
||||
case inputBusinessChatLink(flags: Int32, message: String, entities: [Api.MessageEntity]?, title: String?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .inputBusinessChatLink(let flags, let message, let entities, let title):
|
||||
if boxed {
|
||||
buffer.appendInt32(292003751)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeString(message, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
for item in entities! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .inputBusinessChatLink(let flags, let message, let entities, let title):
|
||||
return ("inputBusinessChatLink", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("title", title as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_inputBusinessChatLink(_ reader: BufferReader) -> InputBusinessChatLink? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: [Api.MessageEntity]?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() {
|
||||
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||
} }
|
||||
var _4: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.InputBusinessChatLink.inputBusinessChatLink(flags: _1!, message: _2!, entities: _3, title: _4)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum InputBusinessGreetingMessage: TypeConstructorDescription {
|
||||
case inputBusinessGreetingMessage(shortcutId: Int32, recipients: Api.InputBusinessRecipients, noActivityDays: Int32)
|
||||
|
@ -63,7 +63,7 @@ extension ReplyMarkupButton {
|
||||
self.init(title: text, titleWhenForwarded: nil, action: .openWebView(url: url, simple: false))
|
||||
case let .keyboardButtonSimpleWebView(text, url):
|
||||
self.init(title: text, titleWhenForwarded: nil, action: .openWebView(url: url, simple: true))
|
||||
case let .keyboardButtonRequestPeer(text, buttonId, peerType, maxQuantity):
|
||||
case let .keyboardButtonRequestPeer(text, buttonId, peerType, maxQuantity), let .inputKeyboardButtonRequestPeer(_, text, buttonId, peerType, maxQuantity):
|
||||
let mappedPeerType: ReplyMarkupButtonRequestPeerType
|
||||
switch peerType {
|
||||
case let .requestPeerTypeUser(_, bot, premium):
|
||||
|
@ -258,6 +258,8 @@ func apiMessagePeerIds(_ message: Api.Message) -> [PeerId] {
|
||||
if let boostPeer = boostPeer {
|
||||
result.append(boostPeer.peerId)
|
||||
}
|
||||
case .messageActionRequestedPeerSentMe:
|
||||
break
|
||||
}
|
||||
|
||||
return result
|
||||
|
@ -123,6 +123,8 @@ func telegramMediaActionFromApiAction(_ action: Api.MessageAction) -> TelegramMe
|
||||
return TelegramMediaAction(action: .suggestedProfilePhoto(image: telegramMediaImageFromApiPhoto(photo)))
|
||||
case let .messageActionRequestedPeer(buttonId, peers):
|
||||
return TelegramMediaAction(action: .requestedPeer(buttonId: buttonId, peerIds: peers.map { $0.peerId }))
|
||||
case let .messageActionRequestedPeerSentMe(buttonId, _):
|
||||
return TelegramMediaAction(action: .requestedPeer(buttonId: buttonId, peerIds: []))
|
||||
case let .messageActionSetChatWallPaper(flags, wallpaper):
|
||||
if (flags & (1 << 0)) != 0 {
|
||||
return TelegramMediaAction(action: .setSameChatWallpaper(wallpaper: TelegramWallpaper(apiWallpaper: wallpaper)))
|
||||
|
@ -884,7 +884,7 @@ private final class CallSessionManagerContext {
|
||||
//assertionFailure()
|
||||
}
|
||||
}
|
||||
case let .phoneCall(flags, id, _, _, _, _, gAOrB, keyFingerprint, callProtocol, connections, startDate):
|
||||
case let .phoneCall(flags, id, _, _, _, _, gAOrB, keyFingerprint, callProtocol, connections, startDate, _):
|
||||
let allowsP2P = (flags & (1 << 5)) != 0
|
||||
if let internalId = self.contextIdByStableId[id] {
|
||||
if let context = self.contexts[internalId] {
|
||||
@ -1243,7 +1243,7 @@ private func acceptCallSession(accountPeerId: PeerId, postbox: Postbox, network:
|
||||
return .failed
|
||||
case .phoneCallWaiting:
|
||||
return .success(.waiting(config: config))
|
||||
case let .phoneCall(flags, id, _, _, _, _, gAOrB, _, callProtocol, connections, startDate):
|
||||
case let .phoneCall(flags, id, _, _, _, _, gAOrB, _, callProtocol, connections, startDate, _):
|
||||
if id == stableId {
|
||||
switch callProtocol{
|
||||
case let .phoneCallProtocol(_, _, maxLayer, versions):
|
||||
|
@ -246,7 +246,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
||||
}
|
||||
|
||||
switch fullUser {
|
||||
case let .userFull(_, _, _, _, _, _, _, _, userFullNotifySettings, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
||||
case let .userFull(_, _, _, _, _, _, _, _, userFullNotifySettings, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
||||
updatePeers(transaction: transaction, accountPeerId: accountPeerId, peers: parsedPeers)
|
||||
transaction.updateCurrentPeerNotificationSettings([peerId: TelegramPeerNotificationSettings(apiSettings: userFullNotifySettings)])
|
||||
}
|
||||
@ -258,7 +258,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
||||
previous = CachedUserData()
|
||||
}
|
||||
switch fullUser {
|
||||
case let .userFull(userFullFlags, _, _, userFullAbout, userFullSettings, personalPhoto, profilePhoto, fallbackPhoto, _, userFullBotInfo, userFullPinnedMsgId, userFullCommonChatsCount, _, userFullTtlPeriod, userFullThemeEmoticon, _, _, _, userPremiumGiftOptions, userWallpaper, stories, businessWorkHours, businessLocation, greetingMessage, awayMessage, businessIntro, birthday):
|
||||
case let .userFull(userFullFlags, _, _, userFullAbout, userFullSettings, personalPhoto, profilePhoto, fallbackPhoto, _, userFullBotInfo, userFullPinnedMsgId, userFullCommonChatsCount, _, userFullTtlPeriod, userFullThemeEmoticon, _, _, _, userPremiumGiftOptions, userWallpaper, stories, businessWorkHours, businessLocation, greetingMessage, awayMessage, businessIntro, birthday, _, _):
|
||||
let _ = stories
|
||||
let botInfo = userFullBotInfo.flatMap(BotInfo.init(apiBotInfo:))
|
||||
let isBlocked = (userFullFlags & (1 << 0)) != 0
|
||||
|
@ -128,7 +128,7 @@ final class PeerInfoBirthdayOverlay: ASDisplayNode {
|
||||
|
||||
let animationNode = DefaultAnimatedStickerNodeImpl()
|
||||
let source = AnimatedStickerResourceSource(account: self.context.account, resource: file.media.resource, fitzModifier: nil)
|
||||
let pathPrefix: String? = nil //self.context.account.postbox.mediaBox.shortLivedResourceCachePathPrefix(file.media.resource.id)
|
||||
let pathPrefix: String? = self.context.account.postbox.mediaBox.shortLivedResourceCachePathPrefix(file.media.resource.id)
|
||||
animationNode.setup(source: source, width: Int(pixelSize.width), height: Int(pixelSize.height), playbackMode: .loop, mode: .direct(cachePathPrefix: pathPrefix))
|
||||
self.addSubnode(animationNode)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user