diff --git a/TelegramCore.xcodeproj/project.pbxproj b/TelegramCore.xcodeproj/project.pbxproj index d61124f20f..bd3844662d 100644 --- a/TelegramCore.xcodeproj/project.pbxproj +++ b/TelegramCore.xcodeproj/project.pbxproj @@ -63,7 +63,6 @@ C251D7441E65E50500283EDE /* StickerSetInstallation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C251D7421E65E50500283EDE /* StickerSetInstallation.swift */; }; C25638021E79E7FC00311607 /* TwoStepVerification.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0FA0ABC1E76C908005BB9B7 /* TwoStepVerification.swift */; }; C26A37EF1E5E0C41006977AC /* ChannelParticipants.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BB7C591E5C8074001527C3 /* ChannelParticipants.swift */; }; - C27982511E72C97800262BFD /* MacosLegacy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C27982501E72C97800262BFD /* MacosLegacy.swift */; }; C28725421EF967E700613564 /* NotificationInfoMessageAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28725411EF967E700613564 /* NotificationInfoMessageAttribute.swift */; }; C28725431EF967E700613564 /* NotificationInfoMessageAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28725411EF967E700613564 /* NotificationInfoMessageAttribute.swift */; }; C28D3CF020D3DA900027F4D6 /* DeepLinkInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28D3CEF20D3DA900027F4D6 /* DeepLinkInfo.swift */; }; @@ -200,8 +199,6 @@ D02DADC12139A1FC00116225 /* ContactSyncManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D02DADC02139A1FC00116225 /* ContactSyncManager.swift */; }; D02DADC22139A1FC00116225 /* ContactSyncManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D02DADC02139A1FC00116225 /* ContactSyncManager.swift */; }; D03121021DA57E93006A2A60 /* TelegramPeerNotificationSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03121011DA57E93006A2A60 /* TelegramPeerNotificationSettings.swift */; }; - D03229F41E6B39700000AF9C /* ImportAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03229F31E6B39700000AF9C /* ImportAccount.swift */; }; - D03229F51E6B39700000AF9C /* ImportAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03229F31E6B39700000AF9C /* ImportAccount.swift */; }; D032F5BC20EF84FD00037B6C /* FetchedMediaResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D032F5BB20EF84FD00037B6C /* FetchedMediaResource.swift */; }; D032F5BD20EF84FD00037B6C /* FetchedMediaResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D032F5BB20EF84FD00037B6C /* FetchedMediaResource.swift */; }; D0338740223BD48B007A2CE4 /* ContactsSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D033873F223BD48B007A2CE4 /* ContactsSettings.swift */; }; @@ -844,7 +841,6 @@ C239BE9B1E630CA700C2C453 /* UpdatePinnedMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdatePinnedMessage.swift; sourceTree = ""; }; C23BC3861E9BE3CA00D79F92 /* ImportContact.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportContact.swift; sourceTree = ""; }; C251D7421E65E50500283EDE /* StickerSetInstallation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StickerSetInstallation.swift; sourceTree = ""; }; - C27982501E72C97800262BFD /* MacosLegacy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MacosLegacy.swift; sourceTree = ""; }; C28725411EF967E700613564 /* NotificationInfoMessageAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationInfoMessageAttribute.swift; sourceTree = ""; }; C28D3CEF20D3DA900027F4D6 /* DeepLinkInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinkInfo.swift; sourceTree = ""; }; C29340F21F5080FA0074991E /* UpdateGroupSpecificStickerset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdateGroupSpecificStickerset.swift; sourceTree = ""; }; @@ -913,7 +909,6 @@ D02D60AA206BA64100FEFE1E /* VerifySecureIdValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifySecureIdValue.swift; sourceTree = ""; }; D02DADC02139A1FC00116225 /* ContactSyncManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactSyncManager.swift; sourceTree = ""; }; D03121011DA57E93006A2A60 /* TelegramPeerNotificationSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelegramPeerNotificationSettings.swift; sourceTree = ""; }; - D03229F31E6B39700000AF9C /* ImportAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportAccount.swift; sourceTree = ""; }; D032F5BB20EF84FD00037B6C /* FetchedMediaResource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchedMediaResource.swift; sourceTree = ""; }; D033873F223BD48B007A2CE4 /* ContactsSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsSettings.swift; sourceTree = ""; }; D0338742223BD532007A2CE4 /* InitializeAccountAfterLogin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitializeAccountAfterLogin.swift; sourceTree = ""; }; @@ -1281,14 +1276,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C279824F1E72C96B00262BFD /* legacy */ = { - isa = PBXGroup; - children = ( - C27982501E72C97800262BFD /* MacosLegacy.swift */, - ); - name = legacy; - sourceTree = ""; - }; D01B27A01E394D7B0022A4C0 /* Settings */ = { isa = PBXGroup; children = ( @@ -1399,7 +1386,6 @@ D0FA8BAC1E1FD6E2001E855B /* MemoryBufferExtensions.swift */, D0448C9E1E27F5EB005A61A7 /* Random.swift */, D050F20F1E48AB0600988324 /* InteractivePhoneFormatter.swift */, - D03229F31E6B39700000AF9C /* ImportAccount.swift */, D04CAA591E83310D0047E51F /* MD5.swift */, D042C6821E8D9DF800C863B0 /* Unixtime.swift */, D01C7F031EFC1C49008305F1 /* DeviceContact.swift */, @@ -1846,7 +1832,6 @@ D09D8C031D4FAB1D0081DBEC /* TelegramCore */ = { isa = PBXGroup; children = ( - C279824F1E72C96B00262BFD /* legacy */, D03B0C791D62153400955575 /* third-party */, D03B0CB71D62232000955575 /* Utils */, D03B0CCF1D62242200955575 /* Objects */, @@ -2209,7 +2194,6 @@ D00DBBD71E64E41100DB5485 /* CreateSecretChat.swift in Sources */, C2FD33EB1E696C78008D13D4 /* GroupsInCommon.swift in Sources */, D0FA8BB01E1FEC7E001E855B /* SecretChatEncryptionConfig.swift in Sources */, - D03229F41E6B39700000AF9C /* ImportAccount.swift in Sources */, D021E0DF1DB539FC00C6B04F /* StickerPack.swift in Sources */, D03B0D091D62255C00955575 /* EnqueueMessage.swift in Sources */, D0CA8E4B227209C4008A74C3 /* ManagedSynchronizeGroupMessageStats.swift in Sources */, @@ -2622,7 +2606,6 @@ D00DBBD81E64E41100DB5485 /* CreateSecretChat.swift in Sources */, C2FD33EC1E696C79008D13D4 /* GroupsInCommon.swift in Sources */, C239BE9D1E630CB300C2C453 /* UpdatePinnedMessage.swift in Sources */, - D03229F51E6B39700000AF9C /* ImportAccount.swift in Sources */, C239BE981E62F0D200C2C453 /* LoadMessagesIfNecessary.swift in Sources */, D01C7ED41EF5DF83008305F1 /* LimitsConfiguration.swift in Sources */, D051DB15215EC5A300F30F92 /* AppChangelogState.swift in Sources */, @@ -2896,7 +2879,6 @@ D0FA8BB71E223C16001E855B /* SecretApiLayer8.swift in Sources */, D0EC559B2101ED0800D1992C /* DeleteMessages.swift in Sources */, D073CE6A1DCBCF17007511FD /* ViewCountMessageAttribute.swift in Sources */, - C27982511E72C97800262BFD /* MacosLegacy.swift in Sources */, D0B418AB1D7E0597004562A4 /* MultipartFetch.swift in Sources */, D01A21AA1F38CDDC00DDA104 /* ManagedSynchronizeSavedStickersOperations.swift in Sources */, D0546495207386D7002ECC1E /* SecureIdUtilityBillValue.swift in Sources */, diff --git a/TelegramCore.xcodeproj/xcshareddata/xcschemes/TelegramCore.xcscheme b/TelegramCore.xcodeproj/xcshareddata/xcschemes/TelegramCore.xcscheme new file mode 100644 index 0000000000..f6d9f5db4f --- /dev/null +++ b/TelegramCore.xcodeproj/xcshareddata/xcschemes/TelegramCore.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TelegramCore/Api0.swift b/TelegramCore/Api0.swift index 03c5971451..73c0b465a7 100644 --- a/TelegramCore/Api0.swift +++ b/TelegramCore/Api0.swift @@ -269,10 +269,10 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1158290442] = { return Api.messages.FoundGifs.parse_foundGifs($0) } dict[-1132476723] = { return Api.FileLocation.parse_fileLocationToBeDeprecated($0) } dict[-716006138] = { return Api.Poll.parse_poll($0) } + dict[-1195615476] = { return Api.InputNotifyPeer.parse_inputNotifyPeer($0) } dict[423314455] = { return Api.InputNotifyPeer.parse_inputNotifyUsers($0) } dict[1251338318] = { return Api.InputNotifyPeer.parse_inputNotifyChats($0) } dict[-1311015810] = { return Api.InputNotifyPeer.parse_inputNotifyBroadcasts($0) } - dict[-1195615476] = { return Api.InputNotifyPeer.parse_inputNotifyPeer($0) } dict[-317144808] = { return Api.EncryptedMessage.parse_encryptedMessage($0) } dict[594758406] = { return Api.EncryptedMessage.parse_encryptedMessageService($0) } dict[-566281095] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsRecent($0) } @@ -1315,7 +1315,7 @@ struct Api { } extension Api { struct messages { - enum StickerSet: TypeConstructorDescription { + indirect enum StickerSet: TypeConstructorDescription { case stickerSet(set: Api.StickerSet, packs: [Api.StickerPack], documents: [Api.Document]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1371,7 +1371,7 @@ struct messages { } } - enum ArchivedStickers: TypeConstructorDescription { + indirect enum ArchivedStickers: TypeConstructorDescription { case archivedStickers(count: Int32, sets: [Api.StickerSetCovered]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1415,7 +1415,7 @@ struct messages { } } - enum SentEncryptedMessage: TypeConstructorDescription { + indirect enum SentEncryptedMessage: TypeConstructorDescription { case sentEncryptedMessage(date: Int32) case sentEncryptedFile(date: Int32, file: Api.EncryptedFile) @@ -1475,7 +1475,7 @@ struct messages { } } - enum Stickers: TypeConstructorDescription { + indirect enum Stickers: TypeConstructorDescription { case stickersNotModified case stickers(hash: Int32, stickers: [Api.Document]) @@ -1531,7 +1531,7 @@ struct messages { } } - enum FoundStickerSets: TypeConstructorDescription { + indirect enum FoundStickerSets: TypeConstructorDescription { case foundStickerSetsNotModified case foundStickerSets(hash: Int32, sets: [Api.StickerSetCovered]) @@ -1587,7 +1587,7 @@ struct messages { } } - enum FoundGifs: TypeConstructorDescription { + indirect enum FoundGifs: TypeConstructorDescription { case foundGifs(nextOffset: Int32, results: [Api.FoundGif]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1631,7 +1631,7 @@ struct messages { } } - enum BotResults: TypeConstructorDescription { + indirect enum BotResults: TypeConstructorDescription { case botResults(flags: Int32, queryId: Int64, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, results: [Api.BotInlineResult], cacheTime: Int32, users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1703,7 +1703,7 @@ struct messages { } } - enum BotCallbackAnswer: TypeConstructorDescription { + indirect enum BotCallbackAnswer: TypeConstructorDescription { case botCallbackAnswer(flags: Int32, message: String?, url: String?, cacheTime: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1749,7 +1749,7 @@ struct messages { } } - enum Chats: TypeConstructorDescription { + indirect enum Chats: TypeConstructorDescription { case chats(chats: [Api.Chat]) case chatsSlice(count: Int32, chats: [Api.Chat]) @@ -1819,7 +1819,7 @@ struct messages { } } - enum DhConfig: TypeConstructorDescription { + indirect enum DhConfig: TypeConstructorDescription { case dhConfigNotModified(random: Buffer) case dhConfig(g: Int32, p: Buffer, version: Int32, random: Buffer) @@ -1885,7 +1885,7 @@ struct messages { } } - enum AffectedHistory: TypeConstructorDescription { + indirect enum AffectedHistory: TypeConstructorDescription { case affectedHistory(pts: Int32, ptsCount: Int32, offset: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1927,7 +1927,7 @@ struct messages { } } - enum MessageEditData: TypeConstructorDescription { + indirect enum MessageEditData: TypeConstructorDescription { case messageEditData(flags: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1961,7 +1961,7 @@ struct messages { } } - enum ChatFull: TypeConstructorDescription { + indirect enum ChatFull: TypeConstructorDescription { case chatFull(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2017,7 +2017,7 @@ struct messages { } } - enum StickerSetInstallResult: TypeConstructorDescription { + indirect enum StickerSetInstallResult: TypeConstructorDescription { case stickerSetInstallResultSuccess case stickerSetInstallResultArchive(sets: [Api.StickerSetCovered]) @@ -2069,7 +2069,7 @@ struct messages { } } - enum AffectedMessages: TypeConstructorDescription { + indirect enum AffectedMessages: TypeConstructorDescription { case affectedMessages(pts: Int32, ptsCount: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2107,7 +2107,7 @@ struct messages { } } - enum SavedGifs: TypeConstructorDescription { + indirect enum SavedGifs: TypeConstructorDescription { case savedGifsNotModified case savedGifs(hash: Int32, gifs: [Api.Document]) @@ -2163,7 +2163,7 @@ struct messages { } } - enum Messages: TypeConstructorDescription { + indirect enum Messages: TypeConstructorDescription { case messages(messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) case messagesNotModified(count: Int32) case messagesSlice(flags: Int32, count: Int32, messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) @@ -2355,7 +2355,7 @@ struct messages { } } - enum PeerDialogs: TypeConstructorDescription { + indirect enum PeerDialogs: TypeConstructorDescription { case peerDialogs(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], state: Api.updates.State) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2431,7 +2431,7 @@ struct messages { } } - enum RecentStickers: TypeConstructorDescription { + indirect enum RecentStickers: TypeConstructorDescription { case recentStickersNotModified case recentStickers(hash: Int32, packs: [Api.StickerPack], stickers: [Api.Document], dates: [Int32]) @@ -2507,7 +2507,7 @@ struct messages { } } - enum FeaturedStickers: TypeConstructorDescription { + indirect enum FeaturedStickers: TypeConstructorDescription { case featuredStickersNotModified case featuredStickers(hash: Int32, sets: [Api.StickerSetCovered], unread: [Int64]) @@ -2573,7 +2573,7 @@ struct messages { } } - enum Dialogs: TypeConstructorDescription { + indirect enum Dialogs: TypeConstructorDescription { case dialogs(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) case dialogsSlice(count: Int32, dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) case dialogsNotModified(count: Int32) @@ -2723,7 +2723,7 @@ struct messages { } } - enum FavedStickers: TypeConstructorDescription { + indirect enum FavedStickers: TypeConstructorDescription { case favedStickersNotModified case favedStickers(hash: Int32, packs: [Api.StickerPack], stickers: [Api.Document]) @@ -2789,7 +2789,7 @@ struct messages { } } - enum AllStickers: TypeConstructorDescription { + indirect enum AllStickers: TypeConstructorDescription { case allStickersNotModified case allStickers(hash: Int32, sets: [Api.StickerSet]) @@ -2845,7 +2845,7 @@ struct messages { } } - enum HighScores: TypeConstructorDescription { + indirect enum HighScores: TypeConstructorDescription { case highScores(scores: [Api.HighScore], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { diff --git a/TelegramCore/Api1.swift b/TelegramCore/Api1.swift index 15a19a2a46..720ed195ab 100644 --- a/TelegramCore/Api1.swift +++ b/TelegramCore/Api1.swift @@ -1,5 +1,5 @@ extension Api { - enum InputGeoPoint: TypeConstructorDescription { + indirect enum InputGeoPoint: TypeConstructorDescription { case inputGeoPointEmpty case inputGeoPoint(lat: Double, long: Double) @@ -49,7 +49,7 @@ extension Api { } } - enum ChatFull: TypeConstructorDescription { + indirect enum ChatFull: TypeConstructorDescription { case chatFull(flags: Int32, id: Int32, about: String, participants: Api.ChatParticipants, chatPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, exportedInvite: Api.ExportedChatInvite, botInfo: [Api.BotInfo]?, pinnedMsgId: Int32?, folderId: Int32?) case channelFull(flags: Int32, id: Int32, about: String, participantsCount: Int32?, adminsCount: Int32?, kickedCount: Int32?, bannedCount: Int32?, onlineCount: Int32?, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, chatPhoto: Api.Photo, notifySettings: Api.PeerNotifySettings, exportedInvite: Api.ExportedChatInvite, botInfo: [Api.BotInfo], migratedFromChatId: Int32?, migratedFromMaxId: Int32?, pinnedMsgId: Int32?, stickerset: Api.StickerSet?, availableMinId: Int32?, folderId: Int32?, pts: Int32) @@ -251,7 +251,7 @@ extension Api { } } - enum PollResults: TypeConstructorDescription { + indirect enum PollResults: TypeConstructorDescription { case pollResults(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -299,7 +299,7 @@ extension Api { } } - enum ChatParticipant: TypeConstructorDescription { + indirect enum ChatParticipant: TypeConstructorDescription { case chatParticipant(userId: Int32, inviterId: Int32, date: Int32) case chatParticipantCreator(userId: Int32) case chatParticipantAdmin(userId: Int32, inviterId: Int32, date: Int32) @@ -389,7 +389,7 @@ extension Api { } } - enum CdnConfig: TypeConstructorDescription { + indirect enum CdnConfig: TypeConstructorDescription { case cdnConfig(publicKeys: [Api.CdnPublicKey]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1245,7 +1245,7 @@ extension Api { } } - enum SecureRequiredType: TypeConstructorDescription { + indirect enum SecureRequiredType: TypeConstructorDescription { case secureRequiredType(flags: Int32, type: Api.SecureValueType) case secureRequiredTypeOneOf(types: [Api.SecureRequiredType]) @@ -1311,7 +1311,7 @@ extension Api { } } - enum JSONValue: TypeConstructorDescription { + indirect enum JSONValue: TypeConstructorDescription { case jsonNull case jsonBool(value: Api.Bool) case jsonNumber(value: Double) @@ -1451,7 +1451,7 @@ extension Api { } } - enum Photo: TypeConstructorDescription { + indirect enum Photo: TypeConstructorDescription { case photoEmpty(id: Int64) case photo(flags: Int32, id: Int64, accessHash: Int64, fileReference: Buffer, date: Int32, sizes: [Api.PhotoSize], dcId: Int32) @@ -1535,7 +1535,7 @@ extension Api { } } - enum Chat: TypeConstructorDescription { + indirect enum Chat: TypeConstructorDescription { case chatEmpty(id: Int32) case chatForbidden(id: Int32, title: String) case channelForbidden(flags: Int32, id: Int32, accessHash: Int64, title: String, untilDate: Int32?) @@ -1769,7 +1769,7 @@ extension Api { } } - enum StatsURL: TypeConstructorDescription { + indirect enum StatsURL: TypeConstructorDescription { case statsURL(url: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1803,7 +1803,7 @@ extension Api { } } - enum ChatInvite: TypeConstructorDescription { + indirect enum ChatInvite: TypeConstructorDescription { case chatInviteAlready(chat: Api.Chat) case chatInvite(flags: Int32, title: String, photo: Api.Photo, participantsCount: Int32, participants: [Api.User]?) @@ -1883,7 +1883,7 @@ extension Api { } } - enum AutoDownloadSettings: TypeConstructorDescription { + indirect enum AutoDownloadSettings: TypeConstructorDescription { case autoDownloadSettings(flags: Int32, photoSizeMax: Int32, videoSizeMax: Int32, fileSizeMax: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1929,7 +1929,7 @@ extension Api { } } - enum StickerSetCovered: TypeConstructorDescription { + indirect enum StickerSetCovered: TypeConstructorDescription { case stickerSetCovered(set: Api.StickerSet, cover: Api.Document) case stickerSetMultiCovered(set: Api.StickerSet, covers: [Api.Document]) @@ -2003,7 +2003,7 @@ extension Api { } } - enum RecentMeUrl: TypeConstructorDescription { + indirect enum RecentMeUrl: TypeConstructorDescription { case recentMeUrlUnknown(url: String) case recentMeUrlUser(url: String, userId: Int32) case recentMeUrlChat(url: String, chatId: Int32) @@ -2521,7 +2521,7 @@ extension Api { } } - enum UserFull: TypeConstructorDescription { + indirect enum UserFull: TypeConstructorDescription { case userFull(flags: Int32, user: Api.User, about: String?, link: Api.contacts.Link, profilePhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, botInfo: Api.BotInfo?, pinnedMsgId: Int32?, commonChatsCount: Int32, folderId: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2601,7 +2601,7 @@ extension Api { } } - enum InputChannel: TypeConstructorDescription { + indirect enum InputChannel: TypeConstructorDescription { case inputChannelEmpty case inputChannel(channelId: Int32, accessHash: Int64) @@ -2651,7 +2651,7 @@ extension Api { } } - enum DcOption: TypeConstructorDescription { + indirect enum DcOption: TypeConstructorDescription { case dcOption(flags: Int32, id: Int32, ipAddress: String, port: Int32, secret: Buffer?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2701,7 +2701,7 @@ extension Api { } } - enum PollAnswerVoters: TypeConstructorDescription { + indirect enum PollAnswerVoters: TypeConstructorDescription { case pollAnswerVoters(flags: Int32, option: Buffer, voters: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2743,7 +2743,7 @@ extension Api { } } - enum LangPackLanguage: TypeConstructorDescription { + indirect enum LangPackLanguage: TypeConstructorDescription { case langPackLanguage(flags: Int32, name: String, nativeName: String, langCode: String, baseLangCode: String?, pluralCode: String, stringsCount: Int32, translatedCount: Int32, translationsUrl: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2809,7 +2809,7 @@ extension Api { } } - enum LangPackDifference: TypeConstructorDescription { + indirect enum LangPackDifference: TypeConstructorDescription { case langPackDifference(langCode: String, fromVersion: Int32, version: Int32, strings: [Api.LangPackString]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2861,7 +2861,7 @@ extension Api { } } - enum WallPaperSettings: TypeConstructorDescription { + indirect enum WallPaperSettings: TypeConstructorDescription { case wallPaperSettings(flags: Int32, backgroundColor: Int32?, intensity: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2903,7 +2903,7 @@ extension Api { } } - enum EmojiURL: TypeConstructorDescription { + indirect enum EmojiURL: TypeConstructorDescription { case EmojiURL(url: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2937,7 +2937,7 @@ extension Api { } } - enum InputCheckPasswordSRP: TypeConstructorDescription { + indirect enum InputCheckPasswordSRP: TypeConstructorDescription { case inputCheckPasswordEmpty case inputCheckPasswordSRP(srpId: Int64, A: Buffer, M1: Buffer) @@ -2991,7 +2991,7 @@ extension Api { } } - enum InputEncryptedFile: TypeConstructorDescription { + indirect enum InputEncryptedFile: TypeConstructorDescription { case inputEncryptedFileEmpty case inputEncryptedFileUploaded(id: Int64, parts: Int32, md5Checksum: String, keyFingerprint: Int32) case inputEncryptedFile(id: Int64, accessHash: Int64) @@ -3101,7 +3101,7 @@ extension Api { } } - enum ExportedMessageLink: TypeConstructorDescription { + indirect enum ExportedMessageLink: TypeConstructorDescription { case exportedMessageLink(link: String, html: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -3139,7 +3139,7 @@ extension Api { } } - enum InputFile: TypeConstructorDescription { + indirect enum InputFile: TypeConstructorDescription { case inputFile(id: Int64, parts: Int32, name: String, md5Checksum: String) case inputFileBig(id: Int64, parts: Int32, name: String) @@ -3213,7 +3213,7 @@ extension Api { } } - enum Peer: TypeConstructorDescription { + indirect enum Peer: TypeConstructorDescription { case peerUser(userId: Int32) case peerChat(chatId: Int32) case peerChannel(channelId: Int32) @@ -3287,7 +3287,7 @@ extension Api { } } - enum PaymentRequestedInfo: TypeConstructorDescription { + indirect enum PaymentRequestedInfo: TypeConstructorDescription { case paymentRequestedInfo(flags: Int32, name: String?, phone: String?, email: String?, shippingAddress: Api.PostAddress?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -3339,7 +3339,7 @@ extension Api { } } - enum UserStatus: TypeConstructorDescription { + indirect enum UserStatus: TypeConstructorDescription { case userStatusEmpty case userStatusOnline(expires: Int32) case userStatusOffline(wasOnline: Int32) @@ -3441,7 +3441,7 @@ extension Api { } } - enum Folder: TypeConstructorDescription { + indirect enum Folder: TypeConstructorDescription { case folder(flags: Int32, id: Int32, title: String, photo: Api.ChatPhoto?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -3489,7 +3489,7 @@ extension Api { } } - enum Dialog: TypeConstructorDescription { + indirect enum Dialog: TypeConstructorDescription { case dialog(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, notifySettings: Api.PeerNotifySettings, pts: Int32?, draft: Api.DraftMessage?, folderId: Int32?) case dialogFolder(flags: Int32, folder: Api.Folder, peer: Api.Peer, topMessage: Int32, unreadMutedPeersCount: Int32, unreadUnmutedPeersCount: Int32, unreadMutedMessagesCount: Int32, unreadUnmutedMessagesCount: Int32) @@ -3621,7 +3621,7 @@ extension Api { } } - enum SendMessageAction: TypeConstructorDescription { + indirect enum SendMessageAction: TypeConstructorDescription { case sendMessageTypingAction case sendMessageCancelAction case sendMessageRecordVideoAction @@ -3831,7 +3831,7 @@ extension Api { } } - enum PrivacyKey: TypeConstructorDescription { + indirect enum PrivacyKey: TypeConstructorDescription { case privacyKeyStatusTimestamp case privacyKeyChatInvite case privacyKeyPhoneCall @@ -3917,7 +3917,7 @@ extension Api { } } - enum Update: TypeConstructorDescription { + indirect enum Update: TypeConstructorDescription { case updateNewMessage(message: Api.Message, pts: Int32, ptsCount: Int32) case updateMessageID(id: Int32, randomId: Int64) case updateDeleteMessages(messages: [Int32], pts: Int32, ptsCount: Int32) @@ -5931,7 +5931,7 @@ extension Api { } } - enum PopularContact: TypeConstructorDescription { + indirect enum PopularContact: TypeConstructorDescription { case popularContact(clientId: Int64, importers: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -5969,7 +5969,7 @@ extension Api { } } - enum FolderPeer: TypeConstructorDescription { + indirect enum FolderPeer: TypeConstructorDescription { case folderPeer(peer: Api.Peer, folderId: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -6009,7 +6009,7 @@ extension Api { } } - enum ChannelParticipant: TypeConstructorDescription { + indirect enum ChannelParticipant: TypeConstructorDescription { case channelParticipant(userId: Int32, date: Int32) case channelParticipantSelf(userId: Int32, inviterId: Int32, date: Int32) case channelParticipantCreator(userId: Int32) @@ -6175,7 +6175,7 @@ extension Api { } } - enum InputDialogPeer: TypeConstructorDescription { + indirect enum InputDialogPeer: TypeConstructorDescription { case inputDialogPeer(peer: Api.InputPeer) case inputDialogPeerFolder(folderId: Int32) @@ -6231,7 +6231,7 @@ extension Api { } } - enum Error: TypeConstructorDescription { + indirect enum Error: TypeConstructorDescription { case error(code: Int32, text: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -6269,7 +6269,7 @@ extension Api { } } - enum KeyboardButton: TypeConstructorDescription { + indirect enum KeyboardButton: TypeConstructorDescription { case keyboardButton(text: String) case keyboardButtonUrl(text: String, url: String) case keyboardButtonCallback(text: String, data: Buffer) @@ -6459,7 +6459,7 @@ extension Api { } } - enum ContactStatus: TypeConstructorDescription { + indirect enum ContactStatus: TypeConstructorDescription { case contactStatus(userId: Int32, status: Api.UserStatus) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -6499,7 +6499,7 @@ extension Api { } } - enum SecureFile: TypeConstructorDescription { + indirect enum SecureFile: TypeConstructorDescription { case secureFileEmpty case secureFile(id: Int64, accessHash: Int64, size: Int32, dcId: Int32, date: Int32, fileHash: Buffer, secret: Buffer) @@ -6569,7 +6569,7 @@ extension Api { } } - enum PhotoSize: TypeConstructorDescription { + indirect enum PhotoSize: TypeConstructorDescription { case photoSizeEmpty(type: String) case photoSize(type: String, location: Api.FileLocation, w: Int32, h: Int32, size: Int32) case photoCachedSize(type: String, location: Api.FileLocation, w: Int32, h: Int32, bytes: Buffer) @@ -6703,7 +6703,7 @@ extension Api { } } - enum InlineBotSwitchPM: TypeConstructorDescription { + indirect enum InlineBotSwitchPM: TypeConstructorDescription { case inlineBotSwitchPM(text: String, startParam: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -6741,7 +6741,7 @@ extension Api { } } - enum FileLocation: TypeConstructorDescription { + indirect enum FileLocation: TypeConstructorDescription { case fileLocationToBeDeprecated(volumeId: Int64, localId: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -6779,7 +6779,7 @@ extension Api { } } - enum Poll: TypeConstructorDescription { + indirect enum Poll: TypeConstructorDescription { case poll(id: Int64, flags: Int32, question: String, answers: [Api.PollAnswer]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -6831,14 +6831,20 @@ extension Api { } } - enum InputNotifyPeer: TypeConstructorDescription { + indirect enum InputNotifyPeer: TypeConstructorDescription { + case inputNotifyPeer(peer: Api.InputPeer) case inputNotifyUsers case inputNotifyChats case inputNotifyBroadcasts - case inputNotifyPeer(peer: Api.InputPeer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { + case .inputNotifyPeer(let peer): + if boxed { + buffer.appendInt32(-1195615476) + } + peer.serialize(buffer, true) + break case .inputNotifyUsers: if boxed { buffer.appendInt32(423314455) @@ -6856,38 +6862,23 @@ extension Api { buffer.appendInt32(-1311015810) } - break - case .inputNotifyPeer(let peer): - if boxed { - buffer.appendInt32(-1195615476) - } - peer.serialize(buffer, true) break } } func descriptionFields() -> (String, [(String, Any)]) { switch self { + case .inputNotifyPeer(let peer): + return ("inputNotifyPeer", [("peer", peer)]) case .inputNotifyUsers: return ("inputNotifyUsers", []) case .inputNotifyChats: return ("inputNotifyChats", []) case .inputNotifyBroadcasts: return ("inputNotifyBroadcasts", []) - case .inputNotifyPeer(let peer): - return ("inputNotifyPeer", [("peer", peer)]) } } - static func parse_inputNotifyUsers(_ reader: BufferReader) -> InputNotifyPeer? { - return Api.InputNotifyPeer.inputNotifyUsers - } - static func parse_inputNotifyChats(_ reader: BufferReader) -> InputNotifyPeer? { - return Api.InputNotifyPeer.inputNotifyChats - } - static func parse_inputNotifyBroadcasts(_ reader: BufferReader) -> InputNotifyPeer? { - return Api.InputNotifyPeer.inputNotifyBroadcasts - } static func parse_inputNotifyPeer(_ reader: BufferReader) -> InputNotifyPeer? { var _1: Api.InputPeer? if let signature = reader.readInt32() { @@ -6901,9 +6892,18 @@ extension Api { return nil } } + static func parse_inputNotifyUsers(_ reader: BufferReader) -> InputNotifyPeer? { + return Api.InputNotifyPeer.inputNotifyUsers + } + static func parse_inputNotifyChats(_ reader: BufferReader) -> InputNotifyPeer? { + return Api.InputNotifyPeer.inputNotifyChats + } + static func parse_inputNotifyBroadcasts(_ reader: BufferReader) -> InputNotifyPeer? { + return Api.InputNotifyPeer.inputNotifyBroadcasts + } } - enum EncryptedMessage: TypeConstructorDescription { + indirect enum EncryptedMessage: TypeConstructorDescription { case encryptedMessage(randomId: Int64, chatId: Int32, date: Int32, bytes: Buffer, file: Api.EncryptedFile) case encryptedMessageService(randomId: Int64, chatId: Int32, date: Int32, bytes: Buffer) @@ -6987,7 +6987,7 @@ extension Api { } } - enum ChannelParticipantsFilter: TypeConstructorDescription { + indirect enum ChannelParticipantsFilter: TypeConstructorDescription { case channelParticipantsRecent case channelParticipantsAdmins case channelParticipantsBots @@ -7117,7 +7117,7 @@ extension Api { } } - enum WebPage: TypeConstructorDescription { + indirect enum WebPage: TypeConstructorDescription { case webPageEmpty(id: Int64) case webPagePending(id: Int64, date: Int32) case webPage(flags: Int32, id: Int64, url: String, displayUrl: String, hash: Int32, type: String?, siteName: String?, title: String?, description: String?, photo: Api.Photo?, embedUrl: String?, embedType: String?, embedWidth: Int32?, embedHeight: Int32?, duration: Int32?, author: String?, document: Api.Document?, cachedPage: Api.Page?) @@ -7281,7 +7281,7 @@ extension Api { } } - enum InputBotInlineMessage: TypeConstructorDescription { + indirect enum InputBotInlineMessage: TypeConstructorDescription { case inputBotInlineMessageText(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) case inputBotInlineMessageMediaGeo(flags: Int32, geoPoint: Api.InputGeoPoint, replyMarkup: Api.ReplyMarkup?) case inputBotInlineMessageGame(flags: Int32, replyMarkup: Api.ReplyMarkup?) @@ -7527,7 +7527,7 @@ extension Api { } } - enum KeyboardButtonRow: TypeConstructorDescription { + indirect enum KeyboardButtonRow: TypeConstructorDescription { case keyboardButtonRow(buttons: [Api.KeyboardButton]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -7567,7 +7567,7 @@ extension Api { } } - enum StickerSet: TypeConstructorDescription { + indirect enum StickerSet: TypeConstructorDescription { case stickerSet(flags: Int32, installedDate: Int32?, id: Int64, accessHash: Int64, title: String, shortName: String, thumb: Api.PhotoSize?, thumbDcId: Int32?, count: Int32, hash: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -7639,7 +7639,7 @@ extension Api { } } - enum SecureSecretSettings: TypeConstructorDescription { + indirect enum SecureSecretSettings: TypeConstructorDescription { case secureSecretSettings(secureAlgo: Api.SecurePasswordKdfAlgo, secureSecret: Buffer, secureSecretId: Int64) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -7683,7 +7683,7 @@ extension Api { } } - enum InputContact: TypeConstructorDescription { + indirect enum InputContact: TypeConstructorDescription { case inputPhoneContact(clientId: Int64, phone: String, firstName: String, lastName: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -7729,7 +7729,7 @@ extension Api { } } - enum TopPeerCategory: TypeConstructorDescription { + indirect enum TopPeerCategory: TypeConstructorDescription { case topPeerCategoryBotsPM case topPeerCategoryBotsInline case topPeerCategoryCorrespondents @@ -7815,7 +7815,7 @@ extension Api { } } - enum ChannelMessagesFilter: TypeConstructorDescription { + indirect enum ChannelMessagesFilter: TypeConstructorDescription { case channelMessagesFilterEmpty case channelMessagesFilter(flags: Int32, ranges: [Api.MessageRange]) @@ -7871,7 +7871,7 @@ extension Api { } } - enum InputDocument: TypeConstructorDescription { + indirect enum InputDocument: TypeConstructorDescription { case inputDocumentEmpty case inputDocument(id: Int64, accessHash: Int64, fileReference: Buffer) @@ -7925,7 +7925,7 @@ extension Api { } } - enum PollAnswer: TypeConstructorDescription { + indirect enum PollAnswer: TypeConstructorDescription { case pollAnswer(text: String, option: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -7963,7 +7963,7 @@ extension Api { } } - enum SecureData: TypeConstructorDescription { + indirect enum SecureData: TypeConstructorDescription { case secureData(data: Buffer, dataHash: Buffer, secret: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -8005,7 +8005,7 @@ extension Api { } } - enum InputMedia: TypeConstructorDescription { + indirect enum InputMedia: TypeConstructorDescription { case inputMediaEmpty case inputMediaGeoPoint(geoPoint: Api.InputGeoPoint) case inputMediaGifExternal(url: String, q: String) @@ -8499,7 +8499,7 @@ extension Api { } } - enum InputPeer: TypeConstructorDescription { + indirect enum InputPeer: TypeConstructorDescription { case inputPeerEmpty case inputPeerSelf case inputPeerChat(chatId: Int32) @@ -8605,7 +8605,7 @@ extension Api { } } - enum Contact: TypeConstructorDescription { + indirect enum Contact: TypeConstructorDescription { case contact(userId: Int32, mutual: Api.Bool) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -8645,7 +8645,7 @@ extension Api { } } - enum FileHash: TypeConstructorDescription { + indirect enum FileHash: TypeConstructorDescription { case fileHash(offset: Int32, limit: Int32, hash: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -8687,7 +8687,7 @@ extension Api { } } - enum BotInlineResult: TypeConstructorDescription { + indirect enum BotInlineResult: TypeConstructorDescription { case botInlineMediaResult(flags: Int32, id: String, type: String, photo: Api.Photo?, document: Api.Document?, title: String?, description: String?, sendMessage: Api.BotInlineMessage) case botInlineResult(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.WebDocument?, content: Api.WebDocument?, sendMessage: Api.BotInlineMessage) @@ -8813,7 +8813,7 @@ extension Api { } } - enum InputSingleMedia: TypeConstructorDescription { + indirect enum InputSingleMedia: TypeConstructorDescription { case inputSingleMedia(flags: Int32, media: Api.InputMedia, randomId: Int64, message: String, entities: [Api.MessageEntity]?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -8871,7 +8871,7 @@ extension Api { } } - enum InputPrivacyRule: TypeConstructorDescription { + indirect enum InputPrivacyRule: TypeConstructorDescription { case inputPrivacyValueAllowContacts case inputPrivacyValueAllowAll case inputPrivacyValueAllowUsers(users: [Api.InputUser]) @@ -8985,7 +8985,7 @@ extension Api { } } - enum ChannelAdminLogEventAction: TypeConstructorDescription { + indirect enum ChannelAdminLogEventAction: TypeConstructorDescription { case channelAdminLogEventActionChangeTitle(prevValue: String, newValue: String) case channelAdminLogEventActionChangeAbout(prevValue: String, newValue: String) case channelAdminLogEventActionChangeUsername(prevValue: String, newValue: String) @@ -9417,7 +9417,7 @@ extension Api { } } - enum SecurePlainData: TypeConstructorDescription { + indirect enum SecurePlainData: TypeConstructorDescription { case securePlainPhone(phone: String) case securePlainEmail(email: String) @@ -9471,7 +9471,7 @@ extension Api { } } - enum PageTableCell: TypeConstructorDescription { + indirect enum PageTableCell: TypeConstructorDescription { case pageTableCell(flags: Int32, text: Api.RichText?, colspan: Int32?, rowspan: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -9519,7 +9519,7 @@ extension Api { } } - enum ChatBannedRights: TypeConstructorDescription { + indirect enum ChatBannedRights: TypeConstructorDescription { case chatBannedRights(flags: Int32, untilDate: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -9557,7 +9557,7 @@ extension Api { } } - enum LabeledPrice: TypeConstructorDescription { + indirect enum LabeledPrice: TypeConstructorDescription { case labeledPrice(label: String, amount: Int64) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -9595,7 +9595,7 @@ extension Api { } } - enum InputSecureValue: TypeConstructorDescription { + indirect enum InputSecureValue: TypeConstructorDescription { case inputSecureValue(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.InputSecureFile?, reverseSide: Api.InputSecureFile?, selfie: Api.InputSecureFile?, translation: [Api.InputSecureFile]?, files: [Api.InputSecureFile]?, plainData: Api.SecurePlainData?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -9685,7 +9685,7 @@ extension Api { } } - enum ReportReason: TypeConstructorDescription { + indirect enum ReportReason: TypeConstructorDescription { case inputReportReasonSpam case inputReportReasonViolence case inputReportReasonPornography @@ -9779,7 +9779,7 @@ extension Api { } } - enum InputEncryptedChat: TypeConstructorDescription { + indirect enum InputEncryptedChat: TypeConstructorDescription { case inputEncryptedChat(chatId: Int32, accessHash: Int64) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -9817,7 +9817,7 @@ extension Api { } } - enum PageTableRow: TypeConstructorDescription { + indirect enum PageTableRow: TypeConstructorDescription { case pageTableRow(cells: [Api.PageTableCell]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -9857,7 +9857,7 @@ extension Api { } } - enum DraftMessage: TypeConstructorDescription { + indirect enum DraftMessage: TypeConstructorDescription { case draftMessage(flags: Int32, replyToMsgId: Int32?, message: String, entities: [Api.MessageEntity]?, date: Int32) case draftMessageEmpty(flags: Int32, date: Int32?) @@ -9937,7 +9937,7 @@ extension Api { } } - enum EncryptedFile: TypeConstructorDescription { + indirect enum EncryptedFile: TypeConstructorDescription { case encryptedFileEmpty case encryptedFile(id: Int64, accessHash: Int64, size: Int32, dcId: Int32, keyFingerprint: Int32) @@ -9999,7 +9999,7 @@ extension Api { } } - enum SecureValueError: TypeConstructorDescription { + indirect enum SecureValueError: TypeConstructorDescription { case secureValueErrorData(type: Api.SecureValueType, dataHash: Buffer, field: String, text: String) case secureValueErrorFrontSide(type: Api.SecureValueType, fileHash: Buffer, text: String) case secureValueErrorReverseSide(type: Api.SecureValueType, fileHash: Buffer, text: String) @@ -10299,7 +10299,7 @@ extension Api { } } - enum NotifyPeer: TypeConstructorDescription { + indirect enum NotifyPeer: TypeConstructorDescription { case notifyPeer(peer: Api.Peer) case notifyUsers case notifyChats @@ -10371,7 +10371,7 @@ extension Api { } } - enum InputPrivacyKey: TypeConstructorDescription { + indirect enum InputPrivacyKey: TypeConstructorDescription { case inputPrivacyKeyStatusTimestamp case inputPrivacyKeyChatInvite case inputPrivacyKeyPhoneCall @@ -10457,7 +10457,7 @@ extension Api { } } - enum ReplyMarkup: TypeConstructorDescription { + indirect enum ReplyMarkup: TypeConstructorDescription { case replyKeyboardHide(flags: Int32) case replyKeyboardForceReply(flags: Int32) case replyKeyboardMarkup(flags: Int32, rows: [Api.KeyboardButtonRow]) @@ -10567,7 +10567,7 @@ extension Api { } } - enum EmojiKeywordsDifference: TypeConstructorDescription { + indirect enum EmojiKeywordsDifference: TypeConstructorDescription { case emojiKeywordsDifference(langCode: String, fromVersion: Int32, version: Int32, keywords: [Api.EmojiKeyword]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -10619,7 +10619,7 @@ extension Api { } } - enum HighScore: TypeConstructorDescription { + indirect enum HighScore: TypeConstructorDescription { case highScore(pos: Int32, userId: Int32, score: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -10661,7 +10661,7 @@ extension Api { } } - enum TopPeer: TypeConstructorDescription { + indirect enum TopPeer: TypeConstructorDescription { case topPeer(peer: Api.Peer, rating: Double) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -10701,7 +10701,7 @@ extension Api { } } - enum SecureValue: TypeConstructorDescription { + indirect enum SecureValue: TypeConstructorDescription { case secureValue(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.SecureFile?, reverseSide: Api.SecureFile?, selfie: Api.SecureFile?, translation: [Api.SecureFile]?, files: [Api.SecureFile]?, plainData: Api.SecurePlainData?, hash: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -10795,7 +10795,7 @@ extension Api { } } - enum SecureValueHash: TypeConstructorDescription { + indirect enum SecureValueHash: TypeConstructorDescription { case secureValueHash(type: Api.SecureValueType, hash: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -10835,7 +10835,7 @@ extension Api { } } - enum ContactBlocked: TypeConstructorDescription { + indirect enum ContactBlocked: TypeConstructorDescription { case contactBlocked(userId: Int32, date: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -10873,7 +10873,7 @@ extension Api { } } - enum PageListItem: TypeConstructorDescription { + indirect enum PageListItem: TypeConstructorDescription { case pageListItemText(text: Api.RichText) case pageListItemBlocks(blocks: [Api.PageBlock]) @@ -10935,7 +10935,7 @@ extension Api { } } - enum InputUser: TypeConstructorDescription { + indirect enum InputUser: TypeConstructorDescription { case inputUserEmpty case inputUserSelf case inputUser(userId: Int32, accessHash: Int64) @@ -10997,7 +10997,7 @@ extension Api { } } - enum Page: TypeConstructorDescription { + indirect enum Page: TypeConstructorDescription { case page(flags: Int32, url: String, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11065,7 +11065,7 @@ extension Api { } } - enum SecureCredentialsEncrypted: TypeConstructorDescription { + indirect enum SecureCredentialsEncrypted: TypeConstructorDescription { case secureCredentialsEncrypted(data: Buffer, hash: Buffer, secret: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11107,7 +11107,7 @@ extension Api { } } - enum MessageRange: TypeConstructorDescription { + indirect enum MessageRange: TypeConstructorDescription { case messageRange(minId: Int32, maxId: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11145,7 +11145,7 @@ extension Api { } } - enum Config: TypeConstructorDescription { + indirect enum Config: TypeConstructorDescription { case config(flags: Int32, date: Int32, expires: Int32, testMode: Api.Bool, thisDc: Int32, dcOptions: [Api.DcOption], dcTxtDomainName: String, chatSizeMax: Int32, megagroupSizeMax: Int32, forwardedCountMax: Int32, onlineUpdatePeriodMs: Int32, offlineBlurTimeoutMs: Int32, offlineIdleTimeoutMs: Int32, onlineCloudTimeoutMs: Int32, notifyCloudDelayMs: Int32, notifyDefaultDelayMs: Int32, pushChatPeriodMs: Int32, pushChatLimit: Int32, savedGifsLimit: Int32, editTimeLimit: Int32, revokeTimeLimit: Int32, revokePmTimeLimit: Int32, ratingEDecay: Int32, stickersRecentLimit: Int32, stickersFavedLimit: Int32, channelsReadMediaPeriod: Int32, tmpSessions: Int32?, pinnedDialogsCountMax: Int32, pinnedInfolderCountMax: Int32, callReceiveTimeoutMs: Int32, callRingTimeoutMs: Int32, callConnectTimeoutMs: Int32, callPacketTimeoutMs: Int32, meUrlPrefix: String, autoupdateUrlPrefix: String?, gifSearchUsername: String?, venueSearchUsername: String?, imgSearchUsername: String?, staticMapsProvider: String?, captionLengthMax: Int32, messageLengthMax: Int32, webfileDcId: Int32, suggestedLangCode: String?, langPackVersion: Int32?, baseLangPackVersion: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11363,7 +11363,7 @@ extension Api { } } - enum TopPeerCategoryPeers: TypeConstructorDescription { + indirect enum TopPeerCategoryPeers: TypeConstructorDescription { case topPeerCategoryPeers(category: Api.TopPeerCategory, count: Int32, peers: [Api.TopPeer]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11413,7 +11413,7 @@ extension Api { } } - enum Game: TypeConstructorDescription { + indirect enum Game: TypeConstructorDescription { case game(flags: Int32, id: Int64, accessHash: Int64, shortName: String, title: String, description: String, photo: Api.Photo, document: Api.Document?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11479,7 +11479,7 @@ extension Api { } } - enum ChatAdminRights: TypeConstructorDescription { + indirect enum ChatAdminRights: TypeConstructorDescription { case chatAdminRights(flags: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11513,7 +11513,7 @@ extension Api { } } - enum SecurePasswordKdfAlgo: TypeConstructorDescription { + indirect enum SecurePasswordKdfAlgo: TypeConstructorDescription { case securePasswordKdfAlgoUnknown case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: Buffer) case securePasswordKdfAlgoSHA512(salt: Buffer) @@ -11579,7 +11579,7 @@ extension Api { } } - enum BotCommand: TypeConstructorDescription { + indirect enum BotCommand: TypeConstructorDescription { case botCommand(command: String, description: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11617,7 +11617,7 @@ extension Api { } } - enum CdnPublicKey: TypeConstructorDescription { + indirect enum CdnPublicKey: TypeConstructorDescription { case cdnPublicKey(dcId: Int32, publicKey: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11655,7 +11655,7 @@ extension Api { } } - enum InputGame: TypeConstructorDescription { + indirect enum InputGame: TypeConstructorDescription { case inputGameID(id: Int64, accessHash: Int64) case inputGameShortName(botId: Api.InputUser, shortName: String) @@ -11719,7 +11719,7 @@ extension Api { } } - enum InputMessage: TypeConstructorDescription { + indirect enum InputMessage: TypeConstructorDescription { case inputMessageID(id: Int32) case inputMessageReplyTo(id: Int32) case inputMessagePinned @@ -11785,7 +11785,7 @@ extension Api { } } - enum PhoneCallProtocol: TypeConstructorDescription { + indirect enum PhoneCallProtocol: TypeConstructorDescription { case phoneCallProtocol(flags: Int32, minLayer: Int32, maxLayer: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11827,7 +11827,7 @@ extension Api { } } - enum WallPaper: TypeConstructorDescription { + indirect enum WallPaper: TypeConstructorDescription { case wallPaper(id: Int64, flags: Int32, accessHash: Int64, slug: String, document: Api.Document, settings: Api.WallPaperSettings?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11885,7 +11885,7 @@ extension Api { } } - enum Invoice: TypeConstructorDescription { + indirect enum Invoice: TypeConstructorDescription { case invoice(flags: Int32, currency: String, prices: [Api.LabeledPrice]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11933,7 +11933,7 @@ extension Api { } } - enum PeerSettings: TypeConstructorDescription { + indirect enum PeerSettings: TypeConstructorDescription { case peerSettings(flags: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -11967,7 +11967,7 @@ extension Api { } } - enum InputChatPhoto: TypeConstructorDescription { + indirect enum InputChatPhoto: TypeConstructorDescription { case inputChatPhotoEmpty case inputChatUploadedPhoto(file: Api.InputFile) case inputChatPhoto(id: Api.InputPhoto) @@ -12037,7 +12037,7 @@ extension Api { } } - enum PaymentCharge: TypeConstructorDescription { + indirect enum PaymentCharge: TypeConstructorDescription { case paymentCharge(id: String, providerChargeId: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -12075,7 +12075,7 @@ extension Api { } } - enum Updates: TypeConstructorDescription { + indirect enum Updates: TypeConstructorDescription { case updatesTooLong case updateShortMessage(flags: Int32, id: Int32, userId: Int32, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int32?, replyToMsgId: Int32?, entities: [Api.MessageEntity]?) case updateShortChatMessage(flags: Int32, id: Int32, fromId: Int32, chatId: Int32, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int32?, replyToMsgId: Int32?, entities: [Api.MessageEntity]?) @@ -12431,7 +12431,7 @@ extension Api { } } - enum MessageMedia: TypeConstructorDescription { + indirect enum MessageMedia: TypeConstructorDescription { case messageMediaEmpty case messageMediaGeo(geo: Api.GeoPoint) case messageMediaUnsupported @@ -12777,7 +12777,7 @@ extension Api { } } - enum PaymentSavedCredentials: TypeConstructorDescription { + indirect enum PaymentSavedCredentials: TypeConstructorDescription { case paymentSavedCredentialsCard(id: String, title: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -12815,7 +12815,7 @@ extension Api { } } - enum Null: TypeConstructorDescription { + indirect enum Null: TypeConstructorDescription { case null func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -12841,7 +12841,7 @@ extension Api { } } - enum DocumentAttribute: TypeConstructorDescription { + indirect enum DocumentAttribute: TypeConstructorDescription { case documentAttributeImageSize(w: Int32, h: Int32) case documentAttributeAnimated case documentAttributeSticker(flags: Int32, alt: String, stickerset: Api.InputStickerSet, maskCoords: Api.MaskCoords?) @@ -13027,7 +13027,7 @@ extension Api { } } - enum ChatPhoto: TypeConstructorDescription { + indirect enum ChatPhoto: TypeConstructorDescription { case chatPhotoEmpty case chatPhoto(photoSmall: Api.FileLocation, photoBig: Api.FileLocation, dcId: Int32) @@ -13085,7 +13085,7 @@ extension Api { } } - enum PageCaption: TypeConstructorDescription { + indirect enum PageCaption: TypeConstructorDescription { case pageCaption(text: Api.RichText, credit: Api.RichText) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -13127,7 +13127,7 @@ extension Api { } } - enum InputStickerSet: TypeConstructorDescription { + indirect enum InputStickerSet: TypeConstructorDescription { case inputStickerSetEmpty case inputStickerSetID(id: Int64, accessHash: Int64) case inputStickerSetShortName(shortName: String) @@ -13197,7 +13197,7 @@ extension Api { } } - enum BotInfo: TypeConstructorDescription { + indirect enum BotInfo: TypeConstructorDescription { case botInfo(userId: Int32, description: String, commands: [Api.BotCommand]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -13245,7 +13245,7 @@ extension Api { } } - enum FoundGif: TypeConstructorDescription { + indirect enum FoundGif: TypeConstructorDescription { case foundGif(url: String, thumbUrl: String, contentUrl: String, contentType: String, w: Int32, h: Int32) case foundGifCached(url: String, photo: Api.Photo, document: Api.Document) @@ -13331,7 +13331,7 @@ extension Api { } } - enum User: TypeConstructorDescription { + indirect enum User: TypeConstructorDescription { case userEmpty(id: Int32) case user(flags: Int32, id: Int32, accessHash: Int64?, firstName: String?, lastName: String?, username: String?, phone: String?, photo: Api.UserProfilePhoto?, status: Api.UserStatus?, botInfoVersion: Int32?, restrictionReason: String?, botInlinePlaceholder: String?, langCode: String?) @@ -13437,7 +13437,7 @@ extension Api { } } - enum Message: TypeConstructorDescription { + indirect enum Message: TypeConstructorDescription { case messageEmpty(id: Int32) case messageService(flags: Int32, id: Int32, fromId: Int32?, toId: Api.Peer, replyToMsgId: Int32?, date: Int32, action: Api.MessageAction) case message(flags: Int32, id: Int32, fromId: Int32?, toId: Api.Peer, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int32?, replyToMsgId: Int32?, date: Int32, message: String, media: Api.MessageMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, views: Int32?, editDate: Int32?, postAuthor: String?, groupedId: Int64?) @@ -13613,7 +13613,7 @@ extension Api { } } - enum InputFileLocation: TypeConstructorDescription { + indirect enum InputFileLocation: TypeConstructorDescription { case inputEncryptedFileLocation(id: Int64, accessHash: Int64) case inputSecureFileLocation(id: Int64, accessHash: Int64) case inputFileLocation(volumeId: Int64, localId: Int32, secret: Int64, fileReference: Buffer) @@ -13835,7 +13835,7 @@ extension Api { } } - enum GeoPoint: TypeConstructorDescription { + indirect enum GeoPoint: TypeConstructorDescription { case geoPointEmpty case geoPoint(long: Double, lat: Double, accessHash: Int64) @@ -13889,7 +13889,7 @@ extension Api { } } - enum InputPhoneCall: TypeConstructorDescription { + indirect enum InputPhoneCall: TypeConstructorDescription { case inputPhoneCall(id: Int64, accessHash: Int64) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -13927,7 +13927,7 @@ extension Api { } } - enum ReceivedNotifyMessage: TypeConstructorDescription { + indirect enum ReceivedNotifyMessage: TypeConstructorDescription { case receivedNotifyMessage(id: Int32, flags: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -13965,7 +13965,7 @@ extension Api { } } - enum ChatParticipants: TypeConstructorDescription { + indirect enum ChatParticipants: TypeConstructorDescription { case chatParticipantsForbidden(flags: Int32, chatId: Int32, selfParticipant: Api.ChatParticipant?) case chatParticipants(chatId: Int32, participants: [Api.ChatParticipant], version: Int32) @@ -14043,7 +14043,7 @@ extension Api { } } - enum InputPaymentCredentials: TypeConstructorDescription { + indirect enum InputPaymentCredentials: TypeConstructorDescription { case inputPaymentCredentialsSaved(id: String, tmpPassword: Buffer) case inputPaymentCredentials(flags: Int32, data: Api.DataJSON) case inputPaymentCredentialsApplePay(paymentData: Api.DataJSON) @@ -14155,7 +14155,7 @@ extension Api { } } - enum ShippingOption: TypeConstructorDescription { + indirect enum ShippingOption: TypeConstructorDescription { case shippingOption(id: String, title: String, prices: [Api.LabeledPrice]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14203,7 +14203,7 @@ extension Api { } } - enum InputSecureFile: TypeConstructorDescription { + indirect enum InputSecureFile: TypeConstructorDescription { case inputSecureFileUploaded(id: Int64, parts: Int32, md5Checksum: String, fileHash: Buffer, secret: Buffer) case inputSecureFile(id: Int64, accessHash: Int64) @@ -14277,7 +14277,7 @@ extension Api { } } - enum PostAddress: TypeConstructorDescription { + indirect enum PostAddress: TypeConstructorDescription { case postAddress(streetLine1: String, streetLine2: String, city: String, state: String, countryIso2: String, postCode: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14331,7 +14331,7 @@ extension Api { } } - enum InputFolderPeer: TypeConstructorDescription { + indirect enum InputFolderPeer: TypeConstructorDescription { case inputFolderPeer(peer: Api.InputPeer, folderId: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14371,7 +14371,7 @@ extension Api { } } - enum DataJSON: TypeConstructorDescription { + indirect enum DataJSON: TypeConstructorDescription { case dataJSON(data: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14405,7 +14405,7 @@ extension Api { } } - enum InputWallPaper: TypeConstructorDescription { + indirect enum InputWallPaper: TypeConstructorDescription { case inputWallPaper(id: Int64, accessHash: Int64) case inputWallPaperSlug(slug: String) @@ -14463,7 +14463,7 @@ extension Api { } } - enum InputStickeredMedia: TypeConstructorDescription { + indirect enum InputStickeredMedia: TypeConstructorDescription { case inputStickeredMediaPhoto(id: Api.InputPhoto) case inputStickeredMediaDocument(id: Api.InputDocument) @@ -14521,7 +14521,7 @@ extension Api { } } - enum PhoneCallDiscardReason: TypeConstructorDescription { + indirect enum PhoneCallDiscardReason: TypeConstructorDescription { case phoneCallDiscardReasonMissed case phoneCallDiscardReasonDisconnect case phoneCallDiscardReasonHangup @@ -14583,7 +14583,7 @@ extension Api { } } - enum NearestDc: TypeConstructorDescription { + indirect enum NearestDc: TypeConstructorDescription { case nearestDc(country: String, thisDc: Int32, nearestDc: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14625,7 +14625,7 @@ extension Api { } } - enum JSONObjectValue: TypeConstructorDescription { + indirect enum JSONObjectValue: TypeConstructorDescription { case jsonObjectValue(key: String, value: Api.JSONValue) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14665,7 +14665,7 @@ extension Api { } } - enum InputWebDocument: TypeConstructorDescription { + indirect enum InputWebDocument: TypeConstructorDescription { case inputWebDocument(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14717,7 +14717,7 @@ extension Api { } } - enum ChannelAdminLogEvent: TypeConstructorDescription { + indirect enum ChannelAdminLogEvent: TypeConstructorDescription { case channelAdminLogEvent(id: Int64, date: Int32, userId: Int32, action: Api.ChannelAdminLogEventAction) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -14765,7 +14765,7 @@ extension Api { } } - enum Bool: TypeConstructorDescription { + indirect enum Bool: TypeConstructorDescription { case boolFalse case boolTrue @@ -14803,7 +14803,7 @@ extension Api { } } - enum LangPackString: TypeConstructorDescription { + indirect enum LangPackString: TypeConstructorDescription { case langPackString(key: String, value: String) case langPackStringPluralized(flags: Int32, key: String, zeroValue: String?, oneValue: String?, twoValue: String?, fewValue: String?, manyValue: String?, otherValue: String) case langPackStringDeleted(key: String) @@ -14909,7 +14909,7 @@ extension Api { } } - enum InputWebFileLocation: TypeConstructorDescription { + indirect enum InputWebFileLocation: TypeConstructorDescription { case inputWebFileLocation(url: String, accessHash: Int64) case inputWebFileGeoMessageLocation(peer: Api.InputPeer, msgId: Int32, w: Int32, h: Int32, zoom: Int32, scale: Int32) case inputWebFileGeoPointLocation(geoPoint: Api.InputGeoPoint, accessHash: Int64, w: Int32, h: Int32, zoom: Int32, scale: Int32) @@ -15031,7 +15031,7 @@ extension Api { } } - enum MessageFwdHeader: TypeConstructorDescription { + indirect enum MessageFwdHeader: TypeConstructorDescription { case messageFwdHeader(flags: Int32, fromId: Int32?, fromName: String?, date: Int32, channelId: Int32?, channelPost: Int32?, postAuthor: String?, savedFromPeer: Api.Peer?, savedFromMsgId: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -15099,7 +15099,7 @@ extension Api { } } - enum MessagesFilter: TypeConstructorDescription { + indirect enum MessagesFilter: TypeConstructorDescription { case inputMessagesFilterEmpty case inputMessagesFilterPhotos case inputMessagesFilterVideo @@ -15337,7 +15337,7 @@ extension Api { } } - enum EmojiKeyword: TypeConstructorDescription { + indirect enum EmojiKeyword: TypeConstructorDescription { case emojiKeyword(keyword: String, emoticons: [String]) case emojiKeywordDeleted(keyword: String, emoticons: [String]) @@ -15411,7 +15411,7 @@ extension Api { } } - enum BotInlineMessage: TypeConstructorDescription { + indirect enum BotInlineMessage: TypeConstructorDescription { case botInlineMessageText(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) case botInlineMessageMediaGeo(flags: Int32, geo: Api.GeoPoint, replyMarkup: Api.ReplyMarkup?) case botInlineMessageMediaAuto(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) @@ -15631,7 +15631,7 @@ extension Api { } } - enum InputPeerNotifySettings: TypeConstructorDescription { + indirect enum InputPeerNotifySettings: TypeConstructorDescription { case inputPeerNotifySettings(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, sound: String?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -15685,7 +15685,7 @@ extension Api { } } - enum ExportedChatInvite: TypeConstructorDescription { + indirect enum ExportedChatInvite: TypeConstructorDescription { case chatInviteEmpty case chatInviteExported(link: String) @@ -15731,7 +15731,7 @@ extension Api { } } - enum Authorization: TypeConstructorDescription { + indirect enum Authorization: TypeConstructorDescription { case authorization(flags: Int32, hash: Int64, deviceModel: String, platform: String, systemVersion: String, apiId: Int32, appName: String, appVersion: String, dateCreated: Int32, dateActive: Int32, ip: String, country: String, region: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -15813,7 +15813,7 @@ extension Api { } } - enum MaskCoords: TypeConstructorDescription { + indirect enum MaskCoords: TypeConstructorDescription { case maskCoords(n: Int32, x: Double, y: Double, zoom: Double) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -15859,7 +15859,7 @@ extension Api { } } - enum PhoneConnection: TypeConstructorDescription { + indirect enum PhoneConnection: TypeConstructorDescription { case phoneConnection(id: Int64, ip: String, ipv6: String, port: Int32, peerTag: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -15909,7 +15909,7 @@ extension Api { } } - enum AccountDaysTTL: TypeConstructorDescription { + indirect enum AccountDaysTTL: TypeConstructorDescription { case accountDaysTTL(days: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -15943,7 +15943,7 @@ extension Api { } } - enum SecureValueType: TypeConstructorDescription { + indirect enum SecureValueType: TypeConstructorDescription { case secureValueTypePersonalDetails case secureValueTypePassport case secureValueTypeDriverLicense @@ -16113,7 +16113,7 @@ extension Api { } } - enum PasswordKdfAlgo: TypeConstructorDescription { + indirect enum PasswordKdfAlgo: TypeConstructorDescription { case passwordKdfAlgoUnknown case passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: Buffer, salt2: Buffer, g: Int32, p: Buffer) @@ -16171,7 +16171,7 @@ extension Api { } } - enum InputBotInlineResult: TypeConstructorDescription { + indirect enum InputBotInlineResult: TypeConstructorDescription { case inputBotInlineResultPhoto(id: String, type: String, photo: Api.InputPhoto, sendMessage: Api.InputBotInlineMessage) case inputBotInlineResultDocument(flags: Int32, id: String, type: String, title: String?, description: String?, document: Api.InputDocument, sendMessage: Api.InputBotInlineMessage) case inputBotInlineResultGame(id: String, shortName: String, sendMessage: Api.InputBotInlineMessage) @@ -16357,7 +16357,7 @@ extension Api { } } - enum PrivacyRule: TypeConstructorDescription { + indirect enum PrivacyRule: TypeConstructorDescription { case privacyValueAllowContacts case privacyValueAllowAll case privacyValueAllowUsers(users: [Int32]) @@ -16471,7 +16471,7 @@ extension Api { } } - enum MessageAction: TypeConstructorDescription { + indirect enum MessageAction: TypeConstructorDescription { case messageActionEmpty case messageActionChatCreate(title: String, users: [Int32]) case messageActionChatEditTitle(title: String) @@ -16987,7 +16987,7 @@ extension Api { } } - enum PhoneCall: TypeConstructorDescription { + indirect enum PhoneCall: TypeConstructorDescription { case phoneCallEmpty(id: Int64) case phoneCallWaiting(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int32, participantId: Int32, protocol: Api.PhoneCallProtocol, receiveDate: Int32?) case phoneCallRequested(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int32, participantId: Int32, gAHash: Buffer, protocol: Api.PhoneCallProtocol) @@ -17273,7 +17273,7 @@ extension Api { } } - enum DialogPeer: TypeConstructorDescription { + indirect enum DialogPeer: TypeConstructorDescription { case dialogPeer(peer: Api.Peer) case dialogPeerFolder(folderId: Int32) @@ -17329,7 +17329,7 @@ extension Api { } } - enum ContactLink: TypeConstructorDescription { + indirect enum ContactLink: TypeConstructorDescription { case contactLinkUnknown case contactLinkNone case contactLinkHasPhone @@ -17391,7 +17391,7 @@ extension Api { } } - enum WebDocument: TypeConstructorDescription { + indirect enum WebDocument: TypeConstructorDescription { case webDocumentNoProxy(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) case webDocument(url: String, accessHash: Int64, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) @@ -17485,7 +17485,7 @@ extension Api { } } - enum ChannelAdminLogEventsFilter: TypeConstructorDescription { + indirect enum ChannelAdminLogEventsFilter: TypeConstructorDescription { case channelAdminLogEventsFilter(flags: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -17519,7 +17519,7 @@ extension Api { } } - enum PeerNotifySettings: TypeConstructorDescription { + indirect enum PeerNotifySettings: TypeConstructorDescription { case peerNotifySettingsEmpty case peerNotifySettings(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, sound: String?) @@ -17585,7 +17585,7 @@ extension Api { } } - enum InputBotInlineMessageID: TypeConstructorDescription { + indirect enum InputBotInlineMessageID: TypeConstructorDescription { case inputBotInlineMessageID(dcId: Int32, id: Int64, accessHash: Int64) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -17627,7 +17627,7 @@ extension Api { } } - enum PageRelatedArticle: TypeConstructorDescription { + indirect enum PageRelatedArticle: TypeConstructorDescription { case pageRelatedArticle(flags: Int32, url: String, webpageId: Int64, title: String?, description: String?, photoId: Int64?, author: String?, publishedDate: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -17689,7 +17689,7 @@ extension Api { } } - enum StickerPack: TypeConstructorDescription { + indirect enum StickerPack: TypeConstructorDescription { case stickerPack(emoticon: String, documents: [Int64]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -17733,7 +17733,7 @@ extension Api { } } - enum UserProfilePhoto: TypeConstructorDescription { + indirect enum UserProfilePhoto: TypeConstructorDescription { case userProfilePhotoEmpty case userProfilePhoto(photoId: Int64, photoSmall: Api.FileLocation, photoBig: Api.FileLocation, dcId: Int32) @@ -17795,7 +17795,7 @@ extension Api { } } - enum ChatOnlines: TypeConstructorDescription { + indirect enum ChatOnlines: TypeConstructorDescription { case chatOnlines(onlines: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -17829,7 +17829,7 @@ extension Api { } } - enum InputAppEvent: TypeConstructorDescription { + indirect enum InputAppEvent: TypeConstructorDescription { case inputAppEvent(time: Double, type: String, peer: Int64, data: Api.JSONValue) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -17877,7 +17877,7 @@ extension Api { } } - enum MessageEntity: TypeConstructorDescription { + indirect enum MessageEntity: TypeConstructorDescription { case messageEntityUnknown(offset: Int32, length: Int32) case messageEntityMention(offset: Int32, length: Int32) case messageEntityHashtag(offset: Int32, length: Int32) @@ -18269,7 +18269,7 @@ extension Api { } } - enum InputPhoto: TypeConstructorDescription { + indirect enum InputPhoto: TypeConstructorDescription { case inputPhotoEmpty case inputPhoto(id: Int64, accessHash: Int64, fileReference: Buffer) @@ -18323,7 +18323,7 @@ extension Api { } } - enum PageListOrderedItem: TypeConstructorDescription { + indirect enum PageListOrderedItem: TypeConstructorDescription { case pageListOrderedItemText(num: String, text: Api.RichText) case pageListOrderedItemBlocks(num: String, blocks: [Api.PageBlock]) @@ -18393,7 +18393,7 @@ extension Api { } } - enum EncryptedChat: TypeConstructorDescription { + indirect enum EncryptedChat: TypeConstructorDescription { case encryptedChatEmpty(id: Int32) case encryptedChatWaiting(id: Int32, accessHash: Int64, date: Int32, adminId: Int32, participantId: Int32) case encryptedChatRequested(id: Int32, accessHash: Int64, date: Int32, adminId: Int32, participantId: Int32, gA: Buffer) @@ -18567,7 +18567,7 @@ extension Api { } } - enum Document: TypeConstructorDescription { + indirect enum Document: TypeConstructorDescription { case documentEmpty(id: Int64) case document(flags: Int32, id: Int64, accessHash: Int64, fileReference: Buffer, date: Int32, mimeType: String, size: Int32, thumbs: [Api.PhotoSize]?, dcId: Int32, attributes: [Api.DocumentAttribute]) @@ -18669,7 +18669,7 @@ extension Api { } } - enum WebAuthorization: TypeConstructorDescription { + indirect enum WebAuthorization: TypeConstructorDescription { case webAuthorization(hash: Int64, botId: Int32, domain: String, browser: String, platform: String, dateCreated: Int32, dateActive: Int32, ip: String, region: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -18735,7 +18735,7 @@ extension Api { } } - enum ImportedContact: TypeConstructorDescription { + indirect enum ImportedContact: TypeConstructorDescription { case importedContact(userId: Int32, clientId: Int64) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { diff --git a/TelegramCore/Api2.swift b/TelegramCore/Api2.swift index a10a96d4cf..8bea98ccc6 100644 --- a/TelegramCore/Api2.swift +++ b/TelegramCore/Api2.swift @@ -1,6 +1,6 @@ extension Api { struct channels { - enum ChannelParticipants: TypeConstructorDescription { + indirect enum ChannelParticipants: TypeConstructorDescription { case channelParticipants(count: Int32, participants: [Api.ChannelParticipant], users: [Api.User]) case channelParticipantsNotModified @@ -66,7 +66,7 @@ struct channels { } } - enum ChannelParticipant: TypeConstructorDescription { + indirect enum ChannelParticipant: TypeConstructorDescription { case channelParticipant(participant: Api.ChannelParticipant, users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -112,7 +112,7 @@ struct channels { } } - enum AdminLogResults: TypeConstructorDescription { + indirect enum AdminLogResults: TypeConstructorDescription { case adminLogResults(events: [Api.ChannelAdminLogEvent], chats: [Api.Chat], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -176,7 +176,7 @@ struct channels { } extension Api { struct payments { - enum ValidatedRequestedInfo: TypeConstructorDescription { + indirect enum ValidatedRequestedInfo: TypeConstructorDescription { case validatedRequestedInfo(flags: Int32, id: String?, shippingOptions: [Api.ShippingOption]?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -224,7 +224,7 @@ struct payments { } } - enum PaymentResult: TypeConstructorDescription { + indirect enum PaymentResult: TypeConstructorDescription { case paymentResult(updates: Api.Updates) case paymentVerficationNeeded(url: String) @@ -280,7 +280,7 @@ struct payments { } } - enum PaymentForm: TypeConstructorDescription { + indirect enum PaymentForm: TypeConstructorDescription { case paymentForm(flags: Int32, botId: Int32, invoice: Api.Invoice, providerId: Int32, url: String, nativeProvider: String?, nativeParams: Api.DataJSON?, savedInfo: Api.PaymentRequestedInfo?, savedCredentials: Api.PaymentSavedCredentials?, users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -364,7 +364,7 @@ struct payments { } } - enum PaymentReceipt: TypeConstructorDescription { + indirect enum PaymentReceipt: TypeConstructorDescription { case paymentReceipt(flags: Int32, date: Int32, botId: Int32, invoice: Api.Invoice, providerId: Int32, info: Api.PaymentRequestedInfo?, shipping: Api.ShippingOption?, currency: String, totalAmount: Int64, credentialsTitle: String, users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -450,7 +450,7 @@ struct payments { } } - enum SavedInfo: TypeConstructorDescription { + indirect enum SavedInfo: TypeConstructorDescription { case savedInfo(flags: Int32, savedInfo: Api.PaymentRequestedInfo?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -494,7 +494,7 @@ struct payments { } extension Api { struct auth { - enum Authorization: TypeConstructorDescription { + indirect enum Authorization: TypeConstructorDescription { case authorization(flags: Int32, tmpSessions: Int32?, user: Api.User) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -538,7 +538,7 @@ struct auth { } } - enum PasswordRecovery: TypeConstructorDescription { + indirect enum PasswordRecovery: TypeConstructorDescription { case passwordRecovery(emailPattern: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -572,7 +572,7 @@ struct auth { } } - enum ExportedAuthorization: TypeConstructorDescription { + indirect enum ExportedAuthorization: TypeConstructorDescription { case exportedAuthorization(id: Int32, bytes: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -610,7 +610,7 @@ struct auth { } } - enum CheckedPhone: TypeConstructorDescription { + indirect enum CheckedPhone: TypeConstructorDescription { case checkedPhone(phoneRegistered: Api.Bool) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -646,7 +646,7 @@ struct auth { } } - enum SentCode: TypeConstructorDescription { + indirect enum SentCode: TypeConstructorDescription { case sentCode(flags: Int32, type: Api.auth.SentCodeType, phoneCodeHash: String, nextType: Api.auth.CodeType?, timeout: Int32?, termsOfService: Api.help.TermsOfService?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -706,7 +706,7 @@ struct auth { } } - enum CodeType: TypeConstructorDescription { + indirect enum CodeType: TypeConstructorDescription { case codeTypeSms case codeTypeCall case codeTypeFlashCall @@ -756,7 +756,7 @@ struct auth { } } - enum SentCodeType: TypeConstructorDescription { + indirect enum SentCodeType: TypeConstructorDescription { case sentCodeTypeApp(length: Int32) case sentCodeTypeSms(length: Int32) case sentCodeTypeCall(length: Int32) @@ -854,7 +854,7 @@ struct auth { } extension Api { struct contacts { - enum Blocked: TypeConstructorDescription { + indirect enum Blocked: TypeConstructorDescription { case blocked(blocked: [Api.ContactBlocked], users: [Api.User]) case blockedSlice(count: Int32, blocked: [Api.ContactBlocked], users: [Api.User]) @@ -944,7 +944,7 @@ struct contacts { } } - enum Contacts: TypeConstructorDescription { + indirect enum Contacts: TypeConstructorDescription { case contactsNotModified case contacts(contacts: [Api.Contact], savedCount: Int32, users: [Api.User]) @@ -1010,7 +1010,7 @@ struct contacts { } } - enum ResolvedPeer: TypeConstructorDescription { + indirect enum ResolvedPeer: TypeConstructorDescription { case resolvedPeer(peer: Api.Peer, chats: [Api.Chat], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1066,7 +1066,7 @@ struct contacts { } } - enum Link: TypeConstructorDescription { + indirect enum Link: TypeConstructorDescription { case link(myLink: Api.ContactLink, foreignLink: Api.ContactLink, user: Api.User) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1114,7 +1114,7 @@ struct contacts { } } - enum ImportedContacts: TypeConstructorDescription { + indirect enum ImportedContacts: TypeConstructorDescription { case importedContacts(imported: [Api.ImportedContact], popularInvites: [Api.PopularContact], retryContacts: [Int64], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1184,7 +1184,7 @@ struct contacts { } } - enum Found: TypeConstructorDescription { + indirect enum Found: TypeConstructorDescription { case found(myResults: [Api.Peer], results: [Api.Peer], chats: [Api.Chat], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1254,7 +1254,7 @@ struct contacts { } } - enum TopPeers: TypeConstructorDescription { + indirect enum TopPeers: TypeConstructorDescription { case topPeersNotModified case topPeers(categories: [Api.TopPeerCategoryPeers], chats: [Api.Chat], users: [Api.User]) case topPeersDisabled @@ -1342,7 +1342,7 @@ struct contacts { } extension Api { struct help { - enum AppUpdate: TypeConstructorDescription { + indirect enum AppUpdate: TypeConstructorDescription { case appUpdate(id: Int32, critical: Api.Bool, url: String, text: String) case noAppUpdate @@ -1402,7 +1402,7 @@ struct help { } } - enum PassportConfig: TypeConstructorDescription { + indirect enum PassportConfig: TypeConstructorDescription { case passportConfigNotModified case passportConfig(hash: Int32, countriesLangs: Api.DataJSON) @@ -1454,7 +1454,7 @@ struct help { } } - enum ProxyData: TypeConstructorDescription { + indirect enum ProxyData: TypeConstructorDescription { case proxyDataEmpty(expires: Int32) case proxyDataPromo(expires: Int32, peer: Api.Peer, chats: [Api.Chat], users: [Api.User]) @@ -1534,7 +1534,7 @@ struct help { } } - enum DeepLinkInfo: TypeConstructorDescription { + indirect enum DeepLinkInfo: TypeConstructorDescription { case deepLinkInfoEmpty case deepLinkInfo(flags: Int32, message: String, entities: [Api.MessageEntity]?) @@ -1594,7 +1594,7 @@ struct help { } } - enum TermsOfService: TypeConstructorDescription { + indirect enum TermsOfService: TypeConstructorDescription { case termsOfService(flags: Int32, id: Api.DataJSON, text: String, entities: [Api.MessageEntity], minAgeConfirm: Int32?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1652,7 +1652,7 @@ struct help { } } - enum RecentMeUrls: TypeConstructorDescription { + indirect enum RecentMeUrls: TypeConstructorDescription { case recentMeUrls(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1712,7 +1712,7 @@ struct help { } } - enum Support: TypeConstructorDescription { + indirect enum Support: TypeConstructorDescription { case support(phoneNumber: String, user: Api.User) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1752,7 +1752,7 @@ struct help { } } - enum InviteText: TypeConstructorDescription { + indirect enum InviteText: TypeConstructorDescription { case inviteText(message: String) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -1786,7 +1786,7 @@ struct help { } } - enum TermsOfServiceUpdate: TypeConstructorDescription { + indirect enum TermsOfServiceUpdate: TypeConstructorDescription { case termsOfServiceUpdateEmpty(expires: Int32) case termsOfServiceUpdate(expires: Int32, termsOfService: Api.help.TermsOfService) @@ -1850,7 +1850,7 @@ struct help { } extension Api { struct updates { - enum Difference: TypeConstructorDescription { + indirect enum Difference: TypeConstructorDescription { case differenceEmpty(date: Int32, seq: Int32) case difference(newMessages: [Api.Message], newEncryptedMessages: [Api.EncryptedMessage], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User], state: Api.updates.State) case differenceSlice(newMessages: [Api.Message], newEncryptedMessages: [Api.EncryptedMessage], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User], intermediateState: Api.updates.State) @@ -2052,7 +2052,7 @@ struct updates { } } - enum State: TypeConstructorDescription { + indirect enum State: TypeConstructorDescription { case state(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -2102,7 +2102,7 @@ struct updates { } } - enum ChannelDifference: TypeConstructorDescription { + indirect enum ChannelDifference: TypeConstructorDescription { case channelDifferenceEmpty(flags: Int32, pts: Int32, timeout: Int32?) case channelDifference(flags: Int32, pts: Int32, timeout: Int32?, newMessages: [Api.Message], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User]) case channelDifferenceTooLong(flags: Int32, timeout: Int32?, dialog: Api.Dialog, messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) diff --git a/TelegramCore/Api3.swift b/TelegramCore/Api3.swift index 81a823151c..c48e8b8b13 100644 --- a/TelegramCore/Api3.swift +++ b/TelegramCore/Api3.swift @@ -1,6 +1,6 @@ extension Api { struct upload { - enum WebFile: TypeConstructorDescription { + indirect enum WebFile: TypeConstructorDescription { case webFile(size: Int32, mimeType: String, fileType: Api.storage.FileType, mtime: Int32, bytes: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -52,7 +52,7 @@ struct upload { } } - enum File: TypeConstructorDescription { + indirect enum File: TypeConstructorDescription { case file(type: Api.storage.FileType, mtime: Int32, bytes: Buffer) case fileCdnRedirect(dcId: Int32, fileToken: Buffer, encryptionKey: Buffer, encryptionIv: Buffer, fileHashes: [Api.FileHash]) @@ -138,7 +138,7 @@ struct upload { } } - enum CdnFile: TypeConstructorDescription { + indirect enum CdnFile: TypeConstructorDescription { case cdnFileReuploadNeeded(requestToken: Buffer) case cdnFile(bytes: Buffer) @@ -196,7 +196,7 @@ struct upload { } extension Api { struct storage { - enum FileType: TypeConstructorDescription { + indirect enum FileType: TypeConstructorDescription { case fileUnknown case filePartial case fileJpeg @@ -334,7 +334,7 @@ struct storage { } extension Api { struct account { - enum TmpPassword: TypeConstructorDescription { + indirect enum TmpPassword: TypeConstructorDescription { case tmpPassword(tmpPassword: Buffer, validUntil: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -372,7 +372,7 @@ struct account { } } - enum PasswordSettings: TypeConstructorDescription { + indirect enum PasswordSettings: TypeConstructorDescription { case passwordSettings(flags: Int32, email: String?, secureSettings: Api.SecureSecretSettings?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -416,7 +416,7 @@ struct account { } } - enum WallPapers: TypeConstructorDescription { + indirect enum WallPapers: TypeConstructorDescription { case wallPapersNotModified case wallPapers(hash: Int32, wallpapers: [Api.WallPaper]) @@ -472,7 +472,7 @@ struct account { } } - enum PasswordInputSettings: TypeConstructorDescription { + indirect enum PasswordInputSettings: TypeConstructorDescription { case passwordInputSettings(flags: Int32, newAlgo: Api.PasswordKdfAlgo?, newPasswordHash: Buffer?, hint: String?, email: String?, newSecureSettings: Api.SecureSecretSettings?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -530,7 +530,7 @@ struct account { } } - enum WebAuthorizations: TypeConstructorDescription { + indirect enum WebAuthorizations: TypeConstructorDescription { case webAuthorizations(authorizations: [Api.WebAuthorization], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -580,7 +580,7 @@ struct account { } } - enum SentEmailCode: TypeConstructorDescription { + indirect enum SentEmailCode: TypeConstructorDescription { case sentEmailCode(emailPattern: String, length: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -618,7 +618,7 @@ struct account { } } - enum Authorizations: TypeConstructorDescription { + indirect enum Authorizations: TypeConstructorDescription { case authorizations(authorizations: [Api.Authorization]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -658,7 +658,7 @@ struct account { } } - enum AuthorizationForm: TypeConstructorDescription { + indirect enum AuthorizationForm: TypeConstructorDescription { case authorizationForm(flags: Int32, requiredTypes: [Api.SecureRequiredType], values: [Api.SecureValue], errors: [Api.SecureValueError], users: [Api.User], privacyPolicyUrl: String?) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -736,7 +736,7 @@ struct account { } } - enum Password: TypeConstructorDescription { + indirect enum Password: TypeConstructorDescription { case password(flags: Int32, currentAlgo: Api.PasswordKdfAlgo?, srpB: Buffer?, srpId: Int64?, hint: String?, emailUnconfirmedPattern: String?, newAlgo: Api.PasswordKdfAlgo, newSecureAlgo: Api.SecurePasswordKdfAlgo, secureRandom: Buffer) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -808,7 +808,7 @@ struct account { } } - enum PrivacyRules: TypeConstructorDescription { + indirect enum PrivacyRules: TypeConstructorDescription { case privacyRules(rules: [Api.PrivacyRule], users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -858,7 +858,7 @@ struct account { } } - enum AutoDownloadSettings: TypeConstructorDescription { + indirect enum AutoDownloadSettings: TypeConstructorDescription { case autoDownloadSettings(low: Api.AutoDownloadSettings, medium: Api.AutoDownloadSettings, high: Api.AutoDownloadSettings) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -910,7 +910,7 @@ struct account { } extension Api { struct photos { - enum Photo: TypeConstructorDescription { + indirect enum Photo: TypeConstructorDescription { case photo(photo: Api.Photo, users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -956,7 +956,7 @@ struct photos { } } - enum Photos: TypeConstructorDescription { + indirect enum Photos: TypeConstructorDescription { case photos(photos: [Api.Photo], users: [Api.User]) case photosSlice(count: Int32, photos: [Api.Photo], users: [Api.User]) @@ -1050,7 +1050,7 @@ struct photos { } extension Api { struct phone { - enum PhoneCall: TypeConstructorDescription { + indirect enum PhoneCall: TypeConstructorDescription { case phoneCall(phoneCall: Api.PhoneCall, users: [Api.User]) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { diff --git a/TelegramCore/ImportAccount.swift b/TelegramCore/ImportAccount.swift deleted file mode 100644 index 7f38b05535..0000000000 --- a/TelegramCore/ImportAccount.swift +++ /dev/null @@ -1,49 +0,0 @@ -import Foundation -#if os(macOS) - import PostboxMac - import SwiftSignalKitMac -#else - import Postbox - import SwiftSignalKit -#endif - -public struct ImportAccountProvider { - let mtProtoKeychain: () -> Signal<[String: [String: Data]], NoError> - let accountState: () -> Signal - let peers: () -> Signal<[Peer], NoError> - - public init(mtProtoKeychain: @escaping () -> Signal<[String: [String: Data]], NoError>, accountState: @escaping() -> Signal, peers: @escaping() -> Signal<[Peer], NoError>) { - self.mtProtoKeychain = mtProtoKeychain - self.accountState = accountState - self.peers = peers - } -} - -public func importAccount(account: UnauthorizedAccount, provider: ImportAccountProvider) -> Signal { - return provider.mtProtoKeychain() - |> mapToSignal { keychain -> Signal in - for (group, dict) in keychain { - for (key, value) in dict { - account.postbox.setKeychainEntryForKey(group + ":" + key, value: value) - } - } - - let importAccountState = provider.accountState() - |> mapToSignal { accountState -> Signal in - return account.postbox.transaction { transaction -> Void in - transaction.setState(accountState) - } - } - - let importPeers = provider.peers() - |> mapToSignal { peers -> Signal in - return account.postbox.transaction { transaction -> Void in - updatePeers(transaction: transaction, peers: peers, update: { _, updated in - return updated - }) - } - } - - return (importAccountState |> then(importPeers)) |> mapToSignal { _ in return .complete() } |> then(.single(Void())) - } -} diff --git a/TelegramCore/MacosLegacy.swift b/TelegramCore/MacosLegacy.swift deleted file mode 100644 index 022a58fed9..0000000000 --- a/TelegramCore/MacosLegacy.swift +++ /dev/null @@ -1,1658 +0,0 @@ - - -fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { - var dict: [Int32 : (BufferReader) -> Any?] = [:] - dict[-1471112230] = { return $0.readInt32() } - dict[570911930] = { return $0.readInt64() } - dict[571523412] = { return $0.readDouble() } - dict[-1255641564] = { return parseString($0) } - dict[590459437] = { return MacosLegacy.Photo.parse_photoEmpty($0) } - dict[-1836524247] = { return MacosLegacy.Photo.parse_photo($0) } - dict[-1160714821] = { return MacosLegacy.Peer.parse_peerChat($0) } - dict[2] = { return MacosLegacy.Peer.parse_peerSecret($0) } - dict[164646985] = { return MacosLegacy.UserStatus.parse_userStatusEmpty($0) } - dict[-306628279] = { return MacosLegacy.UserStatus.parse_userStatusOnline($0) } - dict[9203775] = { return MacosLegacy.UserStatus.parse_userStatusOffline($0) } - dict[-496024847] = { return MacosLegacy.UserStatus.parse_userStatusRecently($0) } - dict[129960444] = { return MacosLegacy.UserStatus.parse_userStatusLastWeek($0) } - dict[2011940674] = { return MacosLegacy.UserStatus.parse_userStatusLastMonth($0) } - dict[236446268] = { return MacosLegacy.PhotoSize.parse_photoSizeEmpty($0) } - dict[2009052699] = { return MacosLegacy.PhotoSize.parse_photoSize($0) } - dict[-374917894] = { return MacosLegacy.PhotoSize.parse_photoCachedSize($0) } - dict[2086234950] = { return MacosLegacy.FileLocation.parse_fileLocationUnavailable($0) } - dict[1406570614] = { return MacosLegacy.FileLocation.parse_fileLocation($0) } - dict[-350980120] = { return MacosLegacy.WebPage.parse_webPageEmpty($0) } - dict[-981018084] = { return MacosLegacy.WebPage.parse_webPagePending($0) } - dict[1594340540] = { return MacosLegacy.WebPage.parse_webPage($0) } - dict[-2054908813] = { return MacosLegacy.WebPage.parse_webPageNotModified($0) } - dict[1038967584] = { return MacosLegacy.MessageMedia.parse_messageMediaEmpty($0) } - dict[1032643901] = { return MacosLegacy.MessageMedia.parse_messageMediaPhoto($0) } - dict[1457575028] = { return MacosLegacy.MessageMedia.parse_messageMediaGeo($0) } - dict[1585262393] = { return MacosLegacy.MessageMedia.parse_messageMediaContact($0) } - dict[-1618676578] = { return MacosLegacy.MessageMedia.parse_messageMediaUnsupported($0) } - dict[-203411800] = { return MacosLegacy.MessageMedia.parse_messageMediaDocument($0) } - dict[-1557277184] = { return MacosLegacy.MessageMedia.parse_messageMediaWebPage($0) } - dict[1815593308] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeImageSize($0) } - dict[297109817] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeAnimated($0) } - dict[1662637586] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeSticker($0) } - dict[1494273227] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeVideo($0) } - dict[-1739392570] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeAudio($0) } - dict[358154344] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeFilename($0) } - dict[-1744710921] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeHasStickers($0) } - dict[-23] = { return MacosLegacy.DocumentAttribute.parse_documentAttributeLocalFile($0) } - dict[-4838507] = { return MacosLegacy.InputStickerSet.parse_inputStickerSetEmpty($0) } - dict[537022650] = { return MacosLegacy.User.parse_userEmpty($0) } - dict[-787638374] = { return MacosLegacy.User.parse_user($0) } - dict[4] = { return MacosLegacy.Message.parse_destructMessage($0) } - dict[286776671] = { return MacosLegacy.GeoPoint.parse_geoPointEmpty($0) } - dict[541710092] = { return MacosLegacy.GeoPoint.parse_geoPoint($0) } - dict[-1361650766] = { return MacosLegacy.MaskCoords.parse_maskCoords($0) } - dict[1326562017] = { return MacosLegacy.UserProfilePhoto.parse_userProfilePhotoEmpty($0) } - dict[-715532088] = { return MacosLegacy.UserProfilePhoto.parse_userProfilePhoto($0) } - dict[-94974410] = { return MacosLegacy.EncryptedChat.parse_encryptedChat($0) } - dict[922273905] = { return MacosLegacy.Document.parse_documentEmpty($0) } - dict[-2027738169] = { return MacosLegacy.Document.parse_document($0) } - return dict -}() - -public struct MacosLegacy { - public static func parse(_ buffer: Buffer) -> Any? { - let reader = BufferReader(buffer) - if let signature = reader.readInt32() { - return parse(reader, signature: signature) - } - return nil - } - - fileprivate static func parse(_ reader: BufferReader, signature: Int32) -> Any? { - if let parser = parsers[signature] { - return parser(reader) - } - else { - Logger.shared.log("TL", "Type constructor \(String(signature, radix: 16, uppercase: false)) not found") - return nil - } - } - - fileprivate static func parseVector(_ reader: BufferReader, elementSignature: Int32, elementType: T.Type) -> [T]? { - if let count = reader.readInt32() { - var array = [T]() - var i: Int32 = 0 - while i < count { - var signature = elementSignature - if elementSignature == 0 { - if let unboxedSignature = reader.readInt32() { - signature = unboxedSignature - } - else { - return nil - } - } - if let item = MacosLegacy.parse(reader, signature: signature) as? T { - array.append(item) - } - else { - return nil - } - i += 1 - } - return array - } - return nil - } - - public static func serializeObject(_ object: Any, buffer: Buffer, boxed: Swift.Bool) -> Swift.Bool { - switch object { - case let _1 as MacosLegacy.Photo: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.Peer: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.UserStatus: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.PhotoSize: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.FileLocation: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.WebPage: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.MessageMedia: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.DocumentAttribute: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.InputStickerSet: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.User: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.Message: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.GeoPoint: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.MaskCoords: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.UserProfilePhoto: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.EncryptedChat: - return _1.serialize(buffer, boxed) - case let _1 as MacosLegacy.Document: - return _1.serialize(buffer, boxed) - default: - break - } - return false - } - - public enum Photo: CustomStringConvertible { - case photoEmpty(id: Int64) - case photo(flags: Int32, id: Int64, accessHash: Int64, date: Int32, sizes: [MacosLegacy.PhotoSize]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .photoEmpty(let id): - if boxed { - buffer.appendInt32(590459437) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - case .photo(let flags, let id, let accessHash, let date, let sizes): - if boxed { - buffer.appendInt32(-1836524247) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sizes.count)) - for item in sizes { - item.serialize(buffer, true) - } - break - } - return true - } - - fileprivate static func parse_photoEmpty(_ reader: BufferReader) -> Photo? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.Photo.photoEmpty(id: _1!) - } - else { - return nil - } - } - fileprivate static func parse_photo(_ reader: BufferReader) -> Photo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: [MacosLegacy.PhotoSize]? - if let _ = reader.readInt32() { - _5 = MacosLegacy.parseVector(reader, elementSignature: 0, elementType: MacosLegacy.PhotoSize.self) - } - 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 MacosLegacy.Photo.photo(flags: _1!, id: _2!, accessHash: _3!, date: _4!, sizes: _5!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .photoEmpty(let id): - return "(photoEmpty id: \(id))" - case .photo(let flags, let id, let accessHash, let date, let sizes): - return "(photo flags: \(flags), id: \(id), accessHash: \(accessHash), date: \(date), sizes: \(sizes))" - } - } - } - } - - public enum Peer: CustomStringConvertible { - case peerChat(chatId: Int32) - case peerSecret(chatId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .peerChat(let chatId): - if boxed { - buffer.appendInt32(-1160714821) - } - serializeInt32(chatId, buffer: buffer, boxed: false) - break - case .peerSecret(let chatId): - if boxed { - buffer.appendInt32(2) - } - serializeInt32(chatId, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_peerChat(_ reader: BufferReader) -> Peer? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.Peer.peerChat(chatId: _1!) - } - else { - return nil - } - } - fileprivate static func parse_peerSecret(_ reader: BufferReader) -> Peer? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.Peer.peerSecret(chatId: _1!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .peerChat(let chatId): - return "(peerChat chatId: \(chatId))" - case .peerSecret(let chatId): - return "(peerSecret chatId: \(chatId))" - } - } - } - } - - public enum UserStatus: CustomStringConvertible { - case userStatusEmpty - case userStatusOnline(expires: Int32) - case userStatusOffline(wasOnline: Int32) - case userStatusRecently - case userStatusLastWeek - case userStatusLastMonth - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .userStatusEmpty: - if boxed { - buffer.appendInt32(164646985) - } - - break - case .userStatusOnline(let expires): - if boxed { - buffer.appendInt32(-306628279) - } - serializeInt32(expires, buffer: buffer, boxed: false) - break - case .userStatusOffline(let wasOnline): - if boxed { - buffer.appendInt32(9203775) - } - serializeInt32(wasOnline, buffer: buffer, boxed: false) - break - case .userStatusRecently: - if boxed { - buffer.appendInt32(-496024847) - } - - break - case .userStatusLastWeek: - if boxed { - buffer.appendInt32(129960444) - } - - break - case .userStatusLastMonth: - if boxed { - buffer.appendInt32(2011940674) - } - - break - } - return true - } - - fileprivate static func parse_userStatusEmpty(_ reader: BufferReader) -> UserStatus? { - return MacosLegacy.UserStatus.userStatusEmpty - } - fileprivate static func parse_userStatusOnline(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.UserStatus.userStatusOnline(expires: _1!) - } - else { - return nil - } - } - fileprivate static func parse_userStatusOffline(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.UserStatus.userStatusOffline(wasOnline: _1!) - } - else { - return nil - } - } - fileprivate static func parse_userStatusRecently(_ reader: BufferReader) -> UserStatus? { - return MacosLegacy.UserStatus.userStatusRecently - } - fileprivate static func parse_userStatusLastWeek(_ reader: BufferReader) -> UserStatus? { - return MacosLegacy.UserStatus.userStatusLastWeek - } - fileprivate static func parse_userStatusLastMonth(_ reader: BufferReader) -> UserStatus? { - return MacosLegacy.UserStatus.userStatusLastMonth - } - - public var description: String { - get { - switch self { - case .userStatusEmpty: - return "(userStatusEmpty)" - case .userStatusOnline(let expires): - return "(userStatusOnline expires: \(expires))" - case .userStatusOffline(let wasOnline): - return "(userStatusOffline wasOnline: \(wasOnline))" - case .userStatusRecently: - return "(userStatusRecently)" - case .userStatusLastWeek: - return "(userStatusLastWeek)" - case .userStatusLastMonth: - return "(userStatusLastMonth)" - } - } - } - } - - public enum PhotoSize: CustomStringConvertible { - case photoSizeEmpty(type: String) - case photoSize(type: String, location: MacosLegacy.FileLocation, w: Int32, h: Int32, size: Int32) - case photoCachedSize(type: String, location: MacosLegacy.FileLocation, w: Int32, h: Int32, bytes: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .photoSizeEmpty(let type): - if boxed { - buffer.appendInt32(236446268) - } - serializeString(type, buffer: buffer, boxed: false) - break - case .photoSize(let type, let location, let w, let h, let size): - if boxed { - buffer.appendInt32(2009052699) - } - serializeString(type, buffer: buffer, boxed: false) - location.serialize(buffer, true) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - break - case .photoCachedSize(let type, let location, let w, let h, let bytes): - if boxed { - buffer.appendInt32(-374917894) - } - serializeString(type, buffer: buffer, boxed: false) - location.serialize(buffer, true) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_photoSizeEmpty(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.PhotoSize.photoSizeEmpty(type: _1!) - } - else { - return nil - } - } - fileprivate static func parse_photoSize(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: MacosLegacy.FileLocation? - if let signature = reader.readInt32() { - _2 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.FileLocation - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - 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 MacosLegacy.PhotoSize.photoSize(type: _1!, location: _2!, w: _3!, h: _4!, size: _5!) - } - else { - return nil - } - } - fileprivate static func parse_photoCachedSize(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: MacosLegacy.FileLocation? - if let signature = reader.readInt32() { - _2 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.FileLocation - } - var _3: Int32? - _3 = reader.readInt32() - 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 MacosLegacy.PhotoSize.photoCachedSize(type: _1!, location: _2!, w: _3!, h: _4!, bytes: _5!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .photoSizeEmpty(let type): - return "(photoSizeEmpty type: \(type))" - case .photoSize(let type, let location, let w, let h, let size): - return "(photoSize type: \(type), location: \(location), w: \(w), h: \(h), size: \(size))" - case .photoCachedSize(let type, let location, let w, let h, let bytes): - return "(photoCachedSize type: \(type), location: \(location), w: \(w), h: \(h), bytes: \(bytes))" - } - } - } - } - - public enum FileLocation: CustomStringConvertible { - case fileLocationUnavailable(volumeId: Int64, localId: Int32, secret: Int64) - case fileLocation(dcId: Int32, volumeId: Int64, localId: Int32, secret: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .fileLocationUnavailable(let volumeId, let localId, let secret): - if boxed { - buffer.appendInt32(2086234950) - } - serializeInt64(volumeId, buffer: buffer, boxed: false) - serializeInt32(localId, buffer: buffer, boxed: false) - serializeInt64(secret, buffer: buffer, boxed: false) - break - case .fileLocation(let dcId, let volumeId, let localId, let secret): - if boxed { - buffer.appendInt32(1406570614) - } - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt64(volumeId, buffer: buffer, boxed: false) - serializeInt32(localId, buffer: buffer, boxed: false) - serializeInt64(secret, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_fileLocationUnavailable(_ reader: BufferReader) -> FileLocation? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return MacosLegacy.FileLocation.fileLocationUnavailable(volumeId: _1!, localId: _2!, secret: _3!) - } - else { - return nil - } - } - fileprivate static func parse_fileLocation(_ reader: BufferReader) -> FileLocation? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return MacosLegacy.FileLocation.fileLocation(dcId: _1!, volumeId: _2!, localId: _3!, secret: _4!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .fileLocationUnavailable(let volumeId, let localId, let secret): - return "(fileLocationUnavailable volumeId: \(volumeId), localId: \(localId), secret: \(secret))" - case .fileLocation(let dcId, let volumeId, let localId, let secret): - return "(fileLocation dcId: \(dcId), volumeId: \(volumeId), localId: \(localId), secret: \(secret))" - } - } - } - } - - public enum WebPage: CustomStringConvertible { - case webPageEmpty(id: Int64) - case webPagePending(id: Int64, date: Int32) - case webPage(flags: Int32, id: Int64, url: String, displayUrl: String, hash: Int32, type: String?, siteName: String?, title: String?, description: String?, photo: MacosLegacy.Photo?, embedUrl: String?, embedType: String?, embedWidth: Int32?, embedHeight: Int32?, duration: Int32?, author: String?, document: MacosLegacy.Document?) - case webPageNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .webPageEmpty(let id): - if boxed { - buffer.appendInt32(-350980120) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - case .webPagePending(let id, let date): - if boxed { - buffer.appendInt32(-981018084) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .webPage(let flags, let id, let url, let displayUrl, let hash, let type, let siteName, let title, let description, let photo, let embedUrl, let embedType, let embedWidth, let embedHeight, let duration, let author, let document): - if boxed { - buffer.appendInt32(1594340540) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - serializeString(displayUrl, buffer: buffer, boxed: false) - serializeInt32(hash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(type!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(siteName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(embedUrl!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(embedType!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(embedWidth!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(embedHeight!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(duration!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeString(author!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {document!.serialize(buffer, true)} - break - case .webPageNotModified: - if boxed { - buffer.appendInt32(-2054908813) - } - - break - } - return true - } - - fileprivate static func parse_webPageEmpty(_ reader: BufferReader) -> WebPage? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.WebPage.webPageEmpty(id: _1!) - } - else { - return nil - } - } - fileprivate static func parse_webPagePending(_ reader: BufferReader) -> WebPage? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return MacosLegacy.WebPage.webPagePending(id: _1!, date: _2!) - } - else { - return nil - } - } - fileprivate static func parse_webPage(_ reader: BufferReader) -> WebPage? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } - var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } - var _8: String? - if Int(_1!) & Int(1 << 2) != 0 {_8 = parseString(reader) } - var _9: String? - if Int(_1!) & Int(1 << 3) != 0 {_9 = parseString(reader) } - var _10: MacosLegacy.Photo? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _10 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.Photo - } } - var _11: String? - if Int(_1!) & Int(1 << 5) != 0 {_11 = parseString(reader) } - var _12: String? - if Int(_1!) & Int(1 << 5) != 0 {_12 = parseString(reader) } - var _13: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_13 = reader.readInt32() } - var _14: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_14 = reader.readInt32() } - var _15: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_15 = reader.readInt32() } - var _16: String? - if Int(_1!) & Int(1 << 8) != 0 {_16 = parseString(reader) } - var _17: MacosLegacy.Document? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _17 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.Document - } } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil - let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil - let _c9 = (Int(_1!) & Int(1 << 3) == 0) || _9 != nil - let _c10 = (Int(_1!) & Int(1 << 4) == 0) || _10 != nil - let _c11 = (Int(_1!) & Int(1 << 5) == 0) || _11 != nil - let _c12 = (Int(_1!) & Int(1 << 5) == 0) || _12 != nil - let _c13 = (Int(_1!) & Int(1 << 6) == 0) || _13 != nil - let _c14 = (Int(_1!) & Int(1 << 6) == 0) || _14 != nil - let _c15 = (Int(_1!) & Int(1 << 7) == 0) || _15 != nil - let _c16 = (Int(_1!) & Int(1 << 8) == 0) || _16 != nil - let _c17 = (Int(_1!) & Int(1 << 9) == 0) || _17 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 { - return MacosLegacy.WebPage.webPage(flags: _1!, id: _2!, url: _3!, displayUrl: _4!, hash: _5!, type: _6, siteName: _7, title: _8, description: _9, photo: _10, embedUrl: _11, embedType: _12, embedWidth: _13, embedHeight: _14, duration: _15, author: _16, document: _17) - } - else { - return nil - } - } - fileprivate static func parse_webPageNotModified(_ reader: BufferReader) -> WebPage? { - return MacosLegacy.WebPage.webPageNotModified - } - - public var description: String { - get { - switch self { - case .webPageEmpty(let id): - return "(webPageEmpty id: \(id))" - case .webPagePending(let id, let date): - return "(webPagePending id: \(id), date: \(date))" - case .webPage(let flags, let id, let url, let displayUrl, let hash, let type, let siteName, let title, let description, let photo, let embedUrl, let embedType, let embedWidth, let embedHeight, let duration, let author, let document): - return "(webPage flags: \(flags), id: \(id), url: \(url), displayUrl: \(displayUrl), hash: \(hash), type: \(type), siteName: \(siteName), title: \(title), description: \(description), photo: \(photo), embedUrl: \(embedUrl), embedType: \(embedType), embedWidth: \(embedWidth), embedHeight: \(embedHeight), duration: \(duration), author: \(author), document: \(document))" - case .webPageNotModified: - return "(webPageNotModified)" - } - } - } - } - - public enum MessageMedia: CustomStringConvertible { - case messageMediaEmpty - case messageMediaPhoto(photo: MacosLegacy.Photo, caption: String) - case messageMediaGeo(geo: MacosLegacy.GeoPoint) - case messageMediaContact(phoneNumber: String, firstName: String, lastName: String, userId: Int32) - case messageMediaUnsupported - case messageMediaDocument(document: MacosLegacy.Document, caption: String) - case messageMediaWebPage(webpage: MacosLegacy.WebPage) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .messageMediaEmpty: - if boxed { - buffer.appendInt32(1038967584) - } - - break - case .messageMediaPhoto(let photo, let caption): - if boxed { - buffer.appendInt32(1032643901) - } - photo.serialize(buffer, true) - serializeString(caption, buffer: buffer, boxed: false) - break - case .messageMediaGeo(let geo): - if boxed { - buffer.appendInt32(1457575028) - } - geo.serialize(buffer, true) - break - case .messageMediaContact(let phoneNumber, let firstName, let lastName, let userId): - if boxed { - buffer.appendInt32(1585262393) - } - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeInt32(userId, buffer: buffer, boxed: false) - break - case .messageMediaUnsupported: - if boxed { - buffer.appendInt32(-1618676578) - } - - break - case .messageMediaDocument(let document, let caption): - if boxed { - buffer.appendInt32(-203411800) - } - document.serialize(buffer, true) - serializeString(caption, buffer: buffer, boxed: false) - break - case .messageMediaWebPage(let webpage): - if boxed { - buffer.appendInt32(-1557277184) - } - webpage.serialize(buffer, true) - break - } - return true - } - - fileprivate static func parse_messageMediaEmpty(_ reader: BufferReader) -> MessageMedia? { - return MacosLegacy.MessageMedia.messageMediaEmpty - } - fileprivate static func parse_messageMediaPhoto(_ reader: BufferReader) -> MessageMedia? { - var _1: MacosLegacy.Photo? - if let signature = reader.readInt32() { - _1 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.Photo - } - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return MacosLegacy.MessageMedia.messageMediaPhoto(photo: _1!, caption: _2!) - } - else { - return nil - } - } - fileprivate static func parse_messageMediaGeo(_ reader: BufferReader) -> MessageMedia? { - var _1: MacosLegacy.GeoPoint? - if let signature = reader.readInt32() { - _1 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.GeoPoint - } - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.MessageMedia.messageMediaGeo(geo: _1!) - } - else { - return nil - } - } - fileprivate static func parse_messageMediaContact(_ reader: BufferReader) -> MessageMedia? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return MacosLegacy.MessageMedia.messageMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, userId: _4!) - } - else { - return nil - } - } - fileprivate static func parse_messageMediaUnsupported(_ reader: BufferReader) -> MessageMedia? { - return MacosLegacy.MessageMedia.messageMediaUnsupported - } - fileprivate static func parse_messageMediaDocument(_ reader: BufferReader) -> MessageMedia? { - var _1: MacosLegacy.Document? - if let signature = reader.readInt32() { - _1 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.Document - } - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return MacosLegacy.MessageMedia.messageMediaDocument(document: _1!, caption: _2!) - } - else { - return nil - } - } - fileprivate static func parse_messageMediaWebPage(_ reader: BufferReader) -> MessageMedia? { - var _1: MacosLegacy.WebPage? - if let signature = reader.readInt32() { - _1 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.WebPage - } - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.MessageMedia.messageMediaWebPage(webpage: _1!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .messageMediaEmpty: - return "(messageMediaEmpty)" - case .messageMediaPhoto(let photo, let caption): - return "(messageMediaPhoto photo: \(photo), caption: \(caption))" - case .messageMediaGeo(let geo): - return "(messageMediaGeo geo: \(geo))" - case .messageMediaContact(let phoneNumber, let firstName, let lastName, let userId): - return "(messageMediaContact phoneNumber: \(phoneNumber), firstName: \(firstName), lastName: \(lastName), userId: \(userId))" - case .messageMediaUnsupported: - return "(messageMediaUnsupported)" - case .messageMediaDocument(let document, let caption): - return "(messageMediaDocument document: \(document), caption: \(caption))" - case .messageMediaWebPage(let webpage): - return "(messageMediaWebPage webpage: \(webpage))" - } - } - } - } - - public enum DocumentAttribute: CustomStringConvertible { - case documentAttributeImageSize(w: Int32, h: Int32) - case documentAttributeAnimated - case documentAttributeSticker(flags: Int32, alt: String, stickerset: MacosLegacy.InputStickerSet, maskCoords: MacosLegacy.MaskCoords?) - case documentAttributeVideo(duration: Int32, w: Int32, h: Int32) - case documentAttributeAudio(flags: Int32, duration: Int32, title: String?, performer: String?, waveform: Buffer?) - case documentAttributeFilename(fileName: String) - case documentAttributeHasStickers - case documentAttributeLocalFile(filePath: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .documentAttributeImageSize(let w, let h): - if boxed { - buffer.appendInt32(1815593308) - } - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - break - case .documentAttributeAnimated: - if boxed { - buffer.appendInt32(297109817) - } - - break - case .documentAttributeSticker(let flags, let alt, let stickerset, let maskCoords): - if boxed { - buffer.appendInt32(1662637586) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(alt, buffer: buffer, boxed: false) - stickerset.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {maskCoords!.serialize(buffer, true)} - break - case .documentAttributeVideo(let duration, let w, let h): - if boxed { - buffer.appendInt32(1494273227) - } - serializeInt32(duration, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - break - case .documentAttributeAudio(let flags, let duration, let title, let performer, let waveform): - if boxed { - buffer.appendInt32(-1739392570) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(duration, 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(performer!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeBytes(waveform!, buffer: buffer, boxed: false)} - break - case .documentAttributeFilename(let fileName): - if boxed { - buffer.appendInt32(358154344) - } - serializeString(fileName, buffer: buffer, boxed: false) - break - case .documentAttributeHasStickers: - if boxed { - buffer.appendInt32(-1744710921) - } - - break - case .documentAttributeLocalFile(let filePath): - if boxed { - buffer.appendInt32(-35) - } - serializeString(filePath, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_documentAttributeImageSize(_ reader: BufferReader) -> DocumentAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return MacosLegacy.DocumentAttribute.documentAttributeImageSize(w: _1!, h: _2!) - } - else { - return nil - } - } - fileprivate static func parse_documentAttributeAnimated(_ reader: BufferReader) -> DocumentAttribute? { - return MacosLegacy.DocumentAttribute.documentAttributeAnimated - } - fileprivate static func parse_documentAttributeSticker(_ reader: BufferReader) -> DocumentAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: MacosLegacy.InputStickerSet? - if let signature = reader.readInt32() { - _3 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.InputStickerSet - } - var _4: MacosLegacy.MaskCoords? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.MaskCoords - } } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return MacosLegacy.DocumentAttribute.documentAttributeSticker(flags: _1!, alt: _2!, stickerset: _3!, maskCoords: _4) - } - else { - return nil - } - } - fileprivate static func parse_documentAttributeVideo(_ reader: BufferReader) -> DocumentAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return MacosLegacy.DocumentAttribute.documentAttributeVideo(duration: _1!, w: _2!, h: _3!) - } - else { - return nil - } - } - fileprivate static func parse_documentAttributeAudio(_ reader: BufferReader) -> DocumentAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - 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: Buffer? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseBytes(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 - let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return MacosLegacy.DocumentAttribute.documentAttributeAudio(flags: _1!, duration: _2!, title: _3, performer: _4, waveform: _5) - } - else { - return nil - } - } - fileprivate static func parse_documentAttributeFilename(_ reader: BufferReader) -> DocumentAttribute? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.DocumentAttribute.documentAttributeFilename(fileName: _1!) - } - else { - return nil - } - } - fileprivate static func parse_documentAttributeHasStickers(_ reader: BufferReader) -> DocumentAttribute? { - return MacosLegacy.DocumentAttribute.documentAttributeHasStickers - } - fileprivate static func parse_documentAttributeLocalFile(_ reader: BufferReader) -> DocumentAttribute? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.DocumentAttribute.documentAttributeLocalFile(filePath: _1!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .documentAttributeImageSize(let w, let h): - return "(documentAttributeImageSize w: \(w), h: \(h))" - case .documentAttributeAnimated: - return "(documentAttributeAnimated)" - case .documentAttributeSticker(let flags, let alt, let stickerset, let maskCoords): - return "(documentAttributeSticker flags: \(flags), alt: \(alt), stickerset: \(stickerset), maskCoords: \(maskCoords))" - case .documentAttributeVideo(let duration, let w, let h): - return "(documentAttributeVideo duration: \(duration), w: \(w), h: \(h))" - case .documentAttributeAudio(let flags, let duration, let title, let performer, let waveform): - return "(documentAttributeAudio flags: \(flags), duration: \(duration), title: \(title), performer: \(performer), waveform: \(waveform))" - case .documentAttributeFilename(let fileName): - return "(documentAttributeFilename fileName: \(fileName))" - case .documentAttributeHasStickers: - return "(documentAttributeHasStickers)" - case .documentAttributeLocalFile(let filePath): - return "(documentAttributeLocalFile filePath: \(filePath))" - } - } - } - } - - public enum InputStickerSet: CustomStringConvertible { - case inputStickerSetEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .inputStickerSetEmpty: - if boxed { - buffer.appendInt32(-4838507) - } - - break - } - return true - } - - fileprivate static func parse_inputStickerSetEmpty(_ reader: BufferReader) -> InputStickerSet? { - return MacosLegacy.InputStickerSet.inputStickerSetEmpty - } - - public var description: String { - get { - switch self { - case .inputStickerSetEmpty: - return "(inputStickerSetEmpty)" - } - } - } - } - - public enum User: CustomStringConvertible { - case userEmpty(id: Int32) - case user(flags: Int32, id: Int32, accessHash: Int64?, firstName: String?, lastName: String?, username: String?, phone: String?, photo: MacosLegacy.UserProfilePhoto?, status: MacosLegacy.UserStatus?, botInfoVersion: Int32?, restrictionReason: String?, botInlinePlaceholder: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .userEmpty(let id): - if boxed { - buffer.appendInt32(537022650) - } - serializeInt32(id, buffer: buffer, boxed: false) - break - case .user(let flags, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder): - if boxed { - buffer.appendInt32(-787638374) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(accessHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(firstName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(lastName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(username!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(phone!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {status!.serialize(buffer, true)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt32(botInfoVersion!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {serializeString(restrictionReason!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 19) != 0 {serializeString(botInlinePlaceholder!, buffer: buffer, boxed: false)} - break - } - return true - } - - fileprivate static func parse_userEmpty(_ reader: BufferReader) -> User? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.User.userEmpty(id: _1!) - } - else { - return nil - } - } - fileprivate static func parse_user(_ reader: BufferReader) -> User? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt64() } - var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } - var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } - var _6: String? - if Int(_1!) & Int(1 << 3) != 0 {_6 = parseString(reader) } - var _7: String? - if Int(_1!) & Int(1 << 4) != 0 {_7 = parseString(reader) } - var _8: MacosLegacy.UserProfilePhoto? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _8 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.UserProfilePhoto - } } - var _9: MacosLegacy.UserStatus? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _9 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.UserStatus - } } - var _10: Int32? - if Int(_1!) & Int(1 << 14) != 0 {_10 = reader.readInt32() } - var _11: String? - if Int(_1!) & Int(1 << 18) != 0 {_11 = parseString(reader) } - var _12: String? - if Int(_1!) & Int(1 << 19) != 0 {_12 = 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 - let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1!) & Int(1 << 4) == 0) || _7 != nil - let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil - let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil - let _c10 = (Int(_1!) & Int(1 << 14) == 0) || _10 != nil - let _c11 = (Int(_1!) & Int(1 << 18) == 0) || _11 != nil - let _c12 = (Int(_1!) & Int(1 << 19) == 0) || _12 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return MacosLegacy.User.user(flags: _1!, id: _2!, accessHash: _3, firstName: _4, lastName: _5, username: _6, phone: _7, photo: _8, status: _9, botInfoVersion: _10, restrictionReason: _11, botInlinePlaceholder: _12) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .userEmpty(let id): - return "(userEmpty id: \(id))" - case .user(let flags, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder): - return "(user flags: \(flags), id: \(id), accessHash: \(accessHash), firstName: \(firstName), lastName: \(lastName), username: \(username), phone: \(phone), photo: \(photo), status: \(status), botInfoVersion: \(botInfoVersion), restrictionReason: \(restrictionReason), botInlinePlaceholder: \(botInlinePlaceholder))" - } - } - } - } - - public enum Message: CustomStringConvertible { - case destructMessage(flags: Int32, id: Int32, fromId: Int32, toId: MacosLegacy.Peer, date: Int32, message: String, media: MacosLegacy.MessageMedia, destructionTime: Int32, random: Int64, fakeId: Int32, ttlSeconds: Int32, outSeqNo: Int32, dstate: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .destructMessage(let flags, let id, let fromId, let toId, let date, let message, let media, let destructionTime, let random, let fakeId, let ttlSeconds, let outSeqNo, let dstate): - if boxed { - buffer.appendInt32(4) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(fromId, buffer: buffer, boxed: false) - toId.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - media.serialize(buffer, true) - serializeInt32(destructionTime, buffer: buffer, boxed: false) - serializeInt64(random, buffer: buffer, boxed: false) - serializeInt32(fakeId, buffer: buffer, boxed: false) - serializeInt32(ttlSeconds, buffer: buffer, boxed: false) - serializeInt32(outSeqNo, buffer: buffer, boxed: false) - serializeInt32(dstate, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_destructMessage(_ reader: BufferReader) -> Message? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: MacosLegacy.Peer? - if let signature = reader.readInt32() { - _4 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.Peer - } - var _5: Int32? - _5 = reader.readInt32() - var _6: String? - _6 = parseString(reader) - var _7: MacosLegacy.MessageMedia? - if let signature = reader.readInt32() { - _7 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.MessageMedia - } - var _8: Int32? - _8 = reader.readInt32() - var _9: Int64? - _9 = reader.readInt64() - var _10: Int32? - _10 = reader.readInt32() - var _11: Int32? - _11 = reader.readInt32() - var _12: Int32? - _12 = reader.readInt32() - var _13: Int32? - _13 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = _10 != nil - let _c11 = _11 != nil - let _c12 = _12 != nil - let _c13 = _13 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return MacosLegacy.Message.destructMessage(flags: _1!, id: _2!, fromId: _3!, toId: _4!, date: _5!, message: _6!, media: _7!, destructionTime: _8!, random: _9!, fakeId: _10!, ttlSeconds: _11!, outSeqNo: _12!, dstate: _13!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .destructMessage(let flags, let id, let fromId, let toId, let date, let message, let media, let destructionTime, let random, let fakeId, let ttlSeconds, let outSeqNo, let dstate): - return "(destructMessage flags: \(flags), id: \(id), fromId: \(fromId), toId: \(toId), date: \(date), message: \(message), media: \(media), destructionTime: \(destructionTime), random: \(random), fakeId: \(fakeId), ttlSeconds: \(ttlSeconds), outSeqNo: \(outSeqNo), dstate: \(dstate))" - } - } - } - } - - public enum GeoPoint: CustomStringConvertible { - case geoPointEmpty - case geoPoint(long: Double, lat: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .geoPointEmpty: - if boxed { - buffer.appendInt32(286776671) - } - - break - case .geoPoint(let long, let lat): - if boxed { - buffer.appendInt32(541710092) - } - serializeDouble(long, buffer: buffer, boxed: false) - serializeDouble(lat, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_geoPointEmpty(_ reader: BufferReader) -> GeoPoint? { - return MacosLegacy.GeoPoint.geoPointEmpty - } - fileprivate static func parse_geoPoint(_ reader: BufferReader) -> GeoPoint? { - var _1: Double? - _1 = reader.readDouble() - var _2: Double? - _2 = reader.readDouble() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return MacosLegacy.GeoPoint.geoPoint(long: _1!, lat: _2!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .geoPointEmpty: - return "(geoPointEmpty)" - case .geoPoint(let long, let lat): - return "(geoPoint long: \(long), lat: \(lat))" - } - } - } - } - - public enum MaskCoords: CustomStringConvertible { - case maskCoords(n: Int32, x: Double, y: Double, zoom: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .maskCoords(let n, let x, let y, let zoom): - if boxed { - buffer.appendInt32(-1361650766) - } - serializeInt32(n, buffer: buffer, boxed: false) - serializeDouble(x, buffer: buffer, boxed: false) - serializeDouble(y, buffer: buffer, boxed: false) - serializeDouble(zoom, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_maskCoords(_ reader: BufferReader) -> MaskCoords? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Double? - _2 = reader.readDouble() - var _3: Double? - _3 = reader.readDouble() - var _4: Double? - _4 = reader.readDouble() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return MacosLegacy.MaskCoords.maskCoords(n: _1!, x: _2!, y: _3!, zoom: _4!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .maskCoords(let n, let x, let y, let zoom): - return "(maskCoords n: \(n), x: \(x), y: \(y), zoom: \(zoom))" - } - } - } - } - - public enum UserProfilePhoto: CustomStringConvertible { - case userProfilePhotoEmpty - case userProfilePhoto(photoId: Int64, photoSmall: MacosLegacy.FileLocation, photoBig: MacosLegacy.FileLocation) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .userProfilePhotoEmpty: - if boxed { - buffer.appendInt32(1326562017) - } - - break - case .userProfilePhoto(let photoId, let photoSmall, let photoBig): - if boxed { - buffer.appendInt32(-715532088) - } - serializeInt64(photoId, buffer: buffer, boxed: false) - photoSmall.serialize(buffer, true) - photoBig.serialize(buffer, true) - break - } - return true - } - - fileprivate static func parse_userProfilePhotoEmpty(_ reader: BufferReader) -> UserProfilePhoto? { - return MacosLegacy.UserProfilePhoto.userProfilePhotoEmpty - } - fileprivate static func parse_userProfilePhoto(_ reader: BufferReader) -> UserProfilePhoto? { - var _1: Int64? - _1 = reader.readInt64() - var _2: MacosLegacy.FileLocation? - if let signature = reader.readInt32() { - _2 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.FileLocation - } - var _3: MacosLegacy.FileLocation? - if let signature = reader.readInt32() { - _3 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.FileLocation - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return MacosLegacy.UserProfilePhoto.userProfilePhoto(photoId: _1!, photoSmall: _2!, photoBig: _3!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .userProfilePhotoEmpty: - return "(userProfilePhotoEmpty)" - case .userProfilePhoto(let photoId, let photoSmall, let photoBig): - return "(userProfilePhoto photoId: \(photoId), photoSmall: \(photoSmall), photoBig: \(photoBig))" - } - } - } - } - - public enum EncryptedChat: CustomStringConvertible { - case encryptedChat(id: Int32, accessHash: Int64, date: Int32, adminId: Int32, participantId: Int32, gAOrB: Buffer, keyFingerprint: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .encryptedChat(let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint): - if boxed { - buffer.appendInt32(-94974410) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(adminId, buffer: buffer, boxed: false) - serializeInt32(participantId, buffer: buffer, boxed: false) - serializeBytes(gAOrB, buffer: buffer, boxed: false) - serializeInt64(keyFingerprint, buffer: buffer, boxed: false) - break - } - return true - } - - fileprivate static func parse_encryptedChat(_ reader: BufferReader) -> EncryptedChat? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Buffer? - _6 = parseBytes(reader) - var _7: Int64? - _7 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return MacosLegacy.EncryptedChat.encryptedChat(id: _1!, accessHash: _2!, date: _3!, adminId: _4!, participantId: _5!, gAOrB: _6!, keyFingerprint: _7!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .encryptedChat(let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint): - return "(encryptedChat id: \(id), accessHash: \(accessHash), date: \(date), adminId: \(adminId), participantId: \(participantId), gAOrB: \(gAOrB), keyFingerprint: \(keyFingerprint))" - } - } - } - } - - public enum Document: CustomStringConvertible { - case documentEmpty(id: Int64) - case document(id: Int64, accessHash: Int64, date: Int32, mimeType: String, size: Int32, thumb: MacosLegacy.PhotoSize, dcId: Int32, version: Int32, attributes: [MacosLegacy.DocumentAttribute]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) -> Swift.Bool { - switch self { - case .documentEmpty(let id): - if boxed { - buffer.appendInt32(922273905) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - case .document(let id, let accessHash, let date, let mimeType, let size, let thumb, let dcId, let version, let attributes): - if boxed { - buffer.appendInt32(-2027738169) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - thumb.serialize(buffer, true) - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { - item.serialize(buffer, true) - } - break - } - return true - } - - fileprivate static func parse_documentEmpty(_ reader: BufferReader) -> Document? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return MacosLegacy.Document.documentEmpty(id: _1!) - } - else { - return nil - } - } - fileprivate static func parse_document(_ reader: BufferReader) -> Document? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: String? - _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: MacosLegacy.PhotoSize? - if let signature = reader.readInt32() { - _6 = MacosLegacy.parse(reader, signature: signature) as? MacosLegacy.PhotoSize - } - var _7: Int32? - _7 = reader.readInt32() - var _8: Int32? - _8 = reader.readInt32() - var _9: [MacosLegacy.DocumentAttribute]? - if let _ = reader.readInt32() { - _9 = MacosLegacy.parseVector(reader, elementSignature: 0, elementType: MacosLegacy.DocumentAttribute.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return MacosLegacy.Document.document(id: _1!, accessHash: _2!, date: _3!, mimeType: _4!, size: _5!, thumb: _6!, dcId: _7!, version: _8!, attributes: _9!) - } - else { - return nil - } - } - - public var description: String { - get { - switch self { - case .documentEmpty(let id): - return "(documentEmpty id: \(id))" - case .document(let id, let accessHash, let date, let mimeType, let size, let thumb, let dcId, let version, let attributes): - return "(document id: \(id), accessHash: \(accessHash), date: \(date), mimeType: \(mimeType), size: \(size), thumb: \(thumb), dcId: \(dcId), version: \(version), attributes: \(attributes))" - } - } - } - } - - public struct functions { - - } - -}