Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions submodules/TelegramApi/Sources/Api0.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-847783593] = { return Api.ChannelMessagesFilter.parse_channelMessagesFilter($0) }
dict[-1798033689] = { return Api.ChannelMessagesFilter.parse_channelMessagesFilterEmpty($0) }
dict[-885426663] = { return Api.ChannelParticipant.parse_channelParticipant($0) }
dict[466961494] = { return Api.ChannelParticipant.parse_channelParticipantWithRank($0) }
dict[885242707] = { return Api.ChannelParticipant.parse_channelParticipantAdmin($0) }
dict[1844969806] = { return Api.ChannelParticipant.parse_channelParticipantBanned($0) }
dict[803602899] = { return Api.ChannelParticipant.parse_channelParticipantCreator($0) }
Expand All @@ -197,6 +198,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-566281095] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsRecent($0) }
dict[106343499] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsSearch($0) }
dict[-26717355] = { return Api.Chat.parse_channel($0) }
dict[473084188] = { return Api.Chat.parse_channel($0) }
dict[399807445] = { return Api.Chat.parse_channelForbidden($0) }
dict[1103884886] = { return Api.Chat.parse_chat($0) }
dict[693512293] = { return Api.Chat.parse_chatEmpty($0) }
Expand All @@ -205,6 +207,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-219353309] = { return Api.ChatAdminWithInvites.parse_chatAdminWithInvites($0) }
dict[-1626209256] = { return Api.ChatBannedRights.parse_chatBannedRights($0) }
dict[-529258018] = { return Api.ChatFull.parse_channelFull($0) }
dict[-1605464774] = { return Api.ChatFull.parse_channelFull($0) }
dict[640893467] = { return Api.ChatFull.parse_chatFull($0) }
dict[1553807106] = { return Api.ChatInvite.parse_chatInvite($0) }
dict[1516793212] = { return Api.ChatInvite.parse_chatInviteAlready($0) }
Expand Down Expand Up @@ -251,6 +254,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[1662637586] = { return Api.DocumentAttribute.parse_documentAttributeSticker($0) }
dict[1137015880] = { return Api.DocumentAttribute.parse_documentAttributeVideo($0) }
dict[-1763006997] = { return Api.DraftMessage.parse_draftMessage($0) }
dict[1627271828] = { return Api.DraftMessage.parse_draftMessageWithRichMessage($0) }
dict[453805082] = { return Api.DraftMessage.parse_draftMessageEmpty($0) }
dict[-1764723459] = { return Api.EmailVerification.parse_emailVerificationApple($0) }
dict[-1842457175] = { return Api.EmailVerification.parse_emailVerificationCode($0) }
Expand Down Expand Up @@ -524,6 +528,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-1560655744] = { return Api.KeyboardButton.parse_keyboardButton($0) }
dict[-1344716869] = { return Api.KeyboardButton.parse_keyboardButtonBuy($0) }
dict[901503851] = { return Api.KeyboardButton.parse_keyboardButtonCallback($0) }
dict[-433338016] = { return Api.KeyboardButton.parse_keyboardButtonCallbackWithStyle($0) }
dict[1976723854] = { return Api.KeyboardButton.parse_keyboardButtonCopy($0) }
dict[1358175439] = { return Api.KeyboardButton.parse_keyboardButtonGame($0) }
dict[-59151553] = { return Api.KeyboardButton.parse_keyboardButtonRequestGeoLocation($0) }
Expand All @@ -533,6 +538,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-1598009252] = { return Api.KeyboardButton.parse_keyboardButtonSimpleWebView($0) }
dict[-1816527947] = { return Api.KeyboardButton.parse_keyboardButtonSwitchInline($0) }
dict[629866245] = { return Api.KeyboardButton.parse_keyboardButtonUrl($0) }
dict[-670292500] = { return Api.KeyboardButton.parse_keyboardButtonUrlWithStyle($0) }
dict[280464681] = { return Api.KeyboardButton.parse_keyboardButtonUrlAuth($0) }
dict[814112961] = { return Api.KeyboardButton.parse_keyboardButtonUserProfile($0) }
dict[326529584] = { return Api.KeyboardButton.parse_keyboardButtonWebView($0) }
Expand All @@ -555,6 +561,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[1235637404] = { return Api.MediaArea.parse_mediaAreaWeather($0) }
dict[-808853502] = { return Api.MediaAreaCoordinates.parse_mediaAreaCoordinates($0) }
dict[-1743401272] = { return Api.Message.parse_message($0) }
dict[1979759059] = { return Api.Message.parse_message($0) }
dict[-1868117372] = { return Api.Message.parse_messageEmpty($0) }
dict[2055212554] = { return Api.Message.parse_messageService($0) }
dict[-872240531] = { return Api.MessageAction.parse_messageActionBoostApply($0) }
Expand Down Expand Up @@ -649,7 +656,9 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-827703647] = { return Api.MessageMedia.parse_messageMediaGiveawayResults($0) }
dict[-156940077] = { return Api.MessageMedia.parse_messageMediaInvoice($0) }
dict[-1467669359] = { return Api.MessageMedia.parse_messageMediaPaidMedia($0) }
dict[-501814429] = { return Api.MessageMedia.parse_messageMediaPhotoWithVideo($0) }
dict[1766936791] = { return Api.MessageMedia.parse_messageMediaPhoto($0) }
dict[2000637542] = { return Api.MessageMedia.parse_messageMediaPollWithAttachedMedia($0) }
dict[1272375192] = { return Api.MessageMedia.parse_messageMediaPoll($0) }
dict[1758159491] = { return Api.MessageMedia.parse_messageMediaStory($0) }
dict[-1974226924] = { return Api.MessageMedia.parse_messageMediaToDo($0) }
Expand All @@ -664,6 +673,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[171155211] = { return Api.MessageReactions.parse_messageReactions($0) }
dict[1269016922] = { return Api.MessageReactor.parse_messageReactor($0) }
dict[-2083123262] = { return Api.MessageReplies.parse_messageReplies($0) }
dict[462937446] = { return Api.MessageReplyHeader.parse_messageReplyHeader($0) }
dict[1763137035] = { return Api.MessageReplyHeader.parse_messageReplyHeader($0) }
dict[240843065] = { return Api.MessageReplyHeader.parse_messageReplyStoryHeader($0) }
dict[2030298073] = { return Api.MessageReportOption.parse_messageReportOption($0) }
Expand Down Expand Up @@ -779,9 +789,13 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-96535659] = { return Api.PhotoSize.parse_photoSizeProgressive($0) }
dict[-525288402] = { return Api.PhotoSize.parse_photoStrippedSize($0) }
dict[1484026161] = { return Api.Poll.parse_poll($0) }
dict[-1771164225] = { return Api.Poll.parse_pollWithHash($0) }
dict[-15277366] = { return Api.PollAnswer.parse_pollAnswer($0) }
dict[1266514026] = { return Api.PollAnswer.parse_pollAnswerWithMedia($0) }
dict[997055186] = { return Api.PollAnswerVoters.parse_pollAnswerVoters($0) }
dict[910500618] = { return Api.PollAnswerVoters.parse_pollAnswerVotersWithRecentVoters($0) }
dict[2061444128] = { return Api.PollResults.parse_pollResults($0) }
dict[-1166298786] = { return Api.PollResults.parse_pollResultsWithSolutionMedia($0) }
dict[1558266229] = { return Api.PopularContact.parse_popularContact($0) }
dict[512535275] = { return Api.PostAddress.parse_postAddress($0) }
dict[-419066241] = { return Api.PostInteractionCounters.parse_postInteractionCountersMessage($0) }
Expand Down Expand Up @@ -944,6 +958,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[1124938064] = { return Api.SponsoredMessageReportOption.parse_sponsoredMessageReportOption($0) }
dict[-963180333] = { return Api.SponsoredPeer.parse_sponsoredPeer($0) }
dict[12386139] = { return Api.StarGift.parse_starGift($0) }
dict[825922887] = { return Api.StarGift.parse_starGift($0) }
dict[-164136786] = { return Api.StarGift.parse_starGiftUnique($0) }
dict[-650279524] = { return Api.StarGiftAttribute.parse_starGiftAttributeBackdrop($0) }
dict[970559507] = { return Api.StarGiftAttribute.parse_starGiftAttributeModel($0) }
Expand Down Expand Up @@ -994,6 +1009,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[1898850301] = { return Api.StoriesStealthMode.parse_storiesStealthMode($0) }
dict[-1205411504] = { return Api.StoryFwdHeader.parse_storyFwdHeader($0) }
dict[2041735716] = { return Api.StoryItem.parse_storyItem($0) }
dict[379894076] = { return Api.StoryItem.parse_storyItem($0) }
dict[1374088783] = { return Api.StoryItem.parse_storyItemDeleted($0) }
dict[-5388013] = { return Api.StoryItem.parse_storyItemSkipped($0) }
dict[1620104917] = { return Api.StoryReaction.parse_storyReaction($0) }
Expand Down Expand Up @@ -1096,6 +1112,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[1448076945] = { return Api.Update.parse_updateLoginToken($0) }
dict[-710666460] = { return Api.Update.parse_updateMessageExtendedMedia($0) }
dict[1318109142] = { return Api.Update.parse_updateMessageID($0) }
dict[-699641301] = { return Api.Update.parse_updateMessagePollWithPeer($0) }
dict[-1398708869] = { return Api.Update.parse_updateMessagePoll($0) }
dict[619974263] = { return Api.Update.parse_updateMessagePollVote($0) }
dict[506035194] = { return Api.Update.parse_updateMessageReactions($0) }
Expand Down Expand Up @@ -1134,6 +1151,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-78886548] = { return Api.Update.parse_updateReadFeaturedEmojiStickers($0) }
dict[1461528386] = { return Api.Update.parse_updateReadFeaturedStickers($0) }
dict[-1667805217] = { return Api.Update.parse_updateReadHistoryInbox($0) }
dict[-1635468135] = { return Api.Update.parse_updateReadHistoryInboxWithTopMessage($0) }
dict[791617983] = { return Api.Update.parse_updateReadHistoryOutbox($0) }
dict[-131960447] = { return Api.Update.parse_updateReadMessagesContents($0) }
dict[2008081266] = { return Api.Update.parse_updateReadMonoForumInbox($0) }
Expand Down Expand Up @@ -1165,6 +1183,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[88680979] = { return Api.Update.parse_updateUserPhone($0) }
dict[-440534818] = { return Api.Update.parse_updateUserStatus($0) }
dict[-1071741569] = { return Api.Update.parse_updateUserTyping($0) }
dict[706199388] = { return Api.Update.parse_updateUserTypingWithTopMessage($0) }
dict[2139689491] = { return Api.Update.parse_updateWebPage($0) }
dict[361936797] = { return Api.Update.parse_updateWebViewResultSent($0) }
dict[2027216577] = { return Api.Updates.parse_updateShort($0) }
Expand All @@ -1178,6 +1197,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-1445536993] = { return Api.UrlAuthResult.parse_urlAuthResultDefault($0) }
dict[-1831650802] = { return Api.UrlAuthResult.parse_urlAuthResultRequest($0) }
dict[34280482] = { return Api.User.parse_user($0) }
dict[829899656] = { return Api.User.parse_user($0) }
dict[-742634630] = { return Api.User.parse_userEmpty($0) }
dict[702447806] = { return Api.UserFull.parse_userFull($0) }
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
Expand Down Expand Up @@ -1378,8 +1398,10 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[834488621] = { return Api.messages.MessageReactionsList.parse_messageReactionsList($0) }
dict[-1228606141] = { return Api.messages.MessageViews.parse_messageViews($0) }
dict[-948520370] = { return Api.messages.Messages.parse_channelMessages($0) }
dict[494135274] = { return Api.messages.Messages.parse_messagesWithTopics($0) }
dict[-1938715001] = { return Api.messages.Messages.parse_messages($0) }
dict[1951620897] = { return Api.messages.Messages.parse_messagesNotModified($0) }
dict[1595959062] = { return Api.messages.Messages.parse_messagesSliceWithTopics($0) }
dict[978610270] = { return Api.messages.Messages.parse_messagesSlice($0) }
dict[-83926371] = { return Api.messages.MyStickers.parse_myStickers($0) }
dict[863093588] = { return Api.messages.PeerDialogs.parse_peerDialogs($0) }
Expand Down
63 changes: 63 additions & 0 deletions submodules/TelegramApi/Sources/Api14.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,31 @@ public extension Api {
return nil
}
}
public static func parse_keyboardButtonCallbackWithStyle(_ reader: BufferReader) -> KeyboardButton? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Swift.Bool = true
if let flags = _1, Int(flags) & Int(1 << 10) != 0 {
_2 = consumeKeyboardButtonStyle(reader)
}
var _3: String?
_3 = parseString(reader)
var _4: Buffer?
_4 = parseBytes(reader)
let _c1 = _1 != nil
let _c2 = _1.map { flags in
(Int(flags) & Int(1 << 10) == 0) || _2
} ?? false
let _c3 = _3 != nil
let _c4 = _4 != nil
if _c1 && _c2 && _c3 && _c4 {
let sanitizedFlags = _1! & ~Int32(1 << 10)
return Api.KeyboardButton.keyboardButtonCallback(flags: sanitizedFlags, text: _3!, data: _4!)
}
else {
return nil
}
}
public static func parse_keyboardButtonCopy(_ reader: BufferReader) -> KeyboardButton? {
var _1: String?
_1 = parseString(reader)
Expand Down Expand Up @@ -448,6 +473,44 @@ public extension Api {
return nil
}
}
public static func parse_keyboardButtonUrlWithStyle(_ reader: BufferReader) -> KeyboardButton? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Swift.Bool = true
if Int(_1!) & Int(1 << 10) != 0 {
_2 = consumeKeyboardButtonStyle(reader)
}
var _3: String?
_3 = parseString(reader)
var _4: String?
_4 = parseString(reader)
let _c1 = _1 != nil
let _c2 = (Int(_1!) & Int(1 << 10) == 0) || _2
let _c3 = _3 != nil
let _c4 = _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.KeyboardButton.keyboardButtonUrl(text: _3!, url: _4!)
}
else {
return nil
}
}
private static func consumeKeyboardButtonStyle(_ reader: BufferReader) -> Swift.Bool {
guard let signature = reader.readInt32() else {
return false
}
guard signature == 1339896880 else {
telegramApiLog("KeyboardButtonStyle constructor \(String(UInt32(bitPattern: signature), radix: 16, uppercase: false)) not supported")
return false
}
guard let flags = reader.readInt32() else {
return false
}
if Int(flags) & Int(1 << 3) != 0 {
return reader.readInt64() != nil
}
return true
}
public static func parse_keyboardButtonUrlAuth(_ reader: BufferReader) -> KeyboardButton? {
var _1: Int32?
_1 = reader.readInt32()
Expand Down
Loading