From 7fad829dd2d9a7a315c0801e082f915ba2e25673 Mon Sep 17 00:00:00 2001 From: Viktor Borisov Date: Thu, 13 Apr 2017 13:38:01 +0700 Subject: [PATCH 1/3] apply resharper's code style --- TLSharp.Core/Auth/Authenticator.cs | 2 +- TLSharp.Core/Auth/Step1_PQRequest.cs | 14 +- TLSharp.Core/Auth/Step2_DHExchange.cs | 36 +- TLSharp.Core/Auth/Step3_CompleteDHExchange.cs | 97 +- TLSharp.Core/MTProto/Crypto/AES.cs | 302 +- TLSharp.Core/MTProto/Crypto/AuthKey.cs | 55 +- TLSharp.Core/MTProto/Crypto/BigInteger.cs | 2584 ++++++++--------- TLSharp.Core/MTProto/Crypto/Crc32.cs | 74 +- TLSharp.Core/MTProto/Crypto/Factorizator.cs | 69 +- TLSharp.Core/MTProto/Crypto/MD5Digest.cs | 192 +- TLSharp.Core/MTProto/Crypto/RSA.cs | 50 +- TLSharp.Core/MTProto/Crypto/Salt.cs | 72 +- TLSharp.Core/MTProto/Serializers.cs | 63 +- TLSharp.Core/Network/MtProtoPlainSender.cs | 36 +- TLSharp.Core/Network/MtProtoSender.cs | 897 +++--- TLSharp.Core/Network/TcpMessage.cs | 14 +- TLSharp.Core/Network/TcpTransport.cs | 35 +- TLSharp.Core/Properties/AssemblyInfo.cs | 3 +- TLSharp.Core/Requests/AckRequest.cs | 24 +- TLSharp.Core/Requests/PingRequest.cs | 17 +- TLSharp.Core/Session.cs | 43 +- TLSharp.Core/TelegramClient.cs | 185 +- TLSharp.Core/Utils/Helpers.cs | 48 +- TLSharp.Core/Utils/UploadHelper.cs | 43 +- TLSharp.Core/packages.config | 1 + TLSharp.Tests.NUnit/Test.cs | 9 +- TLSharp.Tests.NUnit/packages.config | 1 + TLSharp.Tests.VS/Properties/AssemblyInfo.cs | 3 +- TLSharp.Tests.VS/TLSharpTestsVs.cs | 9 +- TLSharp.Tests/Properties/AssemblyInfo.cs | 3 +- TLSharp.Tests/TLSharpTests.cs | 117 +- TLSharp.Tests/app.config | 17 +- TLSharp.Tests/packages.config | 1 + TeleSharp.Generator/App.config | 9 +- TeleSharp.Generator/Models.cs | 26 +- TeleSharp.Generator/Program.cs | 330 ++- .../Properties/AssemblyInfo.cs | 3 +- TeleSharp.Generator/packages.config | 1 + TeleSharp.TL/ObjectDeserializer.cs | 32 +- TeleSharp.TL/Properties/AssemblyInfo.cs | 3 +- TeleSharp.TL/TL/Account/TLAbsPassword.cs | 9 +- TeleSharp.TL/TL/Account/TLAuthorizations.cs | 38 +- TeleSharp.TL/TL/Account/TLNoPassword.cs | 42 +- TeleSharp.TL/TL/Account/TLPassword.cs | 60 +- .../TL/Account/TLPasswordInputSettings.cs | 103 +- TeleSharp.TL/TL/Account/TLPasswordSettings.cs | 36 +- TeleSharp.TL/TL/Account/TLPrivacyRules.cs | 44 +- .../TL/Account/TLRequestChangePhone.cs | 58 +- .../TL/Account/TLRequestCheckUsername.cs | 46 +- .../TL/Account/TLRequestConfirmPhone.cs | 52 +- .../TL/Account/TLRequestDeleteAccount.cs | 46 +- .../TL/Account/TLRequestGetAccountTTL.cs | 42 +- .../TL/Account/TLRequestGetAuthorizations.cs | 42 +- .../TL/Account/TLRequestGetNotifySettings.cs | 48 +- .../TL/Account/TLRequestGetPassword.cs | 42 +- .../Account/TLRequestGetPasswordSettings.cs | 46 +- .../TL/Account/TLRequestGetPrivacy.cs | 48 +- .../TL/Account/TLRequestGetWallPapers.cs | 42 +- .../TL/Account/TLRequestRegisterDevice.cs | 50 +- .../TL/Account/TLRequestReportPeer.cs | 54 +- .../TL/Account/TLRequestResetAuthorization.cs | 44 +- .../Account/TLRequestResetNotifySettings.cs | 42 +- .../Account/TLRequestSendChangePhoneCode.cs | 78 +- .../Account/TLRequestSendConfirmPhoneCode.cs | 78 +- .../TL/Account/TLRequestSetAccountTTL.cs | 48 +- .../TL/Account/TLRequestSetPrivacy.cs | 54 +- .../TL/Account/TLRequestUnregisterDevice.cs | 50 +- .../TL/Account/TLRequestUpdateDeviceLocked.cs | 44 +- .../Account/TLRequestUpdateNotifySettings.cs | 54 +- .../TLRequestUpdatePasswordSettings.cs | 52 +- .../TL/Account/TLRequestUpdateProfile.cs | 97 +- .../TL/Account/TLRequestUpdateStatus.cs | 46 +- .../TL/Account/TLRequestUpdateUsername.cs | 46 +- TeleSharp.TL/TL/Auth/TLAbsCodeType.cs | 9 +- TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs | 9 +- TeleSharp.TL/TL/Auth/TLAuthorization.cs | 60 +- TeleSharp.TL/TL/Auth/TLCheckedPhone.cs | 36 +- TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs | 31 +- TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs | 31 +- TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs | 31 +- .../TL/Auth/TLExportedAuthorization.cs | 40 +- TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs | 36 +- .../TL/Auth/TLRequestBindTempAuthKey.cs | 62 +- TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs | 52 +- .../TL/Auth/TLRequestCheckPassword.cs | 46 +- TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs | 46 +- .../TL/Auth/TLRequestDropTempAuthKeys.cs | 48 +- .../TL/Auth/TLRequestExportAuthorization.cs | 44 +- .../TL/Auth/TLRequestImportAuthorization.cs | 50 +- .../Auth/TLRequestImportBotAuthorization.cs | 66 +- TeleSharp.TL/TL/Auth/TLRequestLogOut.cs | 42 +- .../TL/Auth/TLRequestRecoverPassword.cs | 46 +- .../Auth/TLRequestRequestPasswordRecovery.cs | 42 +- TeleSharp.TL/TL/Auth/TLRequestResendCode.cs | 52 +- .../TL/Auth/TLRequestResetAuthorizations.cs | 42 +- TeleSharp.TL/TL/Auth/TLRequestSendCode.cs | 88 +- TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs | 54 +- TeleSharp.TL/TL/Auth/TLRequestSignIn.cs | 58 +- TeleSharp.TL/TL/Auth/TLRequestSignUp.cs | 70 +- TeleSharp.TL/TL/Auth/TLSentCode.cs | 89 +- TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs | 34 +- TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs | 34 +- .../TL/Auth/TLSentCodeTypeFlashCall.cs | 36 +- TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs | 34 +- .../TL/Channels/TLChannelParticipant.cs | 44 +- .../TL/Channels/TLChannelParticipants.cs | 46 +- .../TL/Channels/TLRequestCheckUsername.cs | 54 +- .../TL/Channels/TLRequestCreateChannel.cs | 72 +- .../TL/Channels/TLRequestDeleteChannel.cs | 48 +- .../TL/Channels/TLRequestDeleteMessages.cs | 55 +- .../TL/Channels/TLRequestDeleteUserHistory.cs | 55 +- .../TL/Channels/TLRequestEditAbout.cs | 54 +- .../TL/Channels/TLRequestEditAdmin.cs | 60 +- .../TL/Channels/TLRequestEditPhoto.cs | 54 +- .../TL/Channels/TLRequestEditTitle.cs | 54 +- .../TL/Channels/TLRequestExportInvite.cs | 48 +- .../TL/Channels/TLRequestExportMessageLink.cs | 54 +- .../TLRequestGetAdminedPublicChannels.cs | 43 +- .../TL/Channels/TLRequestGetChannels.cs | 49 +- .../TL/Channels/TLRequestGetFullChannel.cs | 48 +- .../TL/Channels/TLRequestGetMessages.cs | 55 +- .../TL/Channels/TLRequestGetParticipant.cs | 54 +- .../TL/Channels/TLRequestGetParticipants.cs | 66 +- .../TL/Channels/TLRequestInviteToChannel.cs | 54 +- .../TL/Channels/TLRequestJoinChannel.cs | 48 +- .../TL/Channels/TLRequestKickFromChannel.cs | 60 +- .../TL/Channels/TLRequestLeaveChannel.cs | 48 +- .../TL/Channels/TLRequestReadHistory.cs | 54 +- .../TL/Channels/TLRequestReportSpam.cs | 60 +- .../TL/Channels/TLRequestToggleInvites.cs | 54 +- .../TL/Channels/TLRequestToggleSignatures.cs | 54 +- .../Channels/TLRequestUpdatePinnedMessage.cs | 66 +- .../TL/Channels/TLRequestUpdateUsername.cs | 54 +- TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs | 9 +- TeleSharp.TL/TL/Contacts/TLAbsContacts.cs | 9 +- TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs | 9 +- TeleSharp.TL/TL/Contacts/TLBlocked.cs | 44 +- TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs | 46 +- TeleSharp.TL/TL/Contacts/TLContacts.cs | 44 +- .../TL/Contacts/TLContactsNotModified.cs | 31 +- TeleSharp.TL/TL/Contacts/TLFound.cs | 50 +- .../TL/Contacts/TLImportedContacts.cs | 50 +- TeleSharp.TL/TL/Contacts/TLLink.cs | 50 +- TeleSharp.TL/TL/Contacts/TLRequestBlock.cs | 48 +- .../TL/Contacts/TLRequestDeleteContact.cs | 48 +- .../TL/Contacts/TLRequestDeleteContacts.cs | 48 +- .../TL/Contacts/TLRequestExportCard.cs | 42 +- .../TL/Contacts/TLRequestGetBlocked.cs | 50 +- .../TL/Contacts/TLRequestGetContacts.cs | 46 +- .../TL/Contacts/TLRequestGetStatuses.cs | 42 +- .../TL/Contacts/TLRequestGetTopPeers.cs | 99 +- .../TL/Contacts/TLRequestImportCard.cs | 48 +- .../TL/Contacts/TLRequestImportContacts.cs | 54 +- .../Contacts/TLRequestResetTopPeerRating.cs | 54 +- .../TL/Contacts/TLRequestResolveUsername.cs | 46 +- TeleSharp.TL/TL/Contacts/TLRequestSearch.cs | 52 +- TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs | 48 +- TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs | 50 +- TeleSharp.TL/TL/Contacts/TLTopPeers.cs | 50 +- .../TL/Contacts/TLTopPeersNotModified.cs | 31 +- TeleSharp.TL/TL/Help/TLAbsAppChangelog.cs | 9 +- TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs | 9 +- TeleSharp.TL/TL/Help/TLAppChangelog.cs | 36 +- TeleSharp.TL/TL/Help/TLAppChangelogEmpty.cs | 31 +- TeleSharp.TL/TL/Help/TLAppUpdate.cs | 52 +- TeleSharp.TL/TL/Help/TLInviteText.cs | 36 +- TeleSharp.TL/TL/Help/TLNoAppUpdate.cs | 31 +- .../TL/Help/TLRequestGetAppChangelog.cs | 42 +- TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs | 42 +- TeleSharp.TL/TL/Help/TLRequestGetConfig.cs | 42 +- .../TL/Help/TLRequestGetInviteText.cs | 42 +- TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs | 42 +- TeleSharp.TL/TL/Help/TLRequestGetSupport.cs | 42 +- .../TL/Help/TLRequestGetTermsOfService.cs | 42 +- TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs | 48 +- TeleSharp.TL/TL/Help/TLSupport.cs | 42 +- TeleSharp.TL/TL/Help/TLTermsOfService.cs | 36 +- TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs | 9 +- TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs | 9 +- TeleSharp.TL/TL/Messages/TLAbsDialogs.cs | 9 +- .../TL/Messages/TLAbsFeaturedStickers.cs | 9 +- TeleSharp.TL/TL/Messages/TLAbsMessages.cs | 9 +- .../TL/Messages/TLAbsRecentStickers.cs | 9 +- TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs | 9 +- .../TL/Messages/TLAbsSentEncryptedMessage.cs | 9 +- .../Messages/TLAbsStickerSetInstallResult.cs | 9 +- TeleSharp.TL/TL/Messages/TLAbsStickers.cs | 9 +- TeleSharp.TL/TL/Messages/TLAffectedHistory.cs | 46 +- .../TL/Messages/TLAffectedMessages.cs | 40 +- TeleSharp.TL/TL/Messages/TLAllStickers.cs | 40 +- .../TL/Messages/TLAllStickersNotModified.cs | 31 +- .../TL/Messages/TLArchivedStickers.cs | 40 +- .../TL/Messages/TLBotCallbackAnswer.cs | 83 +- TeleSharp.TL/TL/Messages/TLBotResults.cs | 88 +- TeleSharp.TL/TL/Messages/TLChannelMessages.cs | 68 +- TeleSharp.TL/TL/Messages/TLChatFull.cs | 50 +- TeleSharp.TL/TL/Messages/TLChats.cs | 38 +- TeleSharp.TL/TL/Messages/TLDhConfig.cs | 52 +- .../TL/Messages/TLDhConfigNotModified.cs | 36 +- TeleSharp.TL/TL/Messages/TLDialogs.cs | 56 +- TeleSharp.TL/TL/Messages/TLDialogsSlice.cs | 58 +- .../TL/Messages/TLFeaturedStickers.cs | 46 +- .../Messages/TLFeaturedStickersNotModified.cs | 31 +- TeleSharp.TL/TL/Messages/TLFoundGifs.cs | 40 +- TeleSharp.TL/TL/Messages/TLHighScores.cs | 44 +- TeleSharp.TL/TL/Messages/TLMessageEditData.cs | 45 +- TeleSharp.TL/TL/Messages/TLMessages.cs | 50 +- TeleSharp.TL/TL/Messages/TLMessagesSlice.cs | 52 +- TeleSharp.TL/TL/Messages/TLPeerDialogs.cs | 63 +- TeleSharp.TL/TL/Messages/TLRecentStickers.cs | 40 +- .../Messages/TLRecentStickersNotModified.cs | 31 +- .../TL/Messages/TLRequestAcceptEncryption.cs | 60 +- .../TL/Messages/TLRequestAddChatUser.cs | 56 +- .../TL/Messages/TLRequestCheckChatInvite.cs | 46 +- .../Messages/TLRequestClearRecentStickers.cs | 55 +- .../TL/Messages/TLRequestCreateChat.cs | 54 +- .../TL/Messages/TLRequestDeleteChatUser.cs | 50 +- .../TL/Messages/TLRequestDeleteHistory.cs | 66 +- .../TL/Messages/TLRequestDeleteMessages.cs | 48 +- .../TL/Messages/TLRequestDiscardEncryption.cs | 44 +- .../TL/Messages/TLRequestEditChatAdmin.cs | 56 +- .../TL/Messages/TLRequestEditChatPhoto.cs | 50 +- .../TL/Messages/TLRequestEditChatTitle.cs | 50 +- .../Messages/TLRequestEditInlineBotMessage.cs | 109 +- .../TL/Messages/TLRequestEditMessage.cs | 115 +- .../TL/Messages/TLRequestExportChatInvite.cs | 44 +- .../TL/Messages/TLRequestForwardMessage.cs | 60 +- .../TL/Messages/TLRequestForwardMessages.cs | 91 +- .../TL/Messages/TLRequestGetAllDrafts.cs | 42 +- .../TL/Messages/TLRequestGetAllStickers.cs | 44 +- .../Messages/TLRequestGetArchivedStickers.cs | 66 +- .../Messages/TLRequestGetAttachedStickers.cs | 48 +- .../Messages/TLRequestGetBotCallbackAnswer.cs | 83 +- TeleSharp.TL/TL/Messages/TLRequestGetChats.cs | 48 +- .../TL/Messages/TLRequestGetDhConfig.cs | 50 +- .../TL/Messages/TLRequestGetDialogs.cs | 62 +- .../TL/Messages/TLRequestGetDocumentByHash.cs | 58 +- .../Messages/TLRequestGetFeaturedStickers.cs | 44 +- .../TL/Messages/TLRequestGetFullChat.cs | 44 +- .../TL/Messages/TLRequestGetGameHighScores.cs | 60 +- .../TL/Messages/TLRequestGetHistory.cs | 84 +- .../Messages/TLRequestGetInlineBotResults.cs | 88 +- .../TLRequestGetInlineGameHighScores.cs | 54 +- .../TL/Messages/TLRequestGetMaskStickers.cs | 44 +- .../Messages/TLRequestGetMessageEditData.cs | 54 +- .../TL/Messages/TLRequestGetMessages.cs | 48 +- .../TL/Messages/TLRequestGetMessagesViews.cs | 60 +- .../TL/Messages/TLRequestGetPeerDialogs.cs | 48 +- .../TL/Messages/TLRequestGetPeerSettings.cs | 48 +- .../TL/Messages/TLRequestGetRecentStickers.cs | 60 +- .../TL/Messages/TLRequestGetSavedGifs.cs | 44 +- .../TL/Messages/TLRequestGetStickerSet.cs | 48 +- .../TL/Messages/TLRequestGetWebPagePreview.cs | 46 +- .../TL/Messages/TLRequestHideReportSpam.cs | 48 +- .../TL/Messages/TLRequestImportChatInvite.cs | 46 +- .../TL/Messages/TLRequestInstallStickerSet.cs | 54 +- .../TL/Messages/TLRequestMigrateChat.cs | 44 +- .../Messages/TLRequestReadEncryptedHistory.cs | 54 +- .../Messages/TLRequestReadFeaturedStickers.cs | 48 +- .../TL/Messages/TLRequestReadHistory.cs | 54 +- .../Messages/TLRequestReadMessageContents.cs | 48 +- .../TL/Messages/TLRequestReceivedMessages.cs | 44 +- .../TL/Messages/TLRequestReceivedQueue.cs | 44 +- .../Messages/TLRequestReorderStickerSets.cs | 60 +- .../TL/Messages/TLRequestReportSpam.cs | 48 +- .../TL/Messages/TLRequestRequestEncryption.cs | 60 +- .../TL/Messages/TLRequestSaveDraft.cs | 99 +- TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs | 54 +- .../TL/Messages/TLRequestSaveRecentSticker.cs | 66 +- TeleSharp.TL/TL/Messages/TLRequestSearch.cs | 96 +- .../TL/Messages/TLRequestSearchGifs.cs | 52 +- .../TL/Messages/TLRequestSearchGlobal.cs | 70 +- .../TL/Messages/TLRequestSendEncrypted.cs | 60 +- .../TL/Messages/TLRequestSendEncryptedFile.cs | 66 +- .../Messages/TLRequestSendEncryptedService.cs | 60 +- .../Messages/TLRequestSendInlineBotResult.cs | 107 +- .../TL/Messages/TLRequestSendMedia.cs | 118 +- .../TL/Messages/TLRequestSendMessage.cs | 141 +- .../Messages/TLRequestSetBotCallbackAnswer.cs | 93 +- .../Messages/TLRequestSetEncryptedTyping.cs | 54 +- .../TL/Messages/TLRequestSetGameScore.cs | 78 +- .../Messages/TLRequestSetInlineBotResults.cs | 111 +- .../Messages/TLRequestSetInlineGameScore.cs | 72 +- .../TL/Messages/TLRequestSetTyping.cs | 54 +- TeleSharp.TL/TL/Messages/TLRequestStartBot.cs | 66 +- .../TL/Messages/TLRequestToggleChatAdmins.cs | 50 +- .../Messages/TLRequestUninstallStickerSet.cs | 48 +- TeleSharp.TL/TL/Messages/TLSavedGifs.cs | 40 +- .../TL/Messages/TLSavedGifsNotModified.cs | 31 +- .../TL/Messages/TLSentEncryptedFile.cs | 40 +- .../TL/Messages/TLSentEncryptedMessage.cs | 34 +- TeleSharp.TL/TL/Messages/TLStickerSet.cs | 50 +- .../TLStickerSetInstallResultArchive.cs | 38 +- .../TLStickerSetInstallResultSuccess.cs | 31 +- TeleSharp.TL/TL/Messages/TLStickers.cs | 42 +- .../TL/Messages/TLStickersNotModified.cs | 31 +- TeleSharp.TL/TL/Photos/TLAbsPhotos.cs | 9 +- TeleSharp.TL/TL/Photos/TLPhoto.cs | 44 +- TeleSharp.TL/TL/Photos/TLPhotos.cs | 44 +- TeleSharp.TL/TL/Photos/TLPhotosSlice.cs | 46 +- .../TL/Photos/TLRequestDeletePhotos.cs | 48 +- .../TL/Photos/TLRequestGetUserPhotos.cs | 66 +- .../TL/Photos/TLRequestUpdateProfilePhoto.cs | 48 +- .../TL/Photos/TLRequestUploadProfilePhoto.cs | 48 +- TeleSharp.TL/TL/Storage/TLAbsFileType.cs | 9 +- TeleSharp.TL/TL/Storage/TLFileGif.cs | 31 +- TeleSharp.TL/TL/Storage/TLFileJpeg.cs | 31 +- TeleSharp.TL/TL/Storage/TLFileMov.cs | 31 +- TeleSharp.TL/TL/Storage/TLFileMp3.cs | 31 +- TeleSharp.TL/TL/Storage/TLFileMp4.cs | 31 +- TeleSharp.TL/TL/Storage/TLFilePartial.cs | 31 +- TeleSharp.TL/TL/Storage/TLFilePdf.cs | 31 +- TeleSharp.TL/TL/Storage/TLFilePng.cs | 31 +- TeleSharp.TL/TL/Storage/TLFileUnknown.cs | 31 +- TeleSharp.TL/TL/Storage/TLFileWebp.cs | 31 +- TeleSharp.TL/TL/TLAbsBool.cs | 9 +- TeleSharp.TL/TL/TLAbsBotInlineMessage.cs | 9 +- TeleSharp.TL/TL/TLAbsBotInlineResult.cs | 9 +- TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs | 9 +- TeleSharp.TL/TL/TLAbsChannelParticipant.cs | 9 +- .../TL/TLAbsChannelParticipantRole.cs | 9 +- .../TL/TLAbsChannelParticipantsFilter.cs | 9 +- TeleSharp.TL/TL/TLAbsChat.cs | 9 +- TeleSharp.TL/TL/TLAbsChatFull.cs | 9 +- TeleSharp.TL/TL/TLAbsChatInvite.cs | 9 +- TeleSharp.TL/TL/TLAbsChatParticipant.cs | 9 +- TeleSharp.TL/TL/TLAbsChatParticipants.cs | 9 +- TeleSharp.TL/TL/TLAbsChatPhoto.cs | 9 +- TeleSharp.TL/TL/TLAbsContactLink.cs | 9 +- TeleSharp.TL/TL/TLAbsDocument.cs | 9 +- TeleSharp.TL/TL/TLAbsDocumentAttribute.cs | 9 +- TeleSharp.TL/TL/TLAbsDraftMessage.cs | 9 +- TeleSharp.TL/TL/TLAbsEncryptedChat.cs | 9 +- TeleSharp.TL/TL/TLAbsEncryptedFile.cs | 9 +- TeleSharp.TL/TL/TLAbsEncryptedMessage.cs | 9 +- TeleSharp.TL/TL/TLAbsExportedChatInvite.cs | 9 +- TeleSharp.TL/TL/TLAbsFileLocation.cs | 9 +- TeleSharp.TL/TL/TLAbsFoundGif.cs | 9 +- TeleSharp.TL/TL/TLAbsGeoPoint.cs | 9 +- TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs | 9 +- TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs | 9 +- TeleSharp.TL/TL/TLAbsInputChannel.cs | 9 +- TeleSharp.TL/TL/TLAbsInputChatPhoto.cs | 9 +- TeleSharp.TL/TL/TLAbsInputDocument.cs | 9 +- TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs | 9 +- TeleSharp.TL/TL/TLAbsInputFile.cs | 9 +- TeleSharp.TL/TL/TLAbsInputFileLocation.cs | 9 +- TeleSharp.TL/TL/TLAbsInputGame.cs | 9 +- TeleSharp.TL/TL/TLAbsInputGeoPoint.cs | 9 +- TeleSharp.TL/TL/TLAbsInputMedia.cs | 9 +- TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs | 9 +- TeleSharp.TL/TL/TLAbsInputPeer.cs | 9 +- TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs | 9 +- TeleSharp.TL/TL/TLAbsInputPhoto.cs | 9 +- TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs | 9 +- TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs | 9 +- TeleSharp.TL/TL/TLAbsInputStickerSet.cs | 9 +- TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs | 9 +- TeleSharp.TL/TL/TLAbsInputUser.cs | 9 +- TeleSharp.TL/TL/TLAbsKeyboardButton.cs | 9 +- TeleSharp.TL/TL/TLAbsMessage.cs | 9 +- TeleSharp.TL/TL/TLAbsMessageAction.cs | 9 +- TeleSharp.TL/TL/TLAbsMessageEntity.cs | 9 +- TeleSharp.TL/TL/TLAbsMessageMedia.cs | 9 +- TeleSharp.TL/TL/TLAbsMessagesFilter.cs | 9 +- TeleSharp.TL/TL/TLAbsNotifyPeer.cs | 9 +- TeleSharp.TL/TL/TLAbsPeer.cs | 9 +- TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs | 9 +- TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs | 9 +- TeleSharp.TL/TL/TLAbsPhoto.cs | 9 +- TeleSharp.TL/TL/TLAbsPhotoSize.cs | 9 +- TeleSharp.TL/TL/TLAbsPrivacyKey.cs | 9 +- TeleSharp.TL/TL/TLAbsPrivacyRule.cs | 9 +- TeleSharp.TL/TL/TLAbsReplyMarkup.cs | 9 +- TeleSharp.TL/TL/TLAbsReportReason.cs | 9 +- TeleSharp.TL/TL/TLAbsSendMessageAction.cs | 9 +- TeleSharp.TL/TL/TLAbsStickerSetCovered.cs | 9 +- TeleSharp.TL/TL/TLAbsTopPeerCategory.cs | 9 +- TeleSharp.TL/TL/TLAbsUpdate.cs | 9 +- TeleSharp.TL/TL/TLAbsUpdates.cs | 9 +- TeleSharp.TL/TL/TLAbsUser.cs | 9 +- TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs | 9 +- TeleSharp.TL/TL/TLAbsUserStatus.cs | 9 +- TeleSharp.TL/TL/TLAbsWallPaper.cs | 9 +- TeleSharp.TL/TL/TLAbsWebPage.cs | 9 +- TeleSharp.TL/TL/TLAccountDaysTTL.cs | 34 +- TeleSharp.TL/TL/TLAuthorization.cs | 110 +- TeleSharp.TL/TL/TLBoolFalse.cs | 31 +- TeleSharp.TL/TL/TLBoolTrue.cs | 31 +- TeleSharp.TL/TL/TLBotCommand.cs | 42 +- TeleSharp.TL/TL/TLBotInfo.cs | 46 +- TeleSharp.TL/TL/TLBotInlineMediaResult.cs | 120 +- .../TL/TLBotInlineMessageMediaAuto.cs | 61 +- .../TL/TLBotInlineMessageMediaContact.cs | 73 +- TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs | 61 +- .../TL/TLBotInlineMessageMediaVenue.cs | 85 +- TeleSharp.TL/TL/TLBotInlineMessageText.cs | 83 +- TeleSharp.TL/TL/TLBotInlineResult.cs | 200 +- TeleSharp.TL/TL/TLChannel.cs | 199 +- TeleSharp.TL/TL/TLChannelForbidden.cs | 68 +- TeleSharp.TL/TL/TLChannelFull.cs | 201 +- TeleSharp.TL/TL/TLChannelMessagesFilter.cs | 50 +- .../TL/TLChannelMessagesFilterEmpty.cs | 31 +- TeleSharp.TL/TL/TLChannelParticipant.cs | 40 +- .../TL/TLChannelParticipantCreator.cs | 34 +- TeleSharp.TL/TL/TLChannelParticipantEditor.cs | 46 +- TeleSharp.TL/TL/TLChannelParticipantKicked.cs | 46 +- .../TL/TLChannelParticipantModerator.cs | 46 +- TeleSharp.TL/TL/TLChannelParticipantSelf.cs | 46 +- .../TL/TLChannelParticipantsAdmins.cs | 31 +- TeleSharp.TL/TL/TLChannelParticipantsBots.cs | 31 +- .../TL/TLChannelParticipantsKicked.cs | 31 +- .../TL/TLChannelParticipantsRecent.cs | 31 +- TeleSharp.TL/TL/TLChannelRoleEditor.cs | 31 +- TeleSharp.TL/TL/TLChannelRoleEmpty.cs | 31 +- TeleSharp.TL/TL/TLChannelRoleModerator.cs | 31 +- TeleSharp.TL/TL/TLChat.cs | 131 +- TeleSharp.TL/TL/TLChatEmpty.cs | 34 +- TeleSharp.TL/TL/TLChatForbidden.cs | 40 +- TeleSharp.TL/TL/TLChatFull.cs | 64 +- TeleSharp.TL/TL/TLChatInvite.cs | 99 +- TeleSharp.TL/TL/TLChatInviteAlready.cs | 38 +- TeleSharp.TL/TL/TLChatInviteEmpty.cs | 31 +- TeleSharp.TL/TL/TLChatInviteExported.cs | 36 +- TeleSharp.TL/TL/TLChatParticipant.cs | 46 +- TeleSharp.TL/TL/TLChatParticipantAdmin.cs | 46 +- TeleSharp.TL/TL/TLChatParticipantCreator.cs | 34 +- TeleSharp.TL/TL/TLChatParticipants.cs | 46 +- .../TL/TLChatParticipantsForbidden.cs | 61 +- TeleSharp.TL/TL/TLChatPhoto.cs | 44 +- TeleSharp.TL/TL/TLChatPhotoEmpty.cs | 31 +- TeleSharp.TL/TL/TLConfig.cs | 186 +- TeleSharp.TL/TL/TLContact.cs | 40 +- TeleSharp.TL/TL/TLContactBlocked.cs | 40 +- TeleSharp.TL/TL/TLContactLinkContact.cs | 31 +- TeleSharp.TL/TL/TLContactLinkHasPhone.cs | 31 +- TeleSharp.TL/TL/TLContactLinkNone.cs | 31 +- TeleSharp.TL/TL/TLContactLinkUnknown.cs | 31 +- TeleSharp.TL/TL/TLContactStatus.cs | 40 +- TeleSharp.TL/TL/TLDcOption.cs | 75 +- TeleSharp.TL/TL/TLDialog.cs | 107 +- TeleSharp.TL/TL/TLDisabledFeature.cs | 42 +- TeleSharp.TL/TL/TLDocument.cs | 82 +- .../TL/TLDocumentAttributeAnimated.cs | 31 +- TeleSharp.TL/TL/TLDocumentAttributeAudio.cs | 99 +- .../TL/TLDocumentAttributeFilename.cs | 36 +- .../TL/TLDocumentAttributeHasStickers.cs | 31 +- .../TL/TLDocumentAttributeImageSize.cs | 40 +- TeleSharp.TL/TL/TLDocumentAttributeSticker.cs | 73 +- TeleSharp.TL/TL/TLDocumentAttributeVideo.cs | 46 +- TeleSharp.TL/TL/TLDocumentEmpty.cs | 34 +- TeleSharp.TL/TL/TLDraftMessage.cs | 88 +- TeleSharp.TL/TL/TLDraftMessageEmpty.cs | 31 +- TeleSharp.TL/TL/TLEncryptedChat.cs | 70 +- TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs | 34 +- TeleSharp.TL/TL/TLEncryptedChatEmpty.cs | 34 +- TeleSharp.TL/TL/TLEncryptedChatRequested.cs | 64 +- TeleSharp.TL/TL/TLEncryptedChatWaiting.cs | 58 +- TeleSharp.TL/TL/TLEncryptedFile.cs | 58 +- TeleSharp.TL/TL/TLEncryptedFileEmpty.cs | 31 +- TeleSharp.TL/TL/TLEncryptedMessage.cs | 58 +- TeleSharp.TL/TL/TLEncryptedMessageService.cs | 52 +- TeleSharp.TL/TL/TLError.cs | 40 +- TeleSharp.TL/TL/TLExportedMessageLink.cs | 36 +- TeleSharp.TL/TL/TLFileLocation.cs | 52 +- TeleSharp.TL/TL/TLFileLocationUnavailable.cs | 46 +- TeleSharp.TL/TL/TLFoundGif.cs | 66 +- TeleSharp.TL/TL/TLFoundGifCached.cs | 48 +- TeleSharp.TL/TL/TLGame.cs | 91 +- TeleSharp.TL/TL/TLGeoPoint.cs | 40 +- TeleSharp.TL/TL/TLGeoPointEmpty.cs | 31 +- TeleSharp.TL/TL/TLHighScore.cs | 46 +- TeleSharp.TL/TL/TLImportedContact.cs | 40 +- TeleSharp.TL/TL/TLInlineBotSwitchPM.cs | 42 +- TeleSharp.TL/TL/TLInputAppEvent.cs | 52 +- .../TL/TLInputBotInlineMessageGame.cs | 55 +- TeleSharp.TL/TL/TLInputBotInlineMessageID.cs | 46 +- .../TL/TLInputBotInlineMessageMediaAuto.cs | 61 +- .../TL/TLInputBotInlineMessageMediaContact.cs | 73 +- .../TL/TLInputBotInlineMessageMediaGeo.cs | 61 +- .../TL/TLInputBotInlineMessageMediaVenue.cs | 85 +- .../TL/TLInputBotInlineMessageText.cs | 83 +- TeleSharp.TL/TL/TLInputBotInlineResult.cs | 200 +- .../TL/TLInputBotInlineResultDocument.cs | 94 +- TeleSharp.TL/TL/TLInputBotInlineResultGame.cs | 48 +- .../TL/TLInputBotInlineResultPhoto.cs | 54 +- TeleSharp.TL/TL/TLInputChannel.cs | 40 +- TeleSharp.TL/TL/TLInputChannelEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputChatPhoto.cs | 38 +- TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs | 38 +- TeleSharp.TL/TL/TLInputDocument.cs | 40 +- TeleSharp.TL/TL/TLInputDocumentEmpty.cs | 31 +- .../TL/TLInputDocumentFileLocation.cs | 46 +- TeleSharp.TL/TL/TLInputEncryptedChat.cs | 40 +- TeleSharp.TL/TL/TLInputEncryptedFile.cs | 40 +- .../TL/TLInputEncryptedFileBigUploaded.cs | 46 +- TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs | 31 +- .../TL/TLInputEncryptedFileLocation.cs | 40 +- .../TL/TLInputEncryptedFileUploaded.cs | 52 +- TeleSharp.TL/TL/TLInputFile.cs | 52 +- TeleSharp.TL/TL/TLInputFileBig.cs | 46 +- TeleSharp.TL/TL/TLInputFileLocation.cs | 46 +- TeleSharp.TL/TL/TLInputGameID.cs | 40 +- TeleSharp.TL/TL/TLInputGameShortName.cs | 44 +- TeleSharp.TL/TL/TLInputGeoPoint.cs | 40 +- TeleSharp.TL/TL/TLInputGeoPointEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputMediaContact.cs | 48 +- TeleSharp.TL/TL/TLInputMediaDocument.cs | 44 +- .../TL/TLInputMediaDocumentExternal.cs | 42 +- TeleSharp.TL/TL/TLInputMediaEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputMediaGame.cs | 38 +- TeleSharp.TL/TL/TLInputMediaGeoPoint.cs | 38 +- TeleSharp.TL/TL/TLInputMediaGifExternal.cs | 42 +- TeleSharp.TL/TL/TLInputMediaPhoto.cs | 44 +- TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs | 42 +- .../TL/TLInputMediaUploadedDocument.cs | 79 +- TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs | 67 +- .../TL/TLInputMediaUploadedThumbDocument.cs | 85 +- TeleSharp.TL/TL/TLInputMediaVenue.cs | 62 +- .../TL/TLInputMessageEntityMentionName.cs | 46 +- .../TL/TLInputMessagesFilterChatPhotos.cs | 31 +- .../TL/TLInputMessagesFilterDocument.cs | 31 +- TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputMessagesFilterGif.cs | 31 +- TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs | 31 +- .../TL/TLInputMessagesFilterPhotoVideo.cs | 31 +- ...LInputMessagesFilterPhotoVideoDocuments.cs | 31 +- .../TL/TLInputMessagesFilterPhotos.cs | 31 +- TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs | 31 +- TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs | 31 +- TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs | 31 +- TeleSharp.TL/TL/TLInputNotifyAll.cs | 31 +- TeleSharp.TL/TL/TLInputNotifyChats.cs | 31 +- TeleSharp.TL/TL/TLInputNotifyPeer.cs | 38 +- TeleSharp.TL/TL/TLInputNotifyUsers.cs | 31 +- TeleSharp.TL/TL/TLInputPeerChannel.cs | 40 +- TeleSharp.TL/TL/TLInputPeerChat.cs | 34 +- TeleSharp.TL/TL/TLInputPeerEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs | 31 +- .../TL/TLInputPeerNotifyEventsEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputPeerNotifySettings.cs | 62 +- TeleSharp.TL/TL/TLInputPeerSelf.cs | 31 +- TeleSharp.TL/TL/TLInputPeerUser.cs | 40 +- TeleSharp.TL/TL/TLInputPhoneContact.cs | 52 +- TeleSharp.TL/TL/TLInputPhoto.cs | 40 +- TeleSharp.TL/TL/TLInputPhotoEmpty.cs | 31 +- .../TL/TLInputPrivacyKeyChatInvite.cs | 31 +- .../TL/TLInputPrivacyKeyStatusTimestamp.cs | 31 +- .../TL/TLInputPrivacyValueAllowAll.cs | 31 +- .../TL/TLInputPrivacyValueAllowContacts.cs | 31 +- .../TL/TLInputPrivacyValueAllowUsers.cs | 38 +- .../TL/TLInputPrivacyValueDisallowAll.cs | 31 +- .../TL/TLInputPrivacyValueDisallowContacts.cs | 31 +- .../TL/TLInputPrivacyValueDisallowUsers.cs | 38 +- TeleSharp.TL/TL/TLInputReportReasonOther.cs | 36 +- .../TL/TLInputReportReasonPornography.cs | 31 +- TeleSharp.TL/TL/TLInputReportReasonSpam.cs | 31 +- .../TL/TLInputReportReasonViolence.cs | 31 +- TeleSharp.TL/TL/TLInputStickerSetEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputStickerSetID.cs | 40 +- TeleSharp.TL/TL/TLInputStickerSetShortName.cs | 36 +- .../TL/TLInputStickeredMediaDocument.cs | 38 +- TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs | 38 +- TeleSharp.TL/TL/TLInputUser.cs | 40 +- TeleSharp.TL/TL/TLInputUserEmpty.cs | 31 +- TeleSharp.TL/TL/TLInputUserSelf.cs | 31 +- TeleSharp.TL/TL/TLKeyboardButton.cs | 36 +- TeleSharp.TL/TL/TLKeyboardButtonCallback.cs | 42 +- TeleSharp.TL/TL/TLKeyboardButtonGame.cs | 36 +- .../TL/TLKeyboardButtonRequestGeoLocation.cs | 36 +- .../TL/TLKeyboardButtonRequestPhone.cs | 36 +- TeleSharp.TL/TL/TLKeyboardButtonRow.cs | 38 +- .../TL/TLKeyboardButtonSwitchInline.cs | 56 +- TeleSharp.TL/TL/TLKeyboardButtonUrl.cs | 42 +- TeleSharp.TL/TL/TLMaskCoords.cs | 52 +- TeleSharp.TL/TL/TLMessage.cs | 240 +- .../TL/TLMessageActionChannelCreate.cs | 36 +- .../TL/TLMessageActionChannelMigrateFrom.cs | 42 +- TeleSharp.TL/TL/TLMessageActionChatAddUser.cs | 38 +- TeleSharp.TL/TL/TLMessageActionChatCreate.cs | 42 +- .../TL/TLMessageActionChatDeletePhoto.cs | 31 +- .../TL/TLMessageActionChatDeleteUser.cs | 34 +- .../TL/TLMessageActionChatEditPhoto.cs | 38 +- .../TL/TLMessageActionChatEditTitle.cs | 36 +- .../TL/TLMessageActionChatJoinedByLink.cs | 34 +- .../TL/TLMessageActionChatMigrateTo.cs | 34 +- TeleSharp.TL/TL/TLMessageActionEmpty.cs | 31 +- TeleSharp.TL/TL/TLMessageActionGameScore.cs | 40 +- .../TL/TLMessageActionHistoryClear.cs | 31 +- TeleSharp.TL/TL/TLMessageActionPinMessage.cs | 31 +- TeleSharp.TL/TL/TLMessageEmpty.cs | 34 +- TeleSharp.TL/TL/TLMessageEntityBold.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityBotCommand.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityCode.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityEmail.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityHashtag.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityItalic.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityMention.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityMentionName.cs | 46 +- TeleSharp.TL/TL/TLMessageEntityPre.cs | 46 +- TeleSharp.TL/TL/TLMessageEntityTextUrl.cs | 46 +- TeleSharp.TL/TL/TLMessageEntityUnknown.cs | 40 +- TeleSharp.TL/TL/TLMessageEntityUrl.cs | 40 +- TeleSharp.TL/TL/TLMessageFwdHeader.cs | 93 +- TeleSharp.TL/TL/TLMessageMediaContact.cs | 54 +- TeleSharp.TL/TL/TLMessageMediaDocument.cs | 44 +- TeleSharp.TL/TL/TLMessageMediaEmpty.cs | 31 +- TeleSharp.TL/TL/TLMessageMediaGame.cs | 38 +- TeleSharp.TL/TL/TLMessageMediaGeo.cs | 38 +- TeleSharp.TL/TL/TLMessageMediaPhoto.cs | 44 +- TeleSharp.TL/TL/TLMessageMediaUnsupported.cs | 31 +- TeleSharp.TL/TL/TLMessageMediaVenue.cs | 62 +- TeleSharp.TL/TL/TLMessageMediaWebPage.cs | 38 +- TeleSharp.TL/TL/TLMessageRange.cs | 40 +- TeleSharp.TL/TL/TLMessageService.cs | 127 +- TeleSharp.TL/TL/TLNearestDc.cs | 48 +- TeleSharp.TL/TL/TLNotifyAll.cs | 31 +- TeleSharp.TL/TL/TLNotifyChats.cs | 31 +- TeleSharp.TL/TL/TLNotifyPeer.cs | 38 +- TeleSharp.TL/TL/TLNotifyUsers.cs | 31 +- TeleSharp.TL/TL/TLNull.cs | 31 +- TeleSharp.TL/TL/TLPeerChannel.cs | 34 +- TeleSharp.TL/TL/TLPeerChat.cs | 34 +- TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs | 31 +- TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs | 31 +- TeleSharp.TL/TL/TLPeerNotifySettings.cs | 62 +- TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs | 31 +- TeleSharp.TL/TL/TLPeerSettings.cs | 45 +- TeleSharp.TL/TL/TLPeerUser.cs | 34 +- TeleSharp.TL/TL/TLPhoto.cs | 68 +- TeleSharp.TL/TL/TLPhotoCachedSize.cs | 60 +- TeleSharp.TL/TL/TLPhotoEmpty.cs | 34 +- TeleSharp.TL/TL/TLPhotoSize.cs | 60 +- TeleSharp.TL/TL/TLPhotoSizeEmpty.cs | 36 +- TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs | 31 +- .../TL/TLPrivacyKeyStatusTimestamp.cs | 31 +- TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs | 31 +- .../TL/TLPrivacyValueAllowContacts.cs | 31 +- TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs | 38 +- TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs | 31 +- .../TL/TLPrivacyValueDisallowContacts.cs | 31 +- .../TL/TLPrivacyValueDisallowUsers.cs | 38 +- TeleSharp.TL/TL/TLReceivedNotifyMessage.cs | 44 +- TeleSharp.TL/TL/TLReplyInlineMarkup.cs | 38 +- TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs | 52 +- TeleSharp.TL/TL/TLReplyKeyboardHide.cs | 45 +- TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs | 63 +- TeleSharp.TL/TL/TLRequestInitConnection.cs | 74 +- TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs | 50 +- TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs | 54 +- TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs | 50 +- .../TL/TLRequestInvokeWithoutUpdates.cs | 48 +- TeleSharp.TL/TL/TLSendMessageCancelAction.cs | 31 +- .../TL/TLSendMessageChooseContactAction.cs | 31 +- .../TL/TLSendMessageGamePlayAction.cs | 31 +- .../TL/TLSendMessageGeoLocationAction.cs | 31 +- .../TL/TLSendMessageRecordAudioAction.cs | 31 +- .../TL/TLSendMessageRecordVideoAction.cs | 31 +- TeleSharp.TL/TL/TLSendMessageTypingAction.cs | 31 +- .../TL/TLSendMessageUploadAudioAction.cs | 34 +- .../TL/TLSendMessageUploadDocumentAction.cs | 34 +- .../TL/TLSendMessageUploadPhotoAction.cs | 34 +- .../TL/TLSendMessageUploadVideoAction.cs | 34 +- TeleSharp.TL/TL/TLStickerPack.cs | 42 +- TeleSharp.TL/TL/TLStickerSet.cs | 100 +- TeleSharp.TL/TL/TLStickerSetCovered.cs | 44 +- TeleSharp.TL/TL/TLStickerSetMultiCovered.cs | 44 +- TeleSharp.TL/TL/TLTopPeer.cs | 44 +- .../TL/TLTopPeerCategoryBotsInline.cs | 31 +- TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs | 31 +- TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs | 31 +- .../TL/TLTopPeerCategoryCorrespondents.cs | 31 +- TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs | 31 +- TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs | 50 +- TeleSharp.TL/TL/TLTrue.cs | 31 +- TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs | 101 +- TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs | 78 +- TeleSharp.TL/TL/TLUpdateBotInlineSend.cs | 89 +- TeleSharp.TL/TL/TLUpdateChannel.cs | 34 +- .../TL/TLUpdateChannelMessageViews.cs | 46 +- .../TL/TLUpdateChannelPinnedMessage.cs | 40 +- TeleSharp.TL/TL/TLUpdateChannelTooLong.cs | 61 +- TeleSharp.TL/TL/TLUpdateChatAdmins.cs | 46 +- TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs | 58 +- .../TL/TLUpdateChatParticipantAdmin.cs | 52 +- .../TL/TLUpdateChatParticipantDelete.cs | 46 +- TeleSharp.TL/TL/TLUpdateChatParticipants.cs | 38 +- TeleSharp.TL/TL/TLUpdateChatUserTyping.cs | 46 +- TeleSharp.TL/TL/TLUpdateConfig.cs | 31 +- TeleSharp.TL/TL/TLUpdateContactLink.cs | 46 +- TeleSharp.TL/TL/TLUpdateContactRegistered.cs | 40 +- TeleSharp.TL/TL/TLUpdateDcOptions.cs | 38 +- .../TL/TLUpdateDeleteChannelMessages.cs | 52 +- TeleSharp.TL/TL/TLUpdateDeleteMessages.cs | 50 +- TeleSharp.TL/TL/TLUpdateDraftMessage.cs | 44 +- TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs | 50 +- TeleSharp.TL/TL/TLUpdateEditMessage.cs | 50 +- .../TL/TLUpdateEncryptedChatTyping.cs | 34 +- .../TL/TLUpdateEncryptedMessagesRead.cs | 46 +- TeleSharp.TL/TL/TLUpdateEncryption.cs | 44 +- .../TL/TLUpdateInlineBotCallbackQuery.cs | 95 +- TeleSharp.TL/TL/TLUpdateMessageID.cs | 40 +- TeleSharp.TL/TL/TLUpdateNewAuthorization.cs | 52 +- TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs | 50 +- .../TL/TLUpdateNewEncryptedMessage.cs | 44 +- TeleSharp.TL/TL/TLUpdateNewMessage.cs | 50 +- TeleSharp.TL/TL/TLUpdateNewStickerSet.cs | 38 +- TeleSharp.TL/TL/TLUpdateNotifySettings.cs | 44 +- TeleSharp.TL/TL/TLUpdatePrivacy.cs | 44 +- TeleSharp.TL/TL/TLUpdatePtsChanged.cs | 31 +- TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs | 40 +- TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs | 40 +- .../TL/TLUpdateReadFeaturedStickers.cs | 31 +- TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs | 56 +- TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs | 56 +- .../TL/TLUpdateReadMessagesContents.cs | 50 +- TeleSharp.TL/TL/TLUpdateRecentStickers.cs | 31 +- TeleSharp.TL/TL/TLUpdateSavedGifs.cs | 31 +- .../TL/TLUpdateServiceNotification.cs | 54 +- TeleSharp.TL/TL/TLUpdateShort.cs | 44 +- TeleSharp.TL/TL/TLUpdateShortChatMessage.cs | 171 +- TeleSharp.TL/TL/TLUpdateShortMessage.cs | 165 +- TeleSharp.TL/TL/TLUpdateShortSentMessage.cs | 101 +- TeleSharp.TL/TL/TLUpdateStickerSets.cs | 31 +- TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs | 50 +- TeleSharp.TL/TL/TLUpdateUserBlocked.cs | 40 +- TeleSharp.TL/TL/TLUpdateUserName.cs | 52 +- TeleSharp.TL/TL/TLUpdateUserPhone.cs | 40 +- TeleSharp.TL/TL/TLUpdateUserPhoto.cs | 52 +- TeleSharp.TL/TL/TLUpdateUserStatus.cs | 40 +- TeleSharp.TL/TL/TLUpdateUserTyping.cs | 40 +- TeleSharp.TL/TL/TLUpdateWebPage.cs | 50 +- TeleSharp.TL/TL/TLUpdates.cs | 62 +- TeleSharp.TL/TL/TLUpdatesCombined.cs | 68 +- TeleSharp.TL/TL/TLUpdatesTooLong.cs | 31 +- TeleSharp.TL/TL/TLUser.cs | 280 +- TeleSharp.TL/TL/TLUserEmpty.cs | 34 +- TeleSharp.TL/TL/TLUserFull.cs | 112 +- TeleSharp.TL/TL/TLUserProfilePhoto.cs | 46 +- TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs | 31 +- TeleSharp.TL/TL/TLUserStatusEmpty.cs | 31 +- TeleSharp.TL/TL/TLUserStatusLastMonth.cs | 31 +- TeleSharp.TL/TL/TLUserStatusLastWeek.cs | 31 +- TeleSharp.TL/TL/TLUserStatusOffline.cs | 34 +- TeleSharp.TL/TL/TLUserStatusOnline.cs | 34 +- TeleSharp.TL/TL/TLUserStatusRecently.cs | 31 +- TeleSharp.TL/TL/TLWallPaper.cs | 52 +- TeleSharp.TL/TL/TLWallPaperSolid.cs | 52 +- TeleSharp.TL/TL/TLWebPage.cs | 249 +- TeleSharp.TL/TL/TLWebPageEmpty.cs | 34 +- TeleSharp.TL/TL/TLWebPagePending.cs | 40 +- .../TL/Updates/TLAbsChannelDifference.cs | 9 +- TeleSharp.TL/TL/Updates/TLAbsDifference.cs | 9 +- .../TL/Updates/TLChannelDifference.cs | 90 +- .../TL/Updates/TLChannelDifferenceEmpty.cs | 67 +- .../TL/Updates/TLChannelDifferenceTooLong.cs | 108 +- TeleSharp.TL/TL/Updates/TLDifference.cs | 68 +- TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs | 40 +- TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs | 68 +- .../Updates/TLRequestGetChannelDifference.cs | 66 +- .../TL/Updates/TLRequestGetDifference.cs | 56 +- TeleSharp.TL/TL/Updates/TLRequestGetState.cs | 42 +- TeleSharp.TL/TL/Updates/TLState.cs | 58 +- TeleSharp.TL/TL/Upload/TLFile.cs | 51 +- TeleSharp.TL/TL/Upload/TLRequestGetFile.cs | 60 +- .../TL/Upload/TLRequestSaveBigFilePart.cs | 62 +- .../TL/Upload/TLRequestSaveFilePart.cs | 56 +- TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs | 48 +- TeleSharp.TL/TL/Users/TLRequestGetUsers.cs | 48 +- TeleSharp.TL/TLContext.cs | 15 +- TeleSharp.TL/TLMethod.cs | 21 +- TeleSharp.TL/TLObject.cs | 20 +- TeleSharp.TL/TLUtils.cs | 92 +- TeleSharp.TL/TLVector.cs | 50 +- TeleSharp.TL/packages.config | 1 + 776 files changed, 14393 insertions(+), 24502 deletions(-) diff --git a/TLSharp.Core/Auth/Authenticator.cs b/TLSharp.Core/Auth/Authenticator.cs index f63523c..3fd47ba 100644 --- a/TLSharp.Core/Auth/Authenticator.cs +++ b/TLSharp.Core/Auth/Authenticator.cs @@ -34,4 +34,4 @@ namespace TLSharp.Core.Auth return step3Response; } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Auth/Step1_PQRequest.cs b/TLSharp.Core/Auth/Step1_PQRequest.cs index 8d61d9a..a853966 100644 --- a/TLSharp.Core/Auth/Step1_PQRequest.cs +++ b/TLSharp.Core/Auth/Step1_PQRequest.cs @@ -17,7 +17,7 @@ namespace TLSharp.Core.Auth public class Step1_PQRequest { - private byte[] nonce; + private readonly byte[] nonce; public Step1_PQRequest() { @@ -52,33 +52,27 @@ namespace TLSharp.Core.Auth const int responseConstructorNumber = 0x05162463; var responseCode = binaryReader.ReadInt32(); if (responseCode != responseConstructorNumber) - { throw new InvalidOperationException($"invalid response code: {responseCode}"); - } var nonceFromServer = binaryReader.ReadBytes(16); if (!nonceFromServer.SequenceEqual(nonce)) - { throw new InvalidOperationException("invalid nonce from server"); - } var serverNonce = binaryReader.ReadBytes(16); - byte[] pqbytes = Serializers.Bytes.read(binaryReader); + var pqbytes = Serializers.Bytes.read(binaryReader); var pq = new BigInteger(1, pqbytes); var vectorId = binaryReader.ReadInt32(); const int vectorConstructorNumber = 0x1cb5c415; if (vectorId != vectorConstructorNumber) - { throw new InvalidOperationException($"Invalid vector constructor number {vectorId}"); - } var fingerprintCount = binaryReader.ReadInt32(); for (var i = 0; i < fingerprintCount; i++) { - byte[] fingerprint = binaryReader.ReadBytes(8); + var fingerprint = binaryReader.ReadBytes(8); fingerprints.Add(fingerprint); } @@ -93,4 +87,4 @@ namespace TLSharp.Core.Auth } } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Auth/Step2_DHExchange.cs b/TLSharp.Core/Auth/Step2_DHExchange.cs index 53b8016..a1dc6b0 100644 --- a/TLSharp.Core/Auth/Step2_DHExchange.cs +++ b/TLSharp.Core/Auth/Step2_DHExchange.cs @@ -31,9 +31,9 @@ namespace TLSharp.Core.Auth byte[] reqDhParamsBytes; - using (MemoryStream pqInnerData = new MemoryStream(255)) + using (var pqInnerData = new MemoryStream(255)) { - using (BinaryWriter pqInnerDataWriter = new BinaryWriter(pqInnerData)) + using (var pqInnerDataWriter = new BinaryWriter(pqInnerData)) { pqInnerDataWriter.Write(0x83c95aec); // pq_inner_data Serializers.Bytes.write(pqInnerDataWriter, pq.ToByteArrayUnsigned()); @@ -45,10 +45,10 @@ namespace TLSharp.Core.Auth byte[] ciphertext = null; byte[] targetFingerprint = null; - foreach (byte[] fingerprint in fingerprints) + foreach (var fingerprint in fingerprints) { ciphertext = RSA.Encrypt(BitConverter.ToString(fingerprint).Replace("-", string.Empty), - pqInnerData.GetBuffer(), 0, (int)pqInnerData.Position); + pqInnerData.GetBuffer(), 0, (int) pqInnerData.Position); if (ciphertext != null) { targetFingerprint = fingerprint; @@ -57,14 +57,13 @@ namespace TLSharp.Core.Auth } if (ciphertext == null) - { throw new InvalidOperationException( - String.Format("not found valid key for fingerprints: {0}", String.Join(", ", fingerprints))); - } + string.Format("not found valid key for fingerprints: {0}", + string.Join(", ", fingerprints))); - using (MemoryStream reqDHParams = new MemoryStream(1024)) + using (var reqDHParams = new MemoryStream(1024)) { - using (BinaryWriter reqDHParamsWriter = new BinaryWriter(reqDHParams)) + using (var reqDHParamsWriter = new BinaryWriter(reqDHParams)) { reqDHParamsWriter.Write(0xd712e4be); // req_dh_params reqDHParamsWriter.Write(nonce); @@ -86,24 +85,19 @@ namespace TLSharp.Core.Auth { byte[] encryptedAnswer; - using (MemoryStream responseStream = new MemoryStream(response, false)) + using (var responseStream = new MemoryStream(response, false)) { - using (BinaryReader responseReader = new BinaryReader(responseStream)) + using (var responseReader = new BinaryReader(responseStream)) { - uint responseCode = responseReader.ReadUInt32(); + var responseCode = responseReader.ReadUInt32(); if (responseCode == 0x79cb045d) - { - // server_DH_params_fail throw new InvalidOperationException("server_DH_params_fail: TODO"); - } if (responseCode != 0xd0e8075c) - { throw new InvalidOperationException($"invalid response code: {responseCode}"); - } - byte[] nonceFromServer = responseReader.ReadBytes(16); + var nonceFromServer = responseReader.ReadBytes(16); // TODO:! /* @@ -115,7 +109,7 @@ namespace TLSharp.Core.Auth */ - byte[] serverNonceFromServer = responseReader.ReadBytes(16); + var serverNonceFromServer = responseReader.ReadBytes(16); // TODO: ! /* @@ -128,7 +122,7 @@ namespace TLSharp.Core.Auth encryptedAnswer = Serializers.Bytes.read(responseReader); - return new Step2_Response() + return new Step2_Response { EncryptedAnswer = encryptedAnswer, ServerNonce = serverNonceFromServer, @@ -139,4 +133,4 @@ namespace TLSharp.Core.Auth } } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs b/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs index 8ba8f5a..637eba2 100644 --- a/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs +++ b/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs @@ -11,7 +11,6 @@ namespace TLSharp.Core.Auth { public AuthKey AuthKey { get; set; } public int TimeOffset { get; set; } - } public class Step3_CompleteDHExchange @@ -23,8 +22,8 @@ namespace TLSharp.Core.Auth public byte[] ToBytes(byte[] nonce, byte[] serverNonce, byte[] newNonce, byte[] encryptedAnswer) { this.newNonce = newNonce; - AESKeyData key = AES.GenerateKeyDataFromNonces(serverNonce, newNonce); - byte[] plaintextAnswer = AES.DecryptAES(key, encryptedAnswer); + var key = AES.GenerateKeyDataFromNonces(serverNonce, newNonce); + var plaintextAnswer = AES.DecryptAES(key, encryptedAnswer); // logger.debug("plaintext answer: {0}", BitConverter.ToString(plaintextAnswer)); @@ -32,32 +31,26 @@ namespace TLSharp.Core.Auth BigInteger dhPrime; BigInteger ga; - using (MemoryStream dhInnerData = new MemoryStream(plaintextAnswer)) + using (var dhInnerData = new MemoryStream(plaintextAnswer)) { - using (BinaryReader dhInnerDataReader = new BinaryReader(dhInnerData)) + using (var dhInnerDataReader = new BinaryReader(dhInnerData)) { - byte[] hashsum = dhInnerDataReader.ReadBytes(20); - uint code = dhInnerDataReader.ReadUInt32(); + var hashsum = dhInnerDataReader.ReadBytes(20); + var code = dhInnerDataReader.ReadUInt32(); if (code != 0xb5890dba) - { throw new InvalidOperationException($"invalid dh_inner_data code: {code}"); - } // logger.debug("valid code"); - byte[] nonceFromServer1 = dhInnerDataReader.ReadBytes(16); + var nonceFromServer1 = dhInnerDataReader.ReadBytes(16); if (!nonceFromServer1.SequenceEqual(nonce)) - { throw new InvalidOperationException("invalid nonce in encrypted answer"); - } // logger.debug("valid nonce"); - byte[] serverNonceFromServer1 = dhInnerDataReader.ReadBytes(16); + var serverNonceFromServer1 = dhInnerDataReader.ReadBytes(16); if (!serverNonceFromServer1.SequenceEqual(serverNonce)) - { throw new InvalidOperationException("invalid server nonce in encrypted answer"); - } // logger.debug("valid server nonce"); @@ -65,39 +58,43 @@ namespace TLSharp.Core.Auth dhPrime = new BigInteger(1, Serializers.Bytes.read(dhInnerDataReader)); ga = new BigInteger(1, Serializers.Bytes.read(dhInnerDataReader)); - int serverTime = dhInnerDataReader.ReadInt32(); - timeOffset = serverTime - (int)(Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds) / 1000); + var serverTime = dhInnerDataReader.ReadInt32(); + timeOffset = serverTime - + (int) (Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)) + .TotalMilliseconds) / 1000); // logger.debug("g: {0}, dhprime: {1}, ga: {2}", g, dhPrime, ga); } } - BigInteger b = new BigInteger(2048, new Random()); - BigInteger gb = BigInteger.ValueOf(g).ModPow(b, dhPrime); + var b = new BigInteger(2048, new Random()); + var gb = BigInteger.ValueOf(g).ModPow(b, dhPrime); _gab = ga.ModPow(b, dhPrime); // logger.debug("gab: {0}", gab); // prepare client dh inner data byte[] clientDHInnerDataBytes; - using (MemoryStream clientDhInnerData = new MemoryStream()) + using (var clientDhInnerData = new MemoryStream()) { - using (BinaryWriter clientDhInnerDataWriter = new BinaryWriter(clientDhInnerData)) + using (var clientDhInnerDataWriter = new BinaryWriter(clientDhInnerData)) { clientDhInnerDataWriter.Write(0x6643b654); // client_dh_inner_data clientDhInnerDataWriter.Write(nonce); clientDhInnerDataWriter.Write(serverNonce); - clientDhInnerDataWriter.Write((long)0); // TODO: retry_id + clientDhInnerDataWriter.Write((long) 0); // TODO: retry_id Serializers.Bytes.write(clientDhInnerDataWriter, gb.ToByteArrayUnsigned()); - using (MemoryStream clientDhInnerDataWithHash = new MemoryStream()) + using (var clientDhInnerDataWithHash = new MemoryStream()) { - using (BinaryWriter clientDhInnerDataWithHashWriter = new BinaryWriter(clientDhInnerDataWithHash)) + using (var clientDhInnerDataWithHashWriter = new BinaryWriter(clientDhInnerDataWithHash)) { using (SHA1 sha1 = new SHA1Managed()) { - clientDhInnerDataWithHashWriter.Write(sha1.ComputeHash(clientDhInnerData.GetBuffer(), 0, (int)clientDhInnerData.Position)); - clientDhInnerDataWithHashWriter.Write(clientDhInnerData.GetBuffer(), 0, (int)clientDhInnerData.Position); + clientDhInnerDataWithHashWriter.Write(sha1.ComputeHash(clientDhInnerData.GetBuffer(), 0, + (int) clientDhInnerData.Position)); + clientDhInnerDataWithHashWriter.Write(clientDhInnerData.GetBuffer(), 0, + (int) clientDhInnerData.Position); clientDHInnerDataBytes = clientDhInnerDataWithHash.ToArray(); } } @@ -108,15 +105,15 @@ namespace TLSharp.Core.Auth // logger.debug("client dh inner data papared len {0}: {1}", clientDHInnerDataBytes.Length, BitConverter.ToString(clientDHInnerDataBytes).Replace("-", "")); // encryption - byte[] clientDhInnerDataEncryptedBytes = AES.EncryptAES(key, clientDHInnerDataBytes); + var clientDhInnerDataEncryptedBytes = AES.EncryptAES(key, clientDHInnerDataBytes); // logger.debug("inner data encrypted {0}: {1}", clientDhInnerDataEncryptedBytes.Length, BitConverter.ToString(clientDhInnerDataEncryptedBytes).Replace("-", "")); // prepare set_client_dh_params byte[] setclientDhParamsBytes; - using (MemoryStream setClientDhParams = new MemoryStream()) + using (var setClientDhParams = new MemoryStream()) { - using (BinaryWriter setClientDhParamsWriter = new BinaryWriter(setClientDhParams)) + using (var setClientDhParamsWriter = new BinaryWriter(setClientDhParams)) { setClientDhParamsWriter.Write(0xf5045f1f); setClientDhParamsWriter.Write(nonce); @@ -134,17 +131,18 @@ namespace TLSharp.Core.Auth public Step3_Response FromBytes(byte[] response) { - using (MemoryStream responseStream = new MemoryStream(response)) + using (var responseStream = new MemoryStream(response)) { - using (BinaryReader responseReader = new BinaryReader(responseStream)) + using (var responseReader = new BinaryReader(responseStream)) { - uint code = responseReader.ReadUInt32(); + var code = responseReader.ReadUInt32(); if (code == 0x3bcbf734) - { // dh_gen_ok - //logger.debug("dh_gen_ok"); + { + // dh_gen_ok + //logger.debug("dh_gen_ok"); - byte[] nonceFromServer = responseReader.ReadBytes(16); + var nonceFromServer = responseReader.ReadBytes(16); // TODO /* if (!nonceFromServer.SequenceEqual(nonce)) @@ -154,7 +152,7 @@ namespace TLSharp.Core.Auth } */ - byte[] serverNonceFromServer = responseReader.ReadBytes(16); + var serverNonceFromServer = responseReader.ReadBytes(16); // TODO: @@ -166,44 +164,33 @@ namespace TLSharp.Core.Auth } */ - byte[] newNonceHash1 = responseReader.ReadBytes(16); + var newNonceHash1 = responseReader.ReadBytes(16); //logger.debug("new nonce hash 1: {0}", BitConverter.ToString(newNonceHash1)); - AuthKey authKey = new AuthKey(_gab); + var authKey = new AuthKey(_gab); - byte[] newNonceHashCalculated = authKey.CalcNewNonceHash(newNonce, 1); + var newNonceHashCalculated = authKey.CalcNewNonceHash(newNonce, 1); if (!newNonceHash1.SequenceEqual(newNonceHashCalculated)) - { throw new InvalidOperationException("invalid new nonce hash"); - } //logger.info("generated new auth key: {0}", gab); //logger.info("saving time offset: {0}", timeOffset); //TelegramSession.Instance.TimeOffset = timeOffset; - return new Step3_Response() + return new Step3_Response { AuthKey = authKey, TimeOffset = timeOffset }; } - else if (code == 0x46dc1fb9) - { // dh_gen_retry + if (code == 0x46dc1fb9) throw new NotImplementedException("dh_gen_retry"); - - } - else if (code == 0xa69dae02) - { - // dh_gen_fail + if (code == 0xa69dae02) throw new NotImplementedException("dh_gen_fail"); - } - else - { - throw new InvalidOperationException($"dh_gen unknown: {code}"); - } + throw new InvalidOperationException($"dh_gen unknown: {code}"); } } } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/AES.cs b/TLSharp.Core/MTProto/Crypto/AES.cs index 0efc746..3020376 100644 --- a/TLSharp.Core/MTProto/Crypto/AES.cs +++ b/TLSharp.Core/MTProto/Crypto/AES.cs @@ -6,24 +6,15 @@ namespace TLSharp.Core.MTProto.Crypto { public class AESKeyData { - private readonly byte[] key; - private readonly byte[] iv; - public AESKeyData(byte[] key, byte[] iv) { - this.key = key; - this.iv = iv; + Key = key; + Iv = iv; } - public byte[] Key - { - get { return key; } - } + public byte[] Key { get; } - public byte[] Iv - { - get { return iv; } - } + public byte[] Iv { get; } } public class AES @@ -36,16 +27,16 @@ namespace TLSharp.Core.MTProto.Crypto newNonce.CopyTo(nonces, 0); serverNonce.CopyTo(nonces, 32); - byte[] hash1 = hash.ComputeHash(nonces); + var hash1 = hash.ComputeHash(nonces); serverNonce.CopyTo(nonces, 0); newNonce.CopyTo(nonces, 16); - byte[] hash2 = hash.ComputeHash(nonces); + var hash2 = hash.ComputeHash(nonces); nonces = new byte[64]; newNonce.CopyTo(nonces, 0); newNonce.CopyTo(nonces, 32); - byte[] hash3 = hash.ComputeHash(nonces); + var hash3 = hash.ComputeHash(nonces); using (var keyBuffer = new MemoryStream(32)) using (var ivBuffer = new MemoryStream(32)) @@ -70,16 +61,16 @@ namespace TLSharp.Core.MTProto.Crypto newNonce.CopyTo(nonces, 0); serverNonce.CopyTo(nonces, 32); - byte[] hash1 = hash.ComputeHash(nonces); + var hash1 = hash.ComputeHash(nonces); serverNonce.CopyTo(nonces, 0); newNonce.CopyTo(nonces, 16); - byte[] hash2 = hash.ComputeHash(nonces); + var hash2 = hash.ComputeHash(nonces); nonces = new byte[64]; newNonce.CopyTo(nonces, 0); newNonce.CopyTo(nonces, 32); - byte[] hash3 = hash.ComputeHash(nonces); + var hash3 = hash.ComputeHash(nonces); using (var keyBuffer = new MemoryStream(32)) using (var ivBuffer = new MemoryStream(32)) @@ -114,27 +105,23 @@ namespace TLSharp.Core.MTProto.Crypto Array.Copy(iv, 0, iv1, 0, iv1.Length); Array.Copy(iv, iv1.Length, iv2, 0, iv2.Length); - AesEngine aes = new AesEngine(); + var aes = new AesEngine(); aes.Init(false, key); - byte[] plaintext = new byte[ciphertext.Length]; - int blocksCount = ciphertext.Length / 16; + var plaintext = new byte[ciphertext.Length]; + var blocksCount = ciphertext.Length / 16; - byte[] ciphertextBlock = new byte[16]; - byte[] plaintextBlock = new byte[16]; - for (int blockIndex = 0; blockIndex < blocksCount; blockIndex++) + var ciphertextBlock = new byte[16]; + var plaintextBlock = new byte[16]; + for (var blockIndex = 0; blockIndex < blocksCount; blockIndex++) { - for (int i = 0; i < 16; i++) - { - ciphertextBlock[i] = (byte)(ciphertext[blockIndex * 16 + i] ^ iv2[i]); - } + for (var i = 0; i < 16; i++) + ciphertextBlock[i] = (byte) (ciphertext[blockIndex * 16 + i] ^ iv2[i]); aes.ProcessBlock(ciphertextBlock, 0, plaintextBlock, 0); - for (int i = 0; i < 16; i++) - { + for (var i = 0; i < 16; i++) plaintextBlock[i] ^= iv1[i]; - } Array.Copy(ciphertext, blockIndex * 16, iv1, 0, 16); Array.Copy(plaintextBlock, 0, iv2, 0, 16); @@ -147,18 +134,15 @@ namespace TLSharp.Core.MTProto.Crypto public static byte[] EncryptIGE(byte[] originPlaintext, byte[] key, byte[] iv) { - byte[] plaintext; - using (MemoryStream plaintextBuffer = new MemoryStream(originPlaintext.Length + 40)) + using (var plaintextBuffer = new MemoryStream(originPlaintext.Length + 40)) { //using(SHA1 hash = new SHA1Managed()) { //byte[] hashsum = hash.ComputeHash(originPlaintext); //plaintextBuffer.Write(hashsum, 0, hashsum.Length); plaintextBuffer.Write(originPlaintext, 0, originPlaintext.Length); while (plaintextBuffer.Position % 16 != 0) - { plaintextBuffer.WriteByte(0); // TODO: random padding - } plaintext = plaintextBuffer.ToArray(); } @@ -168,24 +152,22 @@ namespace TLSharp.Core.MTProto.Crypto Array.Copy(iv, 0, iv1, 0, iv1.Length); Array.Copy(iv, iv1.Length, iv2, 0, iv2.Length); - AesEngine aes = new AesEngine(); + var aes = new AesEngine(); aes.Init(true, key); - int blocksCount = plaintext.Length / 16; - byte[] ciphertext = new byte[plaintext.Length]; + var blocksCount = plaintext.Length / 16; + var ciphertext = new byte[plaintext.Length]; - byte[] ciphertextBlock = new byte[16]; - byte[] plaintextBlock = new byte[16]; - for (int blockIndex = 0; blockIndex < blocksCount; blockIndex++) + var ciphertextBlock = new byte[16]; + var plaintextBlock = new byte[16]; + for (var blockIndex = 0; blockIndex < blocksCount; blockIndex++) { Array.Copy(plaintext, 16 * blockIndex, plaintextBlock, 0, 16); //logger.info("plaintext block: {0} xor {1}", BitConverter.ToString(plaintextBlock).Replace("-", ""), BitConverter.ToString(iv1).Replace("-", "")); - for (int i = 0; i < 16; i++) - { + for (var i = 0; i < 16; i++) plaintextBlock[i] ^= iv1[i]; - } //logger.info("xored plaintext: {0}", BitConverter.ToString(plaintextBlock).Replace("-", "")); @@ -193,10 +175,8 @@ namespace TLSharp.Core.MTProto.Crypto //logger.info("encrypted plaintext: {0} xor {1}", BitConverter.ToString(ciphertextBlock).Replace("-", ""), BitConverter.ToString(iv2).Replace("-", "")); - for (int i = 0; i < 16; i++) - { + for (var i = 0; i < 16; i++) ciphertextBlock[i] ^= iv2[i]; - } //logger.info("xored ciphertext: {0}", BitConverter.ToString(ciphertextBlock).Replace("-", "")); @@ -212,12 +192,10 @@ namespace TLSharp.Core.MTProto.Crypto public static byte[] XOR(byte[] buffer1, byte[] buffer2) { var result = new byte[buffer1.Length]; - for (int i = 0; i < buffer1.Length; i++) - result[i] = (byte)(buffer1[i] ^ buffer2[i]); + for (var i = 0; i < buffer1.Length; i++) + result[i] = (byte) (buffer1[i] ^ buffer2[i]); return result; } - - } @@ -227,11 +205,13 @@ namespace TLSharp.Core.MTProto.Crypto { // The S box private const uint m1 = 0x80808080; + private const uint m2 = 0x7f7f7f7f; private const uint m3 = 0x0000001b; private const int BLOCK_SIZE = 16; - private static readonly byte[] S = { + private static readonly byte[] S = + { 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, @@ -267,7 +247,8 @@ namespace TLSharp.Core.MTProto.Crypto }; // The inverse S-box - private static readonly byte[] Si = { + private static readonly byte[] Si = + { 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, @@ -303,13 +284,15 @@ namespace TLSharp.Core.MTProto.Crypto }; // vector used in calculating key schedule (powers of x in GF(256)) - private static readonly byte[] rcon = { + private static readonly byte[] rcon = + { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 }; // precomputation tables of calculations for rounds - private static readonly uint[] T0 = { + private static readonly uint[] T0 = + { 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, 0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56, 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, @@ -364,7 +347,8 @@ namespace TLSharp.Core.MTProto.Crypto 0x3a16162c }; - private static readonly uint[] Tinv0 = { + private static readonly uint[] Tinv0 = + { 0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a, 0xcb6bab3b, 0xf1459d1f, 0xab58faac, 0x9303e34b, 0x55fa3020, 0xf66d76ad, 0x9176cc88, 0x254c02f5, 0xfcd7e54f, 0xd7cb2ac5, 0x80443526, @@ -420,19 +404,13 @@ namespace TLSharp.Core.MTProto.Crypto }; private uint C0, C1, C2, C3; + private bool forEncryption; private int ROUNDS; private uint[,] WorkingKey; - private bool forEncryption; - public string AlgorithmName - { - get { return "AES"; } - } + public string AlgorithmName => "AES"; - public bool IsPartialBlockOkay - { - get { return false; } - } + public bool IsPartialBlockOkay => false; private uint Shift( uint r, @@ -460,10 +438,10 @@ namespace TLSharp.Core.MTProto.Crypto private uint Inv_Mcol( uint x) { - uint f2 = FFmulX(x); - uint f4 = FFmulX(f2); - uint f8 = FFmulX(f4); - uint f9 = x ^ f8; + var f2 = FFmulX(x); + var f4 = FFmulX(f2); + var f8 = FFmulX(f4); + var f9 = x ^ f8; return f2 ^ f4 ^ f8 ^ Shift(f2 ^ f9, 8) ^ Shift(f4 ^ f9, 16) ^ Shift(f9, 24); } @@ -472,9 +450,9 @@ namespace TLSharp.Core.MTProto.Crypto uint x) { return S[x & 255] - | (((uint)S[(x >> 8) & 255]) << 8) - | (((uint)S[(x >> 16) & 255]) << 16) - | (((uint)S[(x >> 24) & 255]) << 24); + | ((uint) S[(x >> 8) & 255] << 8) + | ((uint) S[(x >> 16) & 255] << 16) + | ((uint) S[(x >> 24) & 255] << 24); } /** @@ -488,10 +466,10 @@ namespace TLSharp.Core.MTProto.Crypto byte[] key, bool forEncryption) { - int KC = key.Length / 4; // key length in words + var KC = key.Length / 4; // key length in words int t; - if ((KC != 4) && (KC != 6) && (KC != 8)) + if (KC != 4 && KC != 6 && KC != 8) throw new ArgumentException("Key length not 128/192/256 bits."); ROUNDS = KC + 6; // This is not always true for the generalized Rijndael that allows larger block sizes @@ -502,7 +480,7 @@ namespace TLSharp.Core.MTProto.Crypto // t = 0; - for (int i = 0; i < key.Length; t++) + for (var i = 0; i < key.Length; t++) { W[t >> 2, t & 3] = Pack.LE_To_UInt32(key, i); i += 4; @@ -512,32 +490,22 @@ namespace TLSharp.Core.MTProto.Crypto // while not enough round key material calculated // calculate new values // - int k = (ROUNDS + 1) << 2; - for (int i = KC; (i < k); i++) + var k = (ROUNDS + 1) << 2; + for (var i = KC; i < k; i++) { - uint temp = W[(i - 1) >> 2, (i - 1) & 3]; - if ((i % KC) == 0) - { - temp = SubWord(Shift(temp, 8)) ^ rcon[(i / KC) - 1]; - } - else if ((KC > 6) && ((i % KC) == 4)) - { + var temp = W[(i - 1) >> 2, (i - 1) & 3]; + if (i % KC == 0) + temp = SubWord(Shift(temp, 8)) ^ rcon[i / KC - 1]; + else if (KC > 6 && i % KC == 4) temp = SubWord(temp); - } W[i >> 2, i & 3] = W[(i - KC) >> 2, (i - KC) & 3] ^ temp; } if (!forEncryption) - { - for (int j = 1; j < ROUNDS; j++) - { - for (int i = 0; i < 4; i++) - { - W[j, i] = Inv_Mcol(W[j, i]); - } - } - } + for (var j = 1; j < ROUNDS; j++) + for (var i = 0; i < 4; i++) + W[j, i] = Inv_Mcol(W[j, i]); return W; } @@ -556,29 +524,19 @@ namespace TLSharp.Core.MTProto.Crypto public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff) { if (WorkingKey == null) - { throw new InvalidOperationException("AES engine not initialised"); - } - if ((inOff + (32 / 2)) > input.Length) - { + if (inOff + 32 / 2 > input.Length) throw new InvalidOperationException("input buffer too short"); - } - if ((outOff + (32 / 2)) > output.Length) - { + if (outOff + 32 / 2 > output.Length) throw new InvalidOperationException("output buffer too short"); - } UnPackBlock(input, inOff); if (forEncryption) - { EncryptBlock(WorkingKey); - } - else { - DecryptBlock(WorkingKey); - } + else DecryptBlock(WorkingKey); PackBlock(output, outOff); @@ -650,14 +608,14 @@ namespace TLSharp.Core.MTProto.Crypto // the final round's table is a simple function of S so we don't use a whole other four tables for it - C0 = S[r0 & 255] ^ (((uint)S[(r1 >> 8) & 255]) << 8) ^ (((uint)S[(r2 >> 16) & 255]) << 16) ^ - (((uint)S[(r3 >> 24) & 255]) << 24) ^ KW[r, 0]; - C1 = S[r1 & 255] ^ (((uint)S[(r2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ - (((uint)S[(r0 >> 24) & 255]) << 24) ^ KW[r, 1]; - C2 = S[r2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(r0 >> 16) & 255]) << 16) ^ - (((uint)S[(r1 >> 24) & 255]) << 24) ^ KW[r, 2]; - C3 = S[r3 & 255] ^ (((uint)S[(r0 >> 8) & 255]) << 8) ^ (((uint)S[(r1 >> 16) & 255]) << 16) ^ - (((uint)S[(r2 >> 24) & 255]) << 24) ^ KW[r, 3]; + C0 = S[r0 & 255] ^ ((uint) S[(r1 >> 8) & 255] << 8) ^ ((uint) S[(r2 >> 16) & 255] << 16) ^ + ((uint) S[(r3 >> 24) & 255] << 24) ^ KW[r, 0]; + C1 = S[r1 & 255] ^ ((uint) S[(r2 >> 8) & 255] << 8) ^ ((uint) S[(r3 >> 16) & 255] << 16) ^ + ((uint) S[(r0 >> 24) & 255] << 24) ^ KW[r, 1]; + C2 = S[r2 & 255] ^ ((uint) S[(r3 >> 8) & 255] << 8) ^ ((uint) S[(r0 >> 16) & 255] << 16) ^ + ((uint) S[(r1 >> 24) & 255] << 24) ^ KW[r, 2]; + C3 = S[r3 & 255] ^ ((uint) S[(r0 >> 8) & 255] << 8) ^ ((uint) S[(r1 >> 16) & 255] << 16) ^ + ((uint) S[(r2 >> 24) & 255] << 24) ^ KW[r, 3]; } private void DecryptBlock( @@ -702,14 +660,14 @@ namespace TLSharp.Core.MTProto.Crypto // the final round's table is a simple function of Si so we don't use a whole other four tables for it - C0 = Si[r0 & 255] ^ (((uint)Si[(r3 >> 8) & 255]) << 8) ^ (((uint)Si[(r2 >> 16) & 255]) << 16) ^ - (((uint)Si[(r1 >> 24) & 255]) << 24) ^ KW[0, 0]; - C1 = Si[r1 & 255] ^ (((uint)Si[(r0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ - (((uint)Si[(r2 >> 24) & 255]) << 24) ^ KW[0, 1]; - C2 = Si[r2 & 255] ^ (((uint)Si[(r1 >> 8) & 255]) << 8) ^ (((uint)Si[(r0 >> 16) & 255]) << 16) ^ - (((uint)Si[(r3 >> 24) & 255]) << 24) ^ KW[0, 2]; - C3 = Si[r3 & 255] ^ (((uint)Si[(r2 >> 8) & 255]) << 8) ^ (((uint)Si[(r1 >> 16) & 255]) << 16) ^ - (((uint)Si[(r0 >> 24) & 255]) << 24) ^ KW[0, 3]; + C0 = Si[r0 & 255] ^ ((uint) Si[(r3 >> 8) & 255] << 8) ^ ((uint) Si[(r2 >> 16) & 255] << 16) ^ + ((uint) Si[(r1 >> 24) & 255] << 24) ^ KW[0, 0]; + C1 = Si[r1 & 255] ^ ((uint) Si[(r0 >> 8) & 255] << 8) ^ ((uint) Si[(r3 >> 16) & 255] << 16) ^ + ((uint) Si[(r2 >> 24) & 255] << 24) ^ KW[0, 1]; + C2 = Si[r2 & 255] ^ ((uint) Si[(r1 >> 8) & 255] << 8) ^ ((uint) Si[(r0 >> 16) & 255] << 16) ^ + ((uint) Si[(r3 >> 24) & 255] << 24) ^ KW[0, 2]; + C3 = Si[r3 & 255] ^ ((uint) Si[(r2 >> 8) & 255] << 8) ^ ((uint) Si[(r1 >> 16) & 255] << 16) ^ + ((uint) Si[(r0 >> 24) & 255] << 24) ^ KW[0, 3]; } } @@ -722,122 +680,122 @@ namespace TLSharp.Core.MTProto.Crypto internal static void UInt32_To_BE(uint n, byte[] bs) { - bs[0] = (byte)(n >> 24); - bs[1] = (byte)(n >> 16); - bs[2] = (byte)(n >> 8); - bs[3] = (byte)(n); + bs[0] = (byte) (n >> 24); + bs[1] = (byte) (n >> 16); + bs[2] = (byte) (n >> 8); + bs[3] = (byte) n; } internal static void UInt32_To_BE(uint n, byte[] bs, int off) { - bs[off] = (byte)(n >> 24); - bs[++off] = (byte)(n >> 16); - bs[++off] = (byte)(n >> 8); - bs[++off] = (byte)(n); + bs[off] = (byte) (n >> 24); + bs[++off] = (byte) (n >> 16); + bs[++off] = (byte) (n >> 8); + bs[++off] = (byte) n; } internal static uint BE_To_UInt32(byte[] bs) { - uint n = (uint)bs[0] << 24; - n |= (uint)bs[1] << 16; - n |= (uint)bs[2] << 8; + var n = (uint) bs[0] << 24; + n |= (uint) bs[1] << 16; + n |= (uint) bs[2] << 8; n |= bs[3]; return n; } internal static uint BE_To_UInt32(byte[] bs, int off) { - uint n = (uint)bs[off] << 24; - n |= (uint)bs[++off] << 16; - n |= (uint)bs[++off] << 8; + var n = (uint) bs[off] << 24; + n |= (uint) bs[++off] << 16; + n |= (uint) bs[++off] << 8; n |= bs[++off]; return n; } internal static ulong BE_To_UInt64(byte[] bs) { - uint hi = BE_To_UInt32(bs); - uint lo = BE_To_UInt32(bs, 4); - return ((ulong)hi << 32) | lo; + var hi = BE_To_UInt32(bs); + var lo = BE_To_UInt32(bs, 4); + return ((ulong) hi << 32) | lo; } internal static ulong BE_To_UInt64(byte[] bs, int off) { - uint hi = BE_To_UInt32(bs, off); - uint lo = BE_To_UInt32(bs, off + 4); - return ((ulong)hi << 32) | lo; + var hi = BE_To_UInt32(bs, off); + var lo = BE_To_UInt32(bs, off + 4); + return ((ulong) hi << 32) | lo; } internal static void UInt64_To_BE(ulong n, byte[] bs) { - UInt32_To_BE((uint)(n >> 32), bs); - UInt32_To_BE((uint)(n), bs, 4); + UInt32_To_BE((uint) (n >> 32), bs); + UInt32_To_BE((uint) n, bs, 4); } internal static void UInt64_To_BE(ulong n, byte[] bs, int off) { - UInt32_To_BE((uint)(n >> 32), bs, off); - UInt32_To_BE((uint)(n), bs, off + 4); + UInt32_To_BE((uint) (n >> 32), bs, off); + UInt32_To_BE((uint) n, bs, off + 4); } internal static void UInt32_To_LE(uint n, byte[] bs) { - bs[0] = (byte)(n); - bs[1] = (byte)(n >> 8); - bs[2] = (byte)(n >> 16); - bs[3] = (byte)(n >> 24); + bs[0] = (byte) n; + bs[1] = (byte) (n >> 8); + bs[2] = (byte) (n >> 16); + bs[3] = (byte) (n >> 24); } internal static void UInt32_To_LE(uint n, byte[] bs, int off) { - bs[off] = (byte)(n); - bs[++off] = (byte)(n >> 8); - bs[++off] = (byte)(n >> 16); - bs[++off] = (byte)(n >> 24); + bs[off] = (byte) n; + bs[++off] = (byte) (n >> 8); + bs[++off] = (byte) (n >> 16); + bs[++off] = (byte) (n >> 24); } internal static uint LE_To_UInt32(byte[] bs) { uint n = bs[0]; - n |= (uint)bs[1] << 8; - n |= (uint)bs[2] << 16; - n |= (uint)bs[3] << 24; + n |= (uint) bs[1] << 8; + n |= (uint) bs[2] << 16; + n |= (uint) bs[3] << 24; return n; } internal static uint LE_To_UInt32(byte[] bs, int off) { uint n = bs[off]; - n |= (uint)bs[++off] << 8; - n |= (uint)bs[++off] << 16; - n |= (uint)bs[++off] << 24; + n |= (uint) bs[++off] << 8; + n |= (uint) bs[++off] << 16; + n |= (uint) bs[++off] << 24; return n; } internal static ulong LE_To_UInt64(byte[] bs) { - uint lo = LE_To_UInt32(bs); - uint hi = LE_To_UInt32(bs, 4); - return ((ulong)hi << 32) | lo; + var lo = LE_To_UInt32(bs); + var hi = LE_To_UInt32(bs, 4); + return ((ulong) hi << 32) | lo; } internal static ulong LE_To_UInt64(byte[] bs, int off) { - uint lo = LE_To_UInt32(bs, off); - uint hi = LE_To_UInt32(bs, off + 4); - return ((ulong)hi << 32) | lo; + var lo = LE_To_UInt32(bs, off); + var hi = LE_To_UInt32(bs, off + 4); + return ((ulong) hi << 32) | lo; } internal static void UInt64_To_LE(ulong n, byte[] bs) { - UInt32_To_LE((uint)(n), bs); - UInt32_To_LE((uint)(n >> 32), bs, 4); + UInt32_To_LE((uint) n, bs); + UInt32_To_LE((uint) (n >> 32), bs, 4); } internal static void UInt64_To_LE(ulong n, byte[] bs, int off) { - UInt32_To_LE((uint)(n), bs, off); - UInt32_To_LE((uint)(n >> 32), bs, off + 4); + UInt32_To_LE((uint) n, bs, off); + UInt32_To_LE((uint) (n >> 32), bs, off + 4); } } } \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/AuthKey.cs b/TLSharp.Core/MTProto/Crypto/AuthKey.cs index 7d568c4..aab5019 100644 --- a/TLSharp.Core/MTProto/Crypto/AuthKey.cs +++ b/TLSharp.Core/MTProto/Crypto/AuthKey.cs @@ -6,21 +6,20 @@ namespace TLSharp.Core.MTProto.Crypto { public class AuthKey { - private byte[] key; - private ulong keyId; - private ulong auxHash; + private readonly ulong auxHash; + public AuthKey(BigInteger gab) { - key = gab.ToByteArrayUnsigned(); + Data = gab.ToByteArrayUnsigned(); using (SHA1 hash = new SHA1Managed()) { - using (MemoryStream hashStream = new MemoryStream(hash.ComputeHash(key), false)) + using (var hashStream = new MemoryStream(hash.ComputeHash(Data), false)) { - using (BinaryReader hashReader = new BinaryReader(hashStream)) + using (var hashReader = new BinaryReader(hashStream)) { auxHash = hashReader.ReadUInt64(); hashReader.ReadBytes(4); - keyId = hashReader.ReadUInt64(); + Id = hashReader.ReadUInt64(); } } } @@ -28,34 +27,38 @@ namespace TLSharp.Core.MTProto.Crypto public AuthKey(byte[] data) { - key = data; + Data = data; using (SHA1 hash = new SHA1Managed()) { - using (MemoryStream hashStream = new MemoryStream(hash.ComputeHash(key), false)) + using (var hashStream = new MemoryStream(hash.ComputeHash(Data), false)) { - using (BinaryReader hashReader = new BinaryReader(hashStream)) + using (var hashReader = new BinaryReader(hashStream)) { auxHash = hashReader.ReadUInt64(); hashReader.ReadBytes(4); - keyId = hashReader.ReadUInt64(); + Id = hashReader.ReadUInt64(); } } } } + public byte[] Data { get; } + + public ulong Id { get; } + public byte[] CalcNewNonceHash(byte[] newNonce, int number) { - using (MemoryStream buffer = new MemoryStream(100)) + using (var buffer = new MemoryStream(100)) { - using (BinaryWriter bufferWriter = new BinaryWriter(buffer)) + using (var bufferWriter = new BinaryWriter(buffer)) { bufferWriter.Write(newNonce); - bufferWriter.Write((byte)number); + bufferWriter.Write((byte) number); bufferWriter.Write(auxHash); using (SHA1 sha1 = new SHA1Managed()) { - byte[] hash = sha1.ComputeHash(buffer.GetBuffer(), 0, (int)buffer.Position); - byte[] newNonceHash = new byte[16]; + var hash = sha1.ComputeHash(buffer.GetBuffer(), 0, (int) buffer.Position); + var newNonceHash = new byte[16]; Array.Copy(hash, 4, newNonceHash, 0, 16); return newNonceHash; } @@ -63,25 +66,9 @@ namespace TLSharp.Core.MTProto.Crypto } } - public byte[] Data - { - get - { - return key; - } - } - - public ulong Id - { - get - { - return keyId; - } - } - public override string ToString() { - return string.Format("(Key: {0}, KeyId: {1}, AuxHash: {2})", key, keyId, auxHash); + return string.Format("(Key: {0}, KeyId: {1}, AuxHash: {2})", Data, Id, auxHash); } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/BigInteger.cs b/TLSharp.Core/MTProto/Crypto/BigInteger.cs index e09a3b7..a147275 100644 --- a/TLSharp.Core/MTProto/Crypto/BigInteger.cs +++ b/TLSharp.Core/MTProto/Crypto/BigInteger.cs @@ -8,10 +8,17 @@ using System.Text; namespace TLSharp.Core.MTProto.Crypto { #if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT) + [Serializable] #endif public class BigInteger { + private const long IMASK = 0xffffffffL; + + private const int BitsPerByte = 8; + private const int BitsPerInt = 32; + + private const int BytesPerInt = 4; // The primes b/w 2 and ~2^10 /* 3 5 7 11 13 17 19 23 29 @@ -35,76 +42,74 @@ namespace TLSharp.Core.MTProto.Crypto */ // Each list has a product < 2^31 - private static readonly int[][] primeLists = new int[][] + private static readonly int[][] primeLists = { - new int[]{ 3, 5, 7, 11, 13, 17, 19, 23 }, - new int[]{ 29, 31, 37, 41, 43 }, - new int[]{ 47, 53, 59, 61, 67 }, - new int[]{ 71, 73, 79, 83 }, - new int[]{ 89, 97, 101, 103 }, + new[] {3, 5, 7, 11, 13, 17, 19, 23}, + new[] {29, 31, 37, 41, 43}, + new[] {47, 53, 59, 61, 67}, + new[] {71, 73, 79, 83}, + new[] {89, 97, 101, 103}, - new int[]{ 107, 109, 113, 127 }, - new int[]{ 131, 137, 139, 149 }, - new int[]{ 151, 157, 163, 167 }, - new int[]{ 173, 179, 181, 191 }, - new int[]{ 193, 197, 199, 211 }, + new[] {107, 109, 113, 127}, + new[] {131, 137, 139, 149}, + new[] {151, 157, 163, 167}, + new[] {173, 179, 181, 191}, + new[] {193, 197, 199, 211}, - new int[]{ 223, 227, 229 }, - new int[]{ 233, 239, 241 }, - new int[]{ 251, 257, 263 }, - new int[]{ 269, 271, 277 }, - new int[]{ 281, 283, 293 }, + new[] {223, 227, 229}, + new[] {233, 239, 241}, + new[] {251, 257, 263}, + new[] {269, 271, 277}, + new[] {281, 283, 293}, - new int[]{ 307, 311, 313 }, - new int[]{ 317, 331, 337 }, - new int[]{ 347, 349, 353 }, - new int[]{ 359, 367, 373 }, - new int[]{ 379, 383, 389 }, + new[] {307, 311, 313}, + new[] {317, 331, 337}, + new[] {347, 349, 353}, + new[] {359, 367, 373}, + new[] {379, 383, 389}, - new int[]{ 397, 401, 409 }, - new int[]{ 419, 421, 431 }, - new int[]{ 433, 439, 443 }, - new int[]{ 449, 457, 461 }, - new int[]{ 463, 467, 479 }, + new[] {397, 401, 409}, + new[] {419, 421, 431}, + new[] {433, 439, 443}, + new[] {449, 457, 461}, + new[] {463, 467, 479}, - new int[]{ 487, 491, 499 }, - new int[]{ 503, 509, 521 }, - new int[]{ 523, 541, 547 }, - new int[]{ 557, 563, 569 }, - new int[]{ 571, 577, 587 }, + new[] {487, 491, 499}, + new[] {503, 509, 521}, + new[] {523, 541, 547}, + new[] {557, 563, 569}, + new[] {571, 577, 587}, - new int[]{ 593, 599, 601 }, - new int[]{ 607, 613, 617 }, - new int[]{ 619, 631, 641 }, - new int[]{ 643, 647, 653 }, - new int[]{ 659, 661, 673 }, + new[] {593, 599, 601}, + new[] {607, 613, 617}, + new[] {619, 631, 641}, + new[] {643, 647, 653}, + new[] {659, 661, 673}, - new int[]{ 677, 683, 691 }, - new int[]{ 701, 709, 719 }, - new int[]{ 727, 733, 739 }, - new int[]{ 743, 751, 757 }, - new int[]{ 761, 769, 773 }, + new[] {677, 683, 691}, + new[] {701, 709, 719}, + new[] {727, 733, 739}, + new[] {743, 751, 757}, + new[] {761, 769, 773}, - new int[]{ 787, 797, 809 }, - new int[]{ 811, 821, 823 }, - new int[]{ 827, 829, 839 }, - new int[]{ 853, 857, 859 }, - new int[]{ 863, 877, 881 }, + new[] {787, 797, 809}, + new[] {811, 821, 823}, + new[] {827, 829, 839}, + new[] {853, 857, 859}, + new[] {863, 877, 881}, - new int[]{ 883, 887, 907 }, - new int[]{ 911, 919, 929 }, - new int[]{ 937, 941, 947 }, - new int[]{ 953, 967, 971 }, - new int[]{ 977, 983, 991 }, + new[] {883, 887, 907}, + new[] {911, 919, 929}, + new[] {937, 941, 947}, + new[] {953, 967, 971}, + new[] {977, 983, 991}, - new int[]{ 997, 1009, 1013 }, - new int[]{ 1019, 1021, 1031 }, + new[] {997, 1009, 1013}, + new[] {1019, 1021, 1031} }; private static readonly int[] primeProducts; - - private const long IMASK = 0xffffffffL; - private static readonly ulong UIMASK = (ulong)IMASK; + private static readonly ulong UIMASK = IMASK; private static readonly int[] ZeroMagnitude = new int[0]; private static readonly byte[] ZeroEncoding = new byte[0]; @@ -129,38 +134,41 @@ namespace TLSharp.Core.MTProto.Crypto private static readonly Random RandomSource = new Random(); - private const int BitsPerByte = 8; - private const int BitsPerInt = 32; - private const int BytesPerInt = 4; + private static readonly byte[] rndMask = {255, 127, 63, 31, 15, 7, 3, 1}; + + private static readonly byte[] bitCounts = + { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, + 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, + 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, + 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, + 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, + 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, + 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, + 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, + 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, + 6, 6, 7, 6, 7, 7, 8 + }; + + private int[] magnitude; // array of ints with [0] being the most significant + private long mQuote = -1L; // -m^(-1) mod b, b = 2^32 (see Montgomery mult.) + private int nBitLength = -1; // cache calcBitLength() value + private int nBits = -1; // cache BitCount() value static BigInteger() { primeProducts = new int[primeLists.Length]; - for (int i = 0; i < primeLists.Length; ++i) + for (var i = 0; i < primeLists.Length; ++i) { - int[] primeList = primeLists[i]; - int product = 1; - for (int j = 0; j < primeList.Length; ++j) - { + var primeList = primeLists[i]; + var product = 1; + for (var j = 0; j < primeList.Length; ++j) product *= primeList[j]; - } primeProducts[i] = product; } } - private int sign; // -1 means -ve; +1 means +ve; 0 means 0; - private int[] magnitude; // array of ints with [0] being the most significant - private int nBits = -1; // cache BitCount() value - private int nBitLength = -1; // cache calcBitLength() value - private long mQuote = -1L; // -m^(-1) mod b, b = 2^32 (see Montgomery mult.) - - private static int GetByteLength( - int nBits) - { - return (nBits + BitsPerByte - 1) / BitsPerByte; - } - private BigInteger() { } @@ -172,34 +180,35 @@ namespace TLSharp.Core.MTProto.Crypto { if (checkMag) { - int i = 0; + var i = 0; while (i < mag.Length && mag[i] == 0) - { ++i; - } if (i == mag.Length) { // this.sign = 0; - this.magnitude = ZeroMagnitude; + magnitude = ZeroMagnitude; } - else { - this.sign = signum; + else + { + SignValue = signum; if (i == 0) { - this.magnitude = mag; + magnitude = mag; } - else { + else + { // strip leading 0 words - this.magnitude = new int[mag.Length - i]; - Array.Copy(mag, i, this.magnitude, 0, this.magnitude.Length); + magnitude = new int[mag.Length - i]; + Array.Copy(mag, i, magnitude, 0, magnitude.Length); } } } - else { - this.sign = signum; - this.magnitude = mag; + else + { + SignValue = signum; + magnitude = mag; } } @@ -249,28 +258,26 @@ namespace TLSharp.Core.MTProto.Crypto } - int index = 0; - sign = 1; + var index = 0; + SignValue = 1; if (str[0] == '-') { if (str.Length == 1) throw new FormatException("Zero length BigInteger"); - sign = -1; + SignValue = -1; index = 1; } // strip leading zeros from the string str - while (index < str.Length && Int32.Parse(str[index].ToString(), style) == 0) - { + while (index < str.Length && int.Parse(str[index].ToString(), style) == 0) index++; - } if (index >= str.Length) { // zero value - we're done - sign = 0; + SignValue = 0; magnitude = ZeroMagnitude; return; } @@ -281,18 +288,17 @@ namespace TLSharp.Core.MTProto.Crypto // storage in one hit?, then Generate the magnitude in one hit too? ////// - BigInteger b = Zero; + var b = Zero; - int next = index + chunk; + var next = index + chunk; if (next <= str.Length) - { do { - string s = str.Substring(index, chunk); - ulong i = ulong.Parse(s, style); - BigInteger bi = createUValueOf(i); + var s = str.Substring(index, chunk); + var i = ulong.Parse(s, style); + var bi = createUValueOf(i); switch (radix) { @@ -316,37 +322,26 @@ namespace TLSharp.Core.MTProto.Crypto index = next; next += chunk; - } - while (next <= str.Length); - } + } while (next <= str.Length); if (index < str.Length) { - string s = str.Substring(index); - ulong i = ulong.Parse(s, style); - BigInteger bi = createUValueOf(i); + var s = str.Substring(index); + var i = ulong.Parse(s, style); + var bi = createUValueOf(i); - if (b.sign > 0) + if (b.SignValue > 0) { if (radix == 2) - { - // NB: Can't reach here since we are parsing one char at a time Debug.Assert(false); - - // TODO Parse all bits at once - // b = b.ShiftLeft(s.Length); - } else if (radix == 16) - { b = b.ShiftLeft(s.Length << 2); - } - else { - b = b.Multiply(r.Pow(s.Length)); - } + else b = b.Multiply(r.Pow(s.Length)); b = b.Add(bi); } - else { + else + { b = bi; } } @@ -380,108 +375,49 @@ namespace TLSharp.Core.MTProto.Crypto throw new FormatException("Zero length BigInteger"); // TODO Move this processing into MakeMagnitude (provide sign argument) - if ((sbyte)bytes[offset] < 0) + if ((sbyte) bytes[offset] < 0) { - this.sign = -1; + SignValue = -1; - int end = offset + length; + var end = offset + length; int iBval; // strip leading sign bytes - for (iBval = offset; iBval < end && ((sbyte)bytes[iBval] == -1); iBval++) + for (iBval = offset; iBval < end && (sbyte) bytes[iBval] == -1; iBval++) { } if (iBval >= end) { - this.magnitude = One.magnitude; + magnitude = One.magnitude; } - else { - int numBytes = end - iBval; - byte[] inverse = new byte[numBytes]; + else + { + var numBytes = end - iBval; + var inverse = new byte[numBytes]; - int index = 0; + var index = 0; while (index < numBytes) - { - inverse[index++] = (byte)~bytes[iBval++]; - } + inverse[index++] = (byte) ~bytes[iBval++]; Debug.Assert(iBval == end); while (inverse[--index] == byte.MaxValue) - { inverse[index] = byte.MinValue; - } inverse[index]++; - this.magnitude = MakeMagnitude(inverse, 0, inverse.Length); + magnitude = MakeMagnitude(inverse, 0, inverse.Length); } } - else { + else + { // strip leading zero bytes and return magnitude bytes - this.magnitude = MakeMagnitude(bytes, offset, length); - this.sign = this.magnitude.Length > 0 ? 1 : 0; + magnitude = MakeMagnitude(bytes, offset, length); + SignValue = magnitude.Length > 0 ? 1 : 0; } } - private static int[] MakeMagnitude( - byte[] bytes, - int offset, - int length) - { - int end = offset + length; - - // strip leading zeros - int firstSignificant; - for (firstSignificant = offset; firstSignificant < end - && bytes[firstSignificant] == 0; firstSignificant++) - { - } - - if (firstSignificant >= end) - { - return ZeroMagnitude; - } - - int nInts = (end - firstSignificant + 3) / BytesPerInt; - int bCount = (end - firstSignificant) % BytesPerInt; - if (bCount == 0) - { - bCount = BytesPerInt; - } - - if (nInts < 1) - { - return ZeroMagnitude; - } - - int[] mag = new int[nInts]; - - int v = 0; - int magnitudeIndex = 0; - for (int i = firstSignificant; i < end; ++i) - { - v <<= 8; - v |= bytes[i] & 0xff; - bCount--; - if (bCount <= 0) - { - mag[magnitudeIndex] = v; - magnitudeIndex++; - bCount = BytesPerInt; - v = 0; - } - } - - if (magnitudeIndex < mag.Length) - { - mag[magnitudeIndex] = v; - } - - return mag; - } - public BigInteger( int sign, byte[] bytes) @@ -501,12 +437,13 @@ namespace TLSharp.Core.MTProto.Crypto if (sign == 0) { //this.sign = 0; - this.magnitude = ZeroMagnitude; + magnitude = ZeroMagnitude; } - else { + else + { // copy bytes - this.magnitude = MakeMagnitude(bytes, offset, length); - this.sign = this.magnitude.Length < 1 ? 0 : sign; + magnitude = MakeMagnitude(bytes, offset, length); + SignValue = magnitude.Length < 1 ? 0 : sign; } } @@ -517,29 +454,27 @@ namespace TLSharp.Core.MTProto.Crypto if (sizeInBits < 0) throw new ArgumentException("sizeInBits must be non-negative"); - this.nBits = -1; - this.nBitLength = -1; + nBits = -1; + nBitLength = -1; if (sizeInBits == 0) { // this.sign = 0; - this.magnitude = ZeroMagnitude; + magnitude = ZeroMagnitude; return; } - int nBytes = GetByteLength(sizeInBits); - byte[] b = new byte[nBytes]; + var nBytes = GetByteLength(sizeInBits); + var b = new byte[nBytes]; random.NextBytes(b); // strip off any excess bits in the MSB b[0] &= rndMask[BitsPerByte * nBytes - sizeInBits]; - this.magnitude = MakeMagnitude(b, 0, b.Length); - this.sign = this.magnitude.Length < 1 ? 0 : 1; + magnitude = MakeMagnitude(b, 0, b.Length); + SignValue = magnitude.Length < 1 ? 0 : 1; } - private static readonly byte[] rndMask = { 255, 127, 63, 31, 15, 7, 3, 1 }; - public BigInteger( int bitLength, int certainty, @@ -548,22 +483,22 @@ namespace TLSharp.Core.MTProto.Crypto if (bitLength < 2) throw new ArithmeticException("bitLength < 2"); - this.sign = 1; - this.nBitLength = bitLength; + SignValue = 1; + nBitLength = bitLength; if (bitLength == 2) { - this.magnitude = random.Next(2) == 0 + magnitude = random.Next(2) == 0 ? Two.magnitude : Three.magnitude; return; } - int nBytes = GetByteLength(bitLength); - byte[] b = new byte[nBytes]; + var nBytes = GetByteLength(bitLength); + var b = new byte[nBytes]; - int xBits = BitsPerByte * nBytes - bitLength; - byte mask = rndMask[xBits]; + var xBits = BitsPerByte * nBytes - bitLength; + var mask = rndMask[xBits]; for (;;) { @@ -573,14 +508,14 @@ namespace TLSharp.Core.MTProto.Crypto b[0] &= mask; // ensure the leading bit is 1 (to meet the strength requirement) - b[0] |= (byte)(1 << (7 - xBits)); + b[0] |= (byte) (1 << (7 - xBits)); // ensure the trailing bit is 1 (i.e. must be odd) b[nBytes - 1] |= 1; - this.magnitude = MakeMagnitude(b, 0, b.Length); - this.nBits = -1; - this.mQuote = -1L; + magnitude = MakeMagnitude(b, 0, b.Length); + nBits = -1; + mQuote = -1L; if (certainty < 1) break; @@ -589,767 +524,64 @@ namespace TLSharp.Core.MTProto.Crypto break; if (bitLength > 32) - { - for (int rep = 0; rep < 10000; ++rep) + for (var rep = 0; rep < 10000; ++rep) { - int n = 33 + random.Next(bitLength - 2); - this.magnitude[this.magnitude.Length - (n >> 5)] ^= (1 << (n & 31)); - this.magnitude[this.magnitude.Length - 1] ^= ((random.Next() + 1) << 1); - this.mQuote = -1L; + var n = 33 + random.Next(bitLength - 2); + magnitude[magnitude.Length - (n >> 5)] ^= 1 << (n & 31); + magnitude[magnitude.Length - 1] ^= (random.Next() + 1) << 1; + mQuote = -1L; if (CheckProbablePrime(certainty, random)) return; } - } } } - public BigInteger Abs() - { - return sign >= 0 ? this : Negate(); - } - - /** - * return a = a + b - b preserved. - */ - private static int[] AddMagnitudes( - int[] a, - int[] b) - { - int tI = a.Length - 1; - int vI = b.Length - 1; - long m = 0; - - while (vI >= 0) - { - m += ((long)(uint)a[tI] + (long)(uint)b[vI--]); - a[tI--] = (int)m; - m = (long)((ulong)m >> 32); - } - - if (m != 0) - { - while (tI >= 0 && ++a[tI--] == 0) - { - } - } - - return a; - } - - public BigInteger Add( - BigInteger value) - { - if (this.sign == 0) - return value; - - if (this.sign != value.sign) - { - if (value.sign == 0) - return this; - - if (value.sign < 0) - return Subtract(value.Negate()); - - return value.Subtract(Negate()); - } - - return AddToMagnitude(value.magnitude); - } - - private BigInteger AddToMagnitude( - int[] magToAdd) - { - int[] big, small; - if (this.magnitude.Length < magToAdd.Length) - { - big = magToAdd; - small = this.magnitude; - } - else { - big = this.magnitude; - small = magToAdd; - } - - // Conservatively avoid over-allocation when no overflow possible - uint limit = uint.MaxValue; - if (big.Length == small.Length) - limit -= (uint)small[0]; - - bool possibleOverflow = (uint)big[0] >= limit; - - int[] bigCopy; - if (possibleOverflow) - { - bigCopy = new int[big.Length + 1]; - big.CopyTo(bigCopy, 1); - } - else { - bigCopy = (int[])big.Clone(); - } - - bigCopy = AddMagnitudes(bigCopy, small); - - return new BigInteger(this.sign, bigCopy, possibleOverflow); - } - - public BigInteger And( - BigInteger value) - { - if (this.sign == 0 || value.sign == 0) - { - return Zero; - } - - int[] aMag = this.sign > 0 - ? this.magnitude - : Add(One).magnitude; - - int[] bMag = value.sign > 0 - ? value.magnitude - : value.Add(One).magnitude; - - bool resultNeg = sign < 0 && value.sign < 0; - int resultLength = System.Math.Max(aMag.Length, bMag.Length); - int[] resultMag = new int[resultLength]; - - int aStart = resultMag.Length - aMag.Length; - int bStart = resultMag.Length - bMag.Length; - - for (int i = 0; i < resultMag.Length; ++i) - { - int aWord = i >= aStart ? aMag[i - aStart] : 0; - int bWord = i >= bStart ? bMag[i - bStart] : 0; - - if (this.sign < 0) - { - aWord = ~aWord; - } - - if (value.sign < 0) - { - bWord = ~bWord; - } - - resultMag[i] = aWord & bWord; - - if (resultNeg) - { - resultMag[i] = ~resultMag[i]; - } - } - - BigInteger result = new BigInteger(1, resultMag, true); - - // TODO Optimise this case - if (resultNeg) - { - result = result.Not(); - } - - return result; - } - - public BigInteger AndNot( - BigInteger val) - { - return And(val.Not()); - } - public int BitCount { get { if (nBits == -1) - { - if (sign < 0) + if (SignValue < 0) { // TODO Optimise this case nBits = Not().BitCount; } - else { - int sum = 0; - for (int i = 0; i < magnitude.Length; i++) + else + { + var sum = 0; + for (var i = 0; i < magnitude.Length; i++) { - sum += bitCounts[(byte)magnitude[i]]; - sum += bitCounts[(byte)(magnitude[i] >> 8)]; - sum += bitCounts[(byte)(magnitude[i] >> 16)]; - sum += bitCounts[(byte)(magnitude[i] >> 24)]; + sum += bitCounts[(byte) magnitude[i]]; + sum += bitCounts[(byte) (magnitude[i] >> 8)]; + sum += bitCounts[(byte) (magnitude[i] >> 16)]; + sum += bitCounts[(byte) (magnitude[i] >> 24)]; } nBits = sum; } - } return nBits; } } - private readonly static byte[] bitCounts = - { - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, - 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, - 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, - 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, - 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, - 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, - 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, - 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, - 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, - 6, 6, 7, 6, 7, 7, 8 - }; - - private int calcBitLength( - int indx, - int[] mag) - { - for (;;) - { - if (indx >= mag.Length) - return 0; - - if (mag[indx] != 0) - break; - - ++indx; - } - - // bit length for everything after the first int - int bitLength = 32 * ((mag.Length - indx) - 1); - - // and determine bitlength of first int - int firstMag = mag[indx]; - bitLength += BitLen(firstMag); - - // Check for negative powers of two - if (sign < 0 && ((firstMag & -firstMag) == firstMag)) - { - do - { - if (++indx >= mag.Length) - { - --bitLength; - break; - } - } - while (mag[indx] == 0); - } - - return bitLength; - } - public int BitLength { get { if (nBitLength == -1) - { - nBitLength = sign == 0 + nBitLength = SignValue == 0 ? 0 : calcBitLength(0, magnitude); - } return nBitLength; } } - // - // BitLen(value) is the number of bits in value. - // - private static int BitLen( - int w) - { - // Binary search - decision tree (5 tests, rarely 6) - return (w < 1 << 15 ? (w < 1 << 7 - ? (w < 1 << 3 ? (w < 1 << 1 - ? (w < 1 << 0 ? (w < 0 ? 32 : 0) : 1) - : (w < 1 << 2 ? 2 : 3)) : (w < 1 << 5 - ? (w < 1 << 4 ? 4 : 5) - : (w < 1 << 6 ? 6 : 7))) - : (w < 1 << 11 - ? (w < 1 << 9 ? (w < 1 << 8 ? 8 : 9) : (w < 1 << 10 ? 10 : 11)) - : (w < 1 << 13 ? (w < 1 << 12 ? 12 : 13) : (w < 1 << 14 ? 14 : 15)))) : (w < 1 << 23 ? (w < 1 << 19 - ? (w < 1 << 17 ? (w < 1 << 16 ? 16 : 17) : (w < 1 << 18 ? 18 : 19)) - : (w < 1 << 21 ? (w < 1 << 20 ? 20 : 21) : (w < 1 << 22 ? 22 : 23))) : (w < 1 << 27 - ? (w < 1 << 25 ? (w < 1 << 24 ? 24 : 25) : (w < 1 << 26 ? 26 : 27)) - : (w < 1 << 29 ? (w < 1 << 28 ? 28 : 29) : (w < 1 << 30 ? 30 : 31))))); - } - - // private readonly static byte[] bitLengths = - // { - // 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, - // 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - // 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - // 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - // 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - // 8, 8, 8, 8, 8, 8, 8, 8 - // }; - - private bool QuickPow2Check() - { - return sign > 0 && nBits == 1; - } - - public int CompareTo( - object obj) - { - return CompareTo((BigInteger)obj); - } - - /** - * unsigned comparison on two arrays - note the arrays may - * start with leading zeros. - */ - private static int CompareTo( - int xIndx, - int[] x, - int yIndx, - int[] y) - { - while (xIndx != x.Length && x[xIndx] == 0) - { - xIndx++; - } - - while (yIndx != y.Length && y[yIndx] == 0) - { - yIndx++; - } - - return CompareNoLeadingZeroes(xIndx, x, yIndx, y); - } - - private static int CompareNoLeadingZeroes( - int xIndx, - int[] x, - int yIndx, - int[] y) - { - int diff = (x.Length - y.Length) - (xIndx - yIndx); - - if (diff != 0) - { - return diff < 0 ? -1 : 1; - } - - // lengths of magnitudes the same, test the magnitude values - - while (xIndx < x.Length) - { - uint v1 = (uint)x[xIndx++]; - uint v2 = (uint)y[yIndx++]; - - if (v1 != v2) - return v1 < v2 ? -1 : 1; - } - - return 0; - } - - public int CompareTo( - BigInteger value) - { - return sign < value.sign ? -1 - : sign > value.sign ? 1 - : sign == 0 ? 0 - : sign * CompareNoLeadingZeroes(0, magnitude, 0, value.magnitude); - } - - /** - * return z = x / y - done in place (z value preserved, x contains the - * remainder) - */ - private int[] Divide( - int[] x, - int[] y) - { - int xStart = 0; - while (xStart < x.Length && x[xStart] == 0) - { - ++xStart; - } - - int yStart = 0; - while (yStart < y.Length && y[yStart] == 0) - { - ++yStart; - } - - Debug.Assert(yStart < y.Length); - - int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); - int[] count; - - if (xyCmp > 0) - { - int yBitLength = calcBitLength(yStart, y); - int xBitLength = calcBitLength(xStart, x); - int shift = xBitLength - yBitLength; - - int[] iCount; - int iCountStart = 0; - - int[] c; - int cStart = 0; - int cBitLength = yBitLength; - if (shift > 0) - { - // iCount = ShiftLeft(One.magnitude, shift); - iCount = new int[(shift >> 5) + 1]; - iCount[0] = 1 << (shift % 32); - - c = ShiftLeft(y, shift); - cBitLength += shift; - } - else { - iCount = new int[] { 1 }; - - int len = y.Length - yStart; - c = new int[len]; - Array.Copy(y, yStart, c, 0, len); - } - - count = new int[iCount.Length]; - - for (;;) - { - if (cBitLength < xBitLength - || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0) - { - Subtract(xStart, x, cStart, c); - AddMagnitudes(count, iCount); - - while (x[xStart] == 0) - { - if (++xStart == x.Length) - return count; - } - - //xBitLength = calcBitLength(xStart, x); - xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); - - if (xBitLength <= yBitLength) - { - if (xBitLength < yBitLength) - return count; - - xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); - - if (xyCmp <= 0) - break; - } - } - - shift = cBitLength - xBitLength; - - // NB: The case where c[cStart] is 1-bit is harmless - if (shift == 1) - { - uint firstC = (uint)c[cStart] >> 1; - uint firstX = (uint)x[xStart]; - if (firstC > firstX) - ++shift; - } - - if (shift < 2) - { - ShiftRightOneInPlace(cStart, c); - --cBitLength; - ShiftRightOneInPlace(iCountStart, iCount); - } - else { - ShiftRightInPlace(cStart, c, shift); - cBitLength -= shift; - ShiftRightInPlace(iCountStart, iCount, shift); - } - - //cStart = c.Length - ((cBitLength + 31) / 32); - while (c[cStart] == 0) - { - ++cStart; - } - - while (iCount[iCountStart] == 0) - { - ++iCountStart; - } - } - } - else { - count = new int[1]; - } - - if (xyCmp == 0) - { - AddMagnitudes(count, One.magnitude); - Array.Clear(x, xStart, x.Length - xStart); - } - - return count; - } - - public BigInteger Divide( - BigInteger val) - { - if (val.sign == 0) - throw new ArithmeticException("Division by zero error"); - - if (sign == 0) - return Zero; - - if (val.QuickPow2Check()) // val is power of two - { - BigInteger result = this.Abs().ShiftRight(val.Abs().BitLength - 1); - return val.sign == this.sign ? result : result.Negate(); - } - - int[] mag = (int[])this.magnitude.Clone(); - - return new BigInteger(this.sign * val.sign, Divide(mag, val.magnitude), true); - } - - public BigInteger[] DivideAndRemainder( - BigInteger val) - { - if (val.sign == 0) - throw new ArithmeticException("Division by zero error"); - - BigInteger[] biggies = new BigInteger[2]; - - if (sign == 0) - { - biggies[0] = Zero; - biggies[1] = Zero; - } - else if (val.QuickPow2Check()) // val is power of two - { - int e = val.Abs().BitLength - 1; - BigInteger quotient = this.Abs().ShiftRight(e); - int[] remainder = this.LastNBits(e); - - biggies[0] = val.sign == this.sign ? quotient : quotient.Negate(); - biggies[1] = new BigInteger(this.sign, remainder, true); - } - else { - int[] remainder = (int[])this.magnitude.Clone(); - int[] quotient = Divide(remainder, val.magnitude); - - biggies[0] = new BigInteger(this.sign * val.sign, quotient, true); - biggies[1] = new BigInteger(this.sign, remainder, true); - } - - return biggies; - } - - public override bool Equals( - object obj) - { - if (obj == this) - return true; - - BigInteger biggie = obj as BigInteger; - if (biggie == null) - return false; - - if (biggie.sign != sign || biggie.magnitude.Length != magnitude.Length) - return false; - - for (int i = 0; i < magnitude.Length; i++) - { - if (biggie.magnitude[i] != magnitude[i]) - { - return false; - } - } - - return true; - } - - public BigInteger Gcd( - BigInteger value) - { - if (value.sign == 0) - return Abs(); - - if (sign == 0) - return value.Abs(); - - BigInteger r; - BigInteger u = this; - BigInteger v = value; - - while (v.sign != 0) - { - r = u.Mod(v); - u = v; - v = r; - } - - return u; - } - - public override int GetHashCode() - { - int hc = magnitude.Length; - if (magnitude.Length > 0) - { - hc ^= magnitude[0]; - - if (magnitude.Length > 1) - { - hc ^= magnitude[magnitude.Length - 1]; - } - } - - return sign < 0 ? ~hc : hc; - } - - // TODO Make public? - private BigInteger Inc() - { - if (this.sign == 0) - return One; - - if (this.sign < 0) - return new BigInteger(-1, doSubBigLil(this.magnitude, One.magnitude), true); - - return AddToMagnitude(One.magnitude); - } - - public int IntValue - { - get - { - return sign == 0 ? 0 - : sign > 0 ? magnitude[magnitude.Length - 1] - : -magnitude[magnitude.Length - 1]; - } - } - - /** - * return whether or not a BigInteger is probably prime with a - * probability of 1 - (1/2)**certainty. - *

From Knuth Vol 2, pg 395.

- */ - public bool IsProbablePrime( - int certainty) - { - if (certainty <= 0) - return true; - - BigInteger n = Abs(); - - if (!n.TestBit(0)) - return n.Equals(Two); - - if (n.Equals(One)) - return false; - - return n.CheckProbablePrime(certainty, RandomSource); - } - - private bool CheckProbablePrime( - int certainty, - Random random) - { - Debug.Assert(certainty > 0); - Debug.Assert(CompareTo(Two) > 0); - Debug.Assert(TestBit(0)); - - - // Try to reduce the penalty for really small numbers - int numLists = System.Math.Min(BitLength - 1, primeLists.Length); - - for (int i = 0; i < numLists; ++i) - { - int test = Remainder(primeProducts[i]); - - int[] primeList = primeLists[i]; - for (int j = 0; j < primeList.Length; ++j) - { - int prime = primeList[j]; - int qRem = test % prime; - if (qRem == 0) - { - // We may find small numbers in the list - return BitLength < 16 && IntValue == prime; - } - } - } - - - // TODO Special case for < 10^16 (RabinMiller fixed list) - // if (BitLength < 30) - // { - // RabinMiller against 2, 3, 5, 7, 11, 13, 23 is sufficient - // } - - - // TODO Is it worth trying to create a hybrid of these two? - return RabinMillerTest(certainty, random); - // return SolovayStrassenTest(certainty, random); - - // bool rbTest = RabinMillerTest(certainty, random); - // bool ssTest = SolovayStrassenTest(certainty, random); - // - // Debug.Assert(rbTest == ssTest); - // - // return rbTest; - } - - internal bool RabinMillerTest( - int certainty, - Random random) - { - Debug.Assert(certainty > 0); - Debug.Assert(BitLength > 2); - Debug.Assert(TestBit(0)); - - // let n = 1 + d . 2^s - BigInteger n = this; - BigInteger nMinusOne = n.Subtract(One); - int s = nMinusOne.GetLowestSetBit(); - BigInteger r = nMinusOne.ShiftRight(s); - - Debug.Assert(s >= 1); - - do - { - // TODO Make a method for random BigIntegers in range 0 < x < n) - // - Method can be optimized by only replacing examined bits at each trial - BigInteger a; - do - { - a = new BigInteger(n.BitLength, random); - } - while (a.CompareTo(One) <= 0 || a.CompareTo(nMinusOne) >= 0); - - BigInteger y = a.ModPow(r, n); - - if (!y.Equals(One)) - { - int j = 0; - while (!y.Equals(nMinusOne)) - { - if (++j == s) - return false; - - y = y.ModPow(Two, n); - - if (y.Equals(One)) - return false; - } - } - - certainty -= 2; // composites pass for only 1/4 possible 'a' - } - while (certainty > 0); - - return true; - } + public int IntValue => SignValue == 0 + ? 0 + : SignValue > 0 + ? magnitude[magnitude.Length - 1] + : -magnitude[magnitude.Length - 1]; // private bool SolovayStrassenTest( // int certainty, @@ -1444,21 +676,729 @@ namespace TLSharp.Core.MTProto.Crypto { get { - if (sign == 0) + if (SignValue == 0) return 0; long v; if (magnitude.Length > 1) - { - v = ((long)magnitude[magnitude.Length - 2] << 32) + v = ((long) magnitude[magnitude.Length - 2] << 32) | (magnitude[magnitude.Length - 1] & IMASK); + else v = magnitude[magnitude.Length - 1] & IMASK; + + return SignValue < 0 ? -v : v; + } + } + + public int SignValue { get; private set; } + + private static int GetByteLength( + int nBits) + { + return (nBits + BitsPerByte - 1) / BitsPerByte; + } + + private static int[] MakeMagnitude( + byte[] bytes, + int offset, + int length) + { + var end = offset + length; + + // strip leading zeros + int firstSignificant; + for (firstSignificant = offset; + firstSignificant < end + && bytes[firstSignificant] == 0; + firstSignificant++) + { + } + + if (firstSignificant >= end) + return ZeroMagnitude; + + var nInts = (end - firstSignificant + 3) / BytesPerInt; + var bCount = (end - firstSignificant) % BytesPerInt; + if (bCount == 0) + bCount = BytesPerInt; + + if (nInts < 1) + return ZeroMagnitude; + + var mag = new int[nInts]; + + var v = 0; + var magnitudeIndex = 0; + for (var i = firstSignificant; i < end; ++i) + { + v <<= 8; + v |= bytes[i] & 0xff; + bCount--; + if (bCount <= 0) + { + mag[magnitudeIndex] = v; + magnitudeIndex++; + bCount = BytesPerInt; + v = 0; } - else { - v = (magnitude[magnitude.Length - 1] & IMASK); + } + + if (magnitudeIndex < mag.Length) + mag[magnitudeIndex] = v; + + return mag; + } + + public BigInteger Abs() + { + return SignValue >= 0 ? this : Negate(); + } + + /** + * return a = a + b - b preserved. + */ + private static int[] AddMagnitudes( + int[] a, + int[] b) + { + var tI = a.Length - 1; + var vI = b.Length - 1; + long m = 0; + + while (vI >= 0) + { + m += (uint) a[tI] + (long) (uint) b[vI--]; + a[tI--] = (int) m; + m = (long) ((ulong) m >> 32); + } + + if (m != 0) + while (tI >= 0 && ++a[tI--] == 0) + { } - return sign < 0 ? -v : v; + return a; + } + + public BigInteger Add( + BigInteger value) + { + if (SignValue == 0) + return value; + + if (SignValue != value.SignValue) + { + if (value.SignValue == 0) + return this; + + if (value.SignValue < 0) + return Subtract(value.Negate()); + + return value.Subtract(Negate()); } + + return AddToMagnitude(value.magnitude); + } + + private BigInteger AddToMagnitude( + int[] magToAdd) + { + int[] big, small; + if (magnitude.Length < magToAdd.Length) + { + big = magToAdd; + small = magnitude; + } + else + { + big = magnitude; + small = magToAdd; + } + + // Conservatively avoid over-allocation when no overflow possible + var limit = uint.MaxValue; + if (big.Length == small.Length) + limit -= (uint) small[0]; + + var possibleOverflow = (uint) big[0] >= limit; + + int[] bigCopy; + if (possibleOverflow) + { + bigCopy = new int[big.Length + 1]; + big.CopyTo(bigCopy, 1); + } + else + { + bigCopy = (int[]) big.Clone(); + } + + bigCopy = AddMagnitudes(bigCopy, small); + + return new BigInteger(SignValue, bigCopy, possibleOverflow); + } + + public BigInteger And( + BigInteger value) + { + if (SignValue == 0 || value.SignValue == 0) + return Zero; + + var aMag = SignValue > 0 + ? magnitude + : Add(One).magnitude; + + var bMag = value.SignValue > 0 + ? value.magnitude + : value.Add(One).magnitude; + + var resultNeg = SignValue < 0 && value.SignValue < 0; + var resultLength = Math.Max(aMag.Length, bMag.Length); + var resultMag = new int[resultLength]; + + var aStart = resultMag.Length - aMag.Length; + var bStart = resultMag.Length - bMag.Length; + + for (var i = 0; i < resultMag.Length; ++i) + { + var aWord = i >= aStart ? aMag[i - aStart] : 0; + var bWord = i >= bStart ? bMag[i - bStart] : 0; + + if (SignValue < 0) + aWord = ~aWord; + + if (value.SignValue < 0) + bWord = ~bWord; + + resultMag[i] = aWord & bWord; + + if (resultNeg) + resultMag[i] = ~resultMag[i]; + } + + var result = new BigInteger(1, resultMag, true); + + // TODO Optimise this case + if (resultNeg) + result = result.Not(); + + return result; + } + + public BigInteger AndNot( + BigInteger val) + { + return And(val.Not()); + } + + private int calcBitLength( + int indx, + int[] mag) + { + for (;;) + { + if (indx >= mag.Length) + return 0; + + if (mag[indx] != 0) + break; + + ++indx; + } + + // bit length for everything after the first int + var bitLength = 32 * (mag.Length - indx - 1); + + // and determine bitlength of first int + var firstMag = mag[indx]; + bitLength += BitLen(firstMag); + + // Check for negative powers of two + if (SignValue < 0 && (firstMag & -firstMag) == firstMag) + do + { + if (++indx >= mag.Length) + { + --bitLength; + break; + } + } while (mag[indx] == 0); + + return bitLength; + } + + // + // BitLen(value) is the number of bits in value. + // + private static int BitLen( + int w) + { + // Binary search - decision tree (5 tests, rarely 6) + return w < 1 << 15 + ? (w < 1 << 7 + ? (w < 1 << 3 + ? (w < 1 << 1 + ? (w < 1 << 0 ? (w < 0 ? 32 : 0) : 1) + : (w < 1 << 2 ? 2 : 3)) + : (w < 1 << 5 + ? (w < 1 << 4 ? 4 : 5) + : (w < 1 << 6 ? 6 : 7))) + : (w < 1 << 11 + ? (w < 1 << 9 ? (w < 1 << 8 ? 8 : 9) : (w < 1 << 10 ? 10 : 11)) + : (w < 1 << 13 ? (w < 1 << 12 ? 12 : 13) : (w < 1 << 14 ? 14 : 15)))) + : (w < 1 << 23 + ? (w < 1 << 19 + ? (w < 1 << 17 ? (w < 1 << 16 ? 16 : 17) : (w < 1 << 18 ? 18 : 19)) + : (w < 1 << 21 ? (w < 1 << 20 ? 20 : 21) : (w < 1 << 22 ? 22 : 23))) + : (w < 1 << 27 + ? (w < 1 << 25 ? (w < 1 << 24 ? 24 : 25) : (w < 1 << 26 ? 26 : 27)) + : (w < 1 << 29 ? (w < 1 << 28 ? 28 : 29) : (w < 1 << 30 ? 30 : 31)))); + } + + // private readonly static byte[] bitLengths = + // { + // 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + // 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + // 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + // 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + // 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + // 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + // 8, 8, 8, 8, 8, 8, 8, 8 + // }; + + private bool QuickPow2Check() + { + return SignValue > 0 && nBits == 1; + } + + public int CompareTo( + object obj) + { + return CompareTo((BigInteger) obj); + } + + /** + * unsigned comparison on two arrays - note the arrays may + * start with leading zeros. + */ + private static int CompareTo( + int xIndx, + int[] x, + int yIndx, + int[] y) + { + while (xIndx != x.Length && x[xIndx] == 0) + xIndx++; + + while (yIndx != y.Length && y[yIndx] == 0) + yIndx++; + + return CompareNoLeadingZeroes(xIndx, x, yIndx, y); + } + + private static int CompareNoLeadingZeroes( + int xIndx, + int[] x, + int yIndx, + int[] y) + { + var diff = x.Length - y.Length - (xIndx - yIndx); + + if (diff != 0) + return diff < 0 ? -1 : 1; + + // lengths of magnitudes the same, test the magnitude values + + while (xIndx < x.Length) + { + var v1 = (uint) x[xIndx++]; + var v2 = (uint) y[yIndx++]; + + if (v1 != v2) + return v1 < v2 ? -1 : 1; + } + + return 0; + } + + public int CompareTo( + BigInteger value) + { + return SignValue < value.SignValue + ? -1 + : SignValue > value.SignValue + ? 1 + : SignValue == 0 + ? 0 + : SignValue * CompareNoLeadingZeroes(0, magnitude, 0, value.magnitude); + } + + /** + * return z = x / y - done in place (z value preserved, x contains the + * remainder) + */ + private int[] Divide( + int[] x, + int[] y) + { + var xStart = 0; + while (xStart < x.Length && x[xStart] == 0) + ++xStart; + + var yStart = 0; + while (yStart < y.Length && y[yStart] == 0) + ++yStart; + + Debug.Assert(yStart < y.Length); + + var xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + int[] count; + + if (xyCmp > 0) + { + var yBitLength = calcBitLength(yStart, y); + var xBitLength = calcBitLength(xStart, x); + var shift = xBitLength - yBitLength; + + int[] iCount; + var iCountStart = 0; + + int[] c; + var cStart = 0; + var cBitLength = yBitLength; + if (shift > 0) + { + // iCount = ShiftLeft(One.magnitude, shift); + iCount = new int[(shift >> 5) + 1]; + iCount[0] = 1 << (shift % 32); + + c = ShiftLeft(y, shift); + cBitLength += shift; + } + else + { + iCount = new[] {1}; + + var len = y.Length - yStart; + c = new int[len]; + Array.Copy(y, yStart, c, 0, len); + } + + count = new int[iCount.Length]; + + for (;;) + { + if (cBitLength < xBitLength + || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0) + { + Subtract(xStart, x, cStart, c); + AddMagnitudes(count, iCount); + + while (x[xStart] == 0) + if (++xStart == x.Length) + return count; + + //xBitLength = calcBitLength(xStart, x); + xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); + + if (xBitLength <= yBitLength) + { + if (xBitLength < yBitLength) + return count; + + xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + + if (xyCmp <= 0) + break; + } + } + + shift = cBitLength - xBitLength; + + // NB: The case where c[cStart] is 1-bit is harmless + if (shift == 1) + { + var firstC = (uint) c[cStart] >> 1; + var firstX = (uint) x[xStart]; + if (firstC > firstX) + ++shift; + } + + if (shift < 2) + { + ShiftRightOneInPlace(cStart, c); + --cBitLength; + ShiftRightOneInPlace(iCountStart, iCount); + } + else + { + ShiftRightInPlace(cStart, c, shift); + cBitLength -= shift; + ShiftRightInPlace(iCountStart, iCount, shift); + } + + //cStart = c.Length - ((cBitLength + 31) / 32); + while (c[cStart] == 0) + ++cStart; + + while (iCount[iCountStart] == 0) + ++iCountStart; + } + } + else + { + count = new int[1]; + } + + if (xyCmp == 0) + { + AddMagnitudes(count, One.magnitude); + Array.Clear(x, xStart, x.Length - xStart); + } + + return count; + } + + public BigInteger Divide( + BigInteger val) + { + if (val.SignValue == 0) + throw new ArithmeticException("Division by zero error"); + + if (SignValue == 0) + return Zero; + + if (val.QuickPow2Check()) // val is power of two + { + var result = Abs().ShiftRight(val.Abs().BitLength - 1); + return val.SignValue == SignValue ? result : result.Negate(); + } + + var mag = (int[]) magnitude.Clone(); + + return new BigInteger(SignValue * val.SignValue, Divide(mag, val.magnitude), true); + } + + public BigInteger[] DivideAndRemainder( + BigInteger val) + { + if (val.SignValue == 0) + throw new ArithmeticException("Division by zero error"); + + var biggies = new BigInteger[2]; + + if (SignValue == 0) + { + biggies[0] = Zero; + biggies[1] = Zero; + } + else if (val.QuickPow2Check()) // val is power of two + { + var e = val.Abs().BitLength - 1; + var quotient = Abs().ShiftRight(e); + var remainder = LastNBits(e); + + biggies[0] = val.SignValue == SignValue ? quotient : quotient.Negate(); + biggies[1] = new BigInteger(SignValue, remainder, true); + } + else + { + var remainder = (int[]) magnitude.Clone(); + var quotient = Divide(remainder, val.magnitude); + + biggies[0] = new BigInteger(SignValue * val.SignValue, quotient, true); + biggies[1] = new BigInteger(SignValue, remainder, true); + } + + return biggies; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + var biggie = obj as BigInteger; + if (biggie == null) + return false; + + if (biggie.SignValue != SignValue || biggie.magnitude.Length != magnitude.Length) + return false; + + for (var i = 0; i < magnitude.Length; i++) + if (biggie.magnitude[i] != magnitude[i]) + return false; + + return true; + } + + public BigInteger Gcd( + BigInteger value) + { + if (value.SignValue == 0) + return Abs(); + + if (SignValue == 0) + return value.Abs(); + + BigInteger r; + var u = this; + var v = value; + + while (v.SignValue != 0) + { + r = u.Mod(v); + u = v; + v = r; + } + + return u; + } + + public override int GetHashCode() + { + var hc = magnitude.Length; + if (magnitude.Length > 0) + { + hc ^= magnitude[0]; + + if (magnitude.Length > 1) + hc ^= magnitude[magnitude.Length - 1]; + } + + return SignValue < 0 ? ~hc : hc; + } + + // TODO Make public? + private BigInteger Inc() + { + if (SignValue == 0) + return One; + + if (SignValue < 0) + return new BigInteger(-1, doSubBigLil(magnitude, One.magnitude), true); + + return AddToMagnitude(One.magnitude); + } + + /** + * return whether or not a BigInteger is probably prime with a + * probability of 1 - (1/2)**certainty. + *

From Knuth Vol 2, pg 395.

+ */ + public bool IsProbablePrime( + int certainty) + { + if (certainty <= 0) + return true; + + var n = Abs(); + + if (!n.TestBit(0)) + return n.Equals(Two); + + if (n.Equals(One)) + return false; + + return n.CheckProbablePrime(certainty, RandomSource); + } + + private bool CheckProbablePrime( + int certainty, + Random random) + { + Debug.Assert(certainty > 0); + Debug.Assert(CompareTo(Two) > 0); + Debug.Assert(TestBit(0)); + + + // Try to reduce the penalty for really small numbers + var numLists = Math.Min(BitLength - 1, primeLists.Length); + + for (var i = 0; i < numLists; ++i) + { + var test = Remainder(primeProducts[i]); + + var primeList = primeLists[i]; + for (var j = 0; j < primeList.Length; ++j) + { + var prime = primeList[j]; + var qRem = test % prime; + if (qRem == 0) + return BitLength < 16 && IntValue == prime; + } + } + + + // TODO Special case for < 10^16 (RabinMiller fixed list) + // if (BitLength < 30) + // { + // RabinMiller against 2, 3, 5, 7, 11, 13, 23 is sufficient + // } + + + // TODO Is it worth trying to create a hybrid of these two? + return RabinMillerTest(certainty, random); + // return SolovayStrassenTest(certainty, random); + + // bool rbTest = RabinMillerTest(certainty, random); + // bool ssTest = SolovayStrassenTest(certainty, random); + // + // Debug.Assert(rbTest == ssTest); + // + // return rbTest; + } + + internal bool RabinMillerTest( + int certainty, + Random random) + { + Debug.Assert(certainty > 0); + Debug.Assert(BitLength > 2); + Debug.Assert(TestBit(0)); + + // let n = 1 + d . 2^s + var n = this; + var nMinusOne = n.Subtract(One); + var s = nMinusOne.GetLowestSetBit(); + var r = nMinusOne.ShiftRight(s); + + Debug.Assert(s >= 1); + + do + { + // TODO Make a method for random BigIntegers in range 0 < x < n) + // - Method can be optimized by only replacing examined bits at each trial + BigInteger a; + do + { + a = new BigInteger(n.BitLength, random); + } while (a.CompareTo(One) <= 0 || a.CompareTo(nMinusOne) >= 0); + + var y = a.ModPow(r, n); + + if (!y.Equals(One)) + { + var j = 0; + while (!y.Equals(nMinusOne)) + { + if (++j == s) + return false; + + y = y.ModPow(Two, n); + + if (y.Equals(One)) + return false; + } + } + + certainty -= 2; // composites pass for only 1/4 possible 'a' + } while (certainty > 0); + + return true; } public BigInteger Max( @@ -1476,18 +1416,18 @@ namespace TLSharp.Core.MTProto.Crypto public BigInteger Mod( BigInteger m) { - if (m.sign < 1) + if (m.SignValue < 1) throw new ArithmeticException("Modulus must be positive"); - BigInteger biggie = Remainder(m); + var biggie = Remainder(m); - return (biggie.sign >= 0 ? biggie : biggie.Add(m)); + return biggie.SignValue >= 0 ? biggie : biggie.Add(m); } public BigInteger ModInverse( BigInteger m) { - if (m.sign < 1) + if (m.SignValue < 1) throw new ArithmeticException("Modulus must be positive"); // TODO Too slow at the moment @@ -1528,15 +1468,15 @@ namespace TLSharp.Core.MTProto.Crypto // } // } - BigInteger x = new BigInteger(); - BigInteger gcd = ExtEuclid(this.Mod(m), m, x, null); + var x = new BigInteger(); + var gcd = ExtEuclid(Mod(m), m, x, null); if (!gcd.Equals(One)) throw new ArithmeticException("Numbers not relatively prime."); - if (x.sign < 0) + if (x.SignValue < 0) { - x.sign = 1; + x.SignValue = 1; //x = m.Subtract(x); x.magnitude = doSubBigLil(m.magnitude, x.magnitude); } @@ -1567,17 +1507,17 @@ namespace TLSharp.Core.MTProto.Crypto BigInteger u1Out, BigInteger u2Out) { - BigInteger u1 = One; - BigInteger u3 = a; - BigInteger v1 = Zero; - BigInteger v3 = b; + var u1 = One; + var u3 = a; + var v1 = Zero; + var v3 = b; - while (v3.sign > 0) + while (v3.SignValue > 0) { - BigInteger[] q = u3.DivideAndRemainder(v3); + var q = u3.DivideAndRemainder(v3); - BigInteger tmp = v1.Multiply(q[0]); - BigInteger tn = u1.Subtract(tmp); + var tmp = v1.Multiply(q[0]); + var tn = u1.Subtract(tmp); u1 = v1; v1 = tn; @@ -1587,16 +1527,16 @@ namespace TLSharp.Core.MTProto.Crypto if (u1Out != null) { - u1Out.sign = u1.sign; + u1Out.SignValue = u1.SignValue; u1Out.magnitude = u1.magnitude; } if (u2Out != null) { - BigInteger tmp = u1.Multiply(a); + var tmp = u1.Multiply(a); tmp = u3.Subtract(tmp); - BigInteger res = tmp.Divide(b); - u2Out.sign = res.sign; + var res = tmp.Divide(b); + u2Out.SignValue = res.SignValue; u2Out.magnitude = res.magnitude; } @@ -1613,16 +1553,16 @@ namespace TLSharp.Core.MTProto.Crypto BigInteger exponent, BigInteger m) { - if (m.sign < 1) + if (m.SignValue < 1) throw new ArithmeticException("Modulus must be positive"); if (m.Equals(One)) return Zero; - if (exponent.sign == 0) + if (exponent.SignValue == 0) return One; - if (sign == 0) + if (SignValue == 0) return Zero; int[] zVal = null; @@ -1631,24 +1571,24 @@ namespace TLSharp.Core.MTProto.Crypto // Montgomery exponentiation is only possible if the modulus is odd, // but AFAIK, this is always the case for crypto algo's - bool useMonty = ((m.magnitude[m.magnitude.Length - 1] & 1) == 1); + var useMonty = (m.magnitude[m.magnitude.Length - 1] & 1) == 1; long mQ = 0; if (useMonty) { mQ = m.GetMQuote(); // tmp = this * R mod m - BigInteger tmp = ShiftLeft(32 * m.magnitude.Length).Mod(m); + var tmp = ShiftLeft(32 * m.magnitude.Length).Mod(m); zVal = tmp.magnitude; - useMonty = (zVal.Length <= m.magnitude.Length); + useMonty = zVal.Length <= m.magnitude.Length; if (useMonty) { yAccum = new int[m.magnitude.Length + 1]; if (zVal.Length < m.magnitude.Length) { - int[] longZ = new int[m.magnitude.Length]; + var longZ = new int[m.magnitude.Length]; zVal.CopyTo(longZ, longZ.Length - zVal.Length); zVal = longZ; } @@ -1663,11 +1603,12 @@ namespace TLSharp.Core.MTProto.Crypto zVal = new int[m.magnitude.Length]; magnitude.CopyTo(zVal, zVal.Length - magnitude.Length); } - else { + else + { // // in normal practice we'll never see this... // - BigInteger tmp = Remainder(m); + var tmp = Remainder(m); //zAccum = new int[m.magnitude.Length * 2]; zVal = new int[m.magnitude.Length]; @@ -1682,10 +1623,10 @@ namespace TLSharp.Core.MTProto.Crypto // // from LSW to MSW // - for (int i = 0; i < exponent.magnitude.Length; i++) + for (var i = 0; i < exponent.magnitude.Length; i++) { - int v = exponent.magnitude[i]; - int bits = 0; + var v = exponent.magnitude[i]; + var bits = 0; if (i == 0) { @@ -1713,7 +1654,8 @@ namespace TLSharp.Core.MTProto.Crypto // be almost as heavy as a Montgomery mulitply. MultiplyMonty(yAccum, yVal, yVal, m.magnitude, mQ); } - else { + else + { Square(yAccum, yVal); Remainder(yAccum, m.magnitude); Array.Copy(yAccum, yAccum.Length - yVal.Length, yVal, 0, yVal.Length); @@ -1722,19 +1664,18 @@ namespace TLSharp.Core.MTProto.Crypto bits++; if (v < 0) - { if (useMonty) { MultiplyMonty(yAccum, yVal, zVal, m.magnitude, mQ); } - else { + else + { Multiply(yAccum, yVal, zVal); Remainder(yAccum, m.magnitude); Array.Copy(yAccum, yAccum.Length - yVal.Length, yVal, 0, yVal.Length); ZeroOut(yAccum); } - } v <<= 1; } @@ -1745,7 +1686,8 @@ namespace TLSharp.Core.MTProto.Crypto { MultiplyMonty(yAccum, yVal, yVal, m.magnitude, mQ); } - else { + else + { Square(yAccum, yVal); Remainder(yAccum, m.magnitude); Array.Copy(yAccum, yAccum.Length - yVal.Length, yVal, 0, yVal.Length); @@ -1763,9 +1705,9 @@ namespace TLSharp.Core.MTProto.Crypto MultiplyMonty(yAccum, yVal, zVal, m.magnitude, mQ); } - BigInteger result = new BigInteger(1, yVal, true); + var result = new BigInteger(1, yVal, true); - return exponent.sign > 0 + return exponent.SignValue > 0 ? result : result.ModInverse(m); } @@ -1783,61 +1725,53 @@ namespace TLSharp.Core.MTProto.Crypto ulong u1, u2, c; - int wBase = w.Length - 1; + var wBase = w.Length - 1; - for (int i = x.Length - 1; i != 0; i--) + for (var i = x.Length - 1; i != 0; i--) { - ulong v = (ulong)(uint)x[i]; + ulong v = (uint) x[i]; u1 = v * v; u2 = u1 >> 32; - u1 = (uint)u1; + u1 = (uint) u1; - u1 += (ulong)(uint)w[wBase]; + u1 += (uint) w[wBase]; - w[wBase] = (int)(uint)u1; + w[wBase] = (int) (uint) u1; c = u2 + (u1 >> 32); - for (int j = i - 1; j >= 0; j--) + for (var j = i - 1; j >= 0; j--) { --wBase; - u1 = v * (ulong)(uint)x[j]; + u1 = v * (uint) x[j]; u2 = u1 >> 31; // multiply by 2! - u1 = (uint)(u1 << 1); // multiply by 2! - u1 += c + (ulong)(uint)w[wBase]; + u1 = (uint) (u1 << 1); // multiply by 2! + u1 += c + (uint) w[wBase]; - w[wBase] = (int)(uint)u1; + w[wBase] = (int) (uint) u1; c = u2 + (u1 >> 32); } - c += (ulong)(uint)w[--wBase]; - w[wBase] = (int)(uint)c; + c += (uint) w[--wBase]; + w[wBase] = (int) (uint) c; if (--wBase >= 0) - { - w[wBase] = (int)(uint)(c >> 32); - } - else { - Debug.Assert((uint)(c >> 32) == 0); - } + w[wBase] = (int) (uint) (c >> 32); + else Debug.Assert((uint) (c >> 32) == 0); wBase += i; } - u1 = (ulong)(uint)x[0]; + u1 = (uint) x[0]; u1 = u1 * u1; u2 = u1 >> 32; u1 = u1 & IMASK; - u1 += (ulong)(uint)w[wBase]; + u1 += (uint) w[wBase]; - w[wBase] = (int)(uint)u1; + w[wBase] = (int) (uint) u1; if (--wBase >= 0) - { - w[wBase] = (int)(uint)(u2 + (u1 >> 32) + (ulong)(uint)w[wBase]); - } - else { - Debug.Assert((uint)(u2 + (u1 >> 32)) == 0); - } + w[wBase] = (int) (uint) (u2 + (u1 >> 32) + (uint) w[wBase]); + else Debug.Assert((uint) (u2 + (u1 >> 32)) == 0); return w; } @@ -1850,25 +1784,25 @@ namespace TLSharp.Core.MTProto.Crypto int[] y, int[] z) { - int i = z.Length; + var i = z.Length; if (i < 1) return x; - int xBase = x.Length - y.Length; + var xBase = x.Length - y.Length; for (;;) { - long a = z[--i] & IMASK; + var a = z[--i] & IMASK; long val = 0; - for (int j = y.Length - 1; j >= 0; j--) + for (var j = y.Length - 1; j >= 0; j--) { val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK); - x[xBase + j] = (int)val; + x[xBase + j] = (int) val; - val = (long)((ulong)val >> 32); + val = (long) ((ulong) val >> 32); } --xBase; @@ -1876,16 +1810,12 @@ namespace TLSharp.Core.MTProto.Crypto if (i < 1) { if (xBase >= 0) - { - x[xBase] = (int)val; - } - else { - Debug.Assert(val == 0); - } + x[xBase] = (int) val; + else Debug.Assert(val == 0); break; } - x[xBase] = (int)val; + x[xBase] = (int) val; } return x; @@ -1897,9 +1827,9 @@ namespace TLSharp.Core.MTProto.Crypto long[] uOut) { long u1 = 1; - long u3 = a; + var u3 = a; long v1 = 0; - long v3 = b; + var v3 = b; while (v3 > 0) { @@ -1907,17 +1837,17 @@ namespace TLSharp.Core.MTProto.Crypto q = u3 / v3; - tn = u1 - (v1 * q); + tn = u1 - v1 * q; u1 = v1; v1 = tn; - tn = u3 - (v3 * q); + tn = u3 - v3 * q; u3 = v3; v3 = tn; } uOut[0] = u1; - uOut[1] = (u3 - (u1 * a)) / b; + uOut[1] = (u3 - u1 * a) / b; return u3; } @@ -1929,16 +1859,14 @@ namespace TLSharp.Core.MTProto.Crypto if (m < 1) throw new ArithmeticException("Modulus must be positive"); - long[] x = new long[2]; - long gcd = FastExtEuclid(v, m, x); + var x = new long[2]; + var gcd = FastExtEuclid(v, m, x); if (gcd != 1) throw new ArithmeticException("Numbers not relatively prime."); if (x[0] < 0) - { x[0] += m; - } return x[0]; } @@ -1951,19 +1879,15 @@ namespace TLSharp.Core.MTProto.Crypto */ private long GetMQuote() { - Debug.Assert(this.sign > 0); + Debug.Assert(SignValue > 0); if (mQuote != -1) - { return mQuote; // already calculated - } if (magnitude.Length == 0 || (magnitude[magnitude.Length - 1] & 1) == 0) - { return -1; // not for even numbers - } - long v = (((~this.magnitude[this.magnitude.Length - 1]) | 1) & 0xffffffffL); + var v = (~magnitude[magnitude.Length - 1] | 1) & 0xffffffffL; mQuote = FastModInverse(v, 0x100000000L); return mQuote; @@ -1983,58 +1907,56 @@ namespace TLSharp.Core.MTProto.Crypto * NOTE: the indices of x, y, m, a different in HAC and in Java */ private static void MultiplyMonty( - int[] a, - int[] x, - int[] y, - int[] m, - long mQuote) - // mQuote = -m^(-1) mod b + int[] a, + int[] x, + int[] y, + int[] m, + long mQuote) + // mQuote = -m^(-1) mod b { if (m.Length == 1) { - x[0] = (int)MultiplyMontyNIsOne((uint)x[0], (uint)y[0], (uint)m[0], (ulong)mQuote); + x[0] = (int) MultiplyMontyNIsOne((uint) x[0], (uint) y[0], (uint) m[0], (ulong) mQuote); return; } - int n = m.Length; - int nMinus1 = n - 1; - long y_0 = y[nMinus1] & IMASK; + var n = m.Length; + var nMinus1 = n - 1; + var y_0 = y[nMinus1] & IMASK; // 1. a = 0 (Notation: a = (a_{n} a_{n-1} ... a_{0})_{b} ) Array.Clear(a, 0, n + 1); // 2. for i from 0 to (n - 1) do the following: - for (int i = n; i > 0; i--) + for (var i = n; i > 0; i--) { - long x_i = x[i - 1] & IMASK; + var x_i = x[i - 1] & IMASK; // 2.1 u = ((a[0] + (x[i] * y[0]) * mQuote) mod b - long u = ((((a[n] & IMASK) + ((x_i * y_0) & IMASK)) & IMASK) * mQuote) & IMASK; + var u = ((((a[n] & IMASK) + ((x_i * y_0) & IMASK)) & IMASK) * mQuote) & IMASK; // 2.2 a = (a + x_i * y + u * m) / b - long prod1 = x_i * y_0; - long prod2 = u * (m[nMinus1] & IMASK); - long tmp = (a[n] & IMASK) + (prod1 & IMASK) + (prod2 & IMASK); - long carry = (long)((ulong)prod1 >> 32) + (long)((ulong)prod2 >> 32) + (long)((ulong)tmp >> 32); - for (int j = nMinus1; j > 0; j--) + var prod1 = x_i * y_0; + var prod2 = u * (m[nMinus1] & IMASK); + var tmp = (a[n] & IMASK) + (prod1 & IMASK) + (prod2 & IMASK); + var carry = (long) ((ulong) prod1 >> 32) + (long) ((ulong) prod2 >> 32) + (long) ((ulong) tmp >> 32); + for (var j = nMinus1; j > 0; j--) { prod1 = x_i * (y[j - 1] & IMASK); prod2 = u * (m[j - 1] & IMASK); tmp = (a[j] & IMASK) + (prod1 & IMASK) + (prod2 & IMASK) + (carry & IMASK); - carry = (long)((ulong)carry >> 32) + (long)((ulong)prod1 >> 32) + - (long)((ulong)prod2 >> 32) + (long)((ulong)tmp >> 32); - a[j + 1] = (int)tmp; // division by b + carry = (long) ((ulong) carry >> 32) + (long) ((ulong) prod1 >> 32) + + (long) ((ulong) prod2 >> 32) + (long) ((ulong) tmp >> 32); + a[j + 1] = (int) tmp; // division by b } - carry += (a[0] & IMASK); - a[1] = (int)carry; - a[0] = (int)((ulong)carry >> 32); // OJO!!!!! + carry += a[0] & IMASK; + a[1] = (int) carry; + a[0] = (int) ((ulong) carry >> 32); // OJO!!!!! } // 3. if x >= m the x = x - m if (CompareTo(0, a, 0, m) >= 0) - { Subtract(0, a, 0, m); - } // put the result in x Array.Copy(a, 1, x, 0, n); @@ -2047,74 +1969,66 @@ namespace TLSharp.Core.MTProto.Crypto ulong mQuote) { ulong um = m; - ulong prod1 = (ulong)x * (ulong)y; - ulong u = (prod1 * mQuote) & UIMASK; - ulong prod2 = u * um; - ulong tmp = (prod1 & UIMASK) + (prod2 & UIMASK); - ulong carry = (prod1 >> 32) + (prod2 >> 32) + (tmp >> 32); + var prod1 = x * (ulong) y; + var u = (prod1 * mQuote) & UIMASK; + var prod2 = u * um; + var tmp = (prod1 & UIMASK) + (prod2 & UIMASK); + var carry = (prod1 >> 32) + (prod2 >> 32) + (tmp >> 32); if (carry > um) - { carry -= um; - } - return (uint)(carry & UIMASK); + return (uint) (carry & UIMASK); } public BigInteger Multiply( BigInteger val) { - if (sign == 0 || val.sign == 0) + if (SignValue == 0 || val.SignValue == 0) return Zero; if (val.QuickPow2Check()) // val is power of two { - BigInteger result = this.ShiftLeft(val.Abs().BitLength - 1); - return val.sign > 0 ? result : result.Negate(); + var result = ShiftLeft(val.Abs().BitLength - 1); + return val.SignValue > 0 ? result : result.Negate(); } - if (this.QuickPow2Check()) // this is power of two + if (QuickPow2Check()) // this is power of two { - BigInteger result = val.ShiftLeft(this.Abs().BitLength - 1); - return this.sign > 0 ? result : result.Negate(); + var result = val.ShiftLeft(Abs().BitLength - 1); + return SignValue > 0 ? result : result.Negate(); } - int resLength = (this.BitLength + val.BitLength) / BitsPerInt + 1; - int[] res = new int[resLength]; + var resLength = (BitLength + val.BitLength) / BitsPerInt + 1; + var res = new int[resLength]; if (val == this) - { - Square(res, this.magnitude); - } - else { - Multiply(res, this.magnitude, val.magnitude); - } + Square(res, magnitude); + else Multiply(res, magnitude, val.magnitude); - return new BigInteger(sign * val.sign, res, true); + return new BigInteger(SignValue * val.SignValue, res, true); } public BigInteger Negate() { - if (sign == 0) + if (SignValue == 0) return this; - return new BigInteger(-sign, magnitude, false); + return new BigInteger(-SignValue, magnitude, false); } public BigInteger NextProbablePrime() { - if (sign < 0) + if (SignValue < 0) throw new ArithmeticException("Cannot be called on value < 0"); if (CompareTo(Two) < 0) return Two; - BigInteger n = Inc().SetBit(0); + var n = Inc().SetBit(0); while (!n.CheckProbablePrime(100, RandomSource)) - { n = n.Add(Two); - } return n; } @@ -2127,29 +2041,21 @@ namespace TLSharp.Core.MTProto.Crypto public BigInteger Pow(int exp) { if (exp < 0) - { throw new ArithmeticException("Negative exponent"); - } if (exp == 0) - { return One; - } - if (sign == 0 || Equals(One)) - { + if (SignValue == 0 || Equals(One)) return this; - } - BigInteger y = One; - BigInteger z = this; + var y = One; + var z = this; for (;;) { if ((exp & 0x1) == 1) - { y = y.Multiply(z); - } exp >>= 1; if (exp == 0) break; z = z.Multiply(z); @@ -2171,13 +2077,13 @@ namespace TLSharp.Core.MTProto.Crypto Debug.Assert(m > 0); long acc = 0; - for (int pos = 0; pos < magnitude.Length; ++pos) + for (var pos = 0; pos < magnitude.Length; ++pos) { - long posVal = (uint)magnitude[pos]; - acc = (acc << 32 | posVal) % m; + long posVal = (uint) magnitude[pos]; + acc = ((acc << 32) | posVal) % m; } - return (int)acc; + return (int) acc; } /** @@ -2187,39 +2093,36 @@ namespace TLSharp.Core.MTProto.Crypto int[] x, int[] y) { - int xStart = 0; + var xStart = 0; while (xStart < x.Length && x[xStart] == 0) - { ++xStart; - } - int yStart = 0; + var yStart = 0; while (yStart < y.Length && y[yStart] == 0) - { ++yStart; - } Debug.Assert(yStart < y.Length); - int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + var xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); if (xyCmp > 0) { - int yBitLength = calcBitLength(yStart, y); - int xBitLength = calcBitLength(xStart, x); - int shift = xBitLength - yBitLength; + var yBitLength = calcBitLength(yStart, y); + var xBitLength = calcBitLength(xStart, x); + var shift = xBitLength - yBitLength; int[] c; - int cStart = 0; - int cBitLength = yBitLength; + var cStart = 0; + var cBitLength = yBitLength; if (shift > 0) { c = ShiftLeft(y, shift); cBitLength += shift; Debug.Assert(c[0] != 0); } - else { - int len = y.Length - yStart; + else + { + var len = y.Length - yStart; c = new int[len]; Array.Copy(y, yStart, c, 0, len); } @@ -2232,10 +2135,8 @@ namespace TLSharp.Core.MTProto.Crypto Subtract(xStart, x, cStart, c); while (x[xStart] == 0) - { if (++xStart == x.Length) return x; - } //xBitLength = calcBitLength(xStart, x); xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); @@ -2257,8 +2158,8 @@ namespace TLSharp.Core.MTProto.Crypto // NB: The case where c[cStart] is 1-bit is harmless if (shift == 1) { - uint firstC = (uint)c[cStart] >> 1; - uint firstX = (uint)x[xStart]; + var firstC = (uint) c[cStart] >> 1; + var firstX = (uint) x[xStart]; if (firstC > firstX) ++shift; } @@ -2268,23 +2169,20 @@ namespace TLSharp.Core.MTProto.Crypto ShiftRightOneInPlace(cStart, c); --cBitLength; } - else { + else + { ShiftRightInPlace(cStart, c, shift); cBitLength -= shift; } //cStart = c.Length - ((cBitLength + 31) / 32); while (c[cStart] == 0) - { ++cStart; - } } } if (xyCmp == 0) - { Array.Clear(x, xStart, x.Length - xStart); - } return x; } @@ -2292,16 +2190,16 @@ namespace TLSharp.Core.MTProto.Crypto public BigInteger Remainder( BigInteger n) { - if (n.sign == 0) + if (n.SignValue == 0) throw new ArithmeticException("Division by zero error"); - if (this.sign == 0) + if (SignValue == 0) return Zero; // For small values, use fast remainder method if (n.magnitude.Length == 1) { - int val = n.magnitude[0]; + var val = n.magnitude[0]; if (val > 0) { @@ -2309,11 +2207,11 @@ namespace TLSharp.Core.MTProto.Crypto return Zero; // TODO Make this func work on uint, and handle val == 1? - int rem = Remainder(val); + var rem = Remainder(val); return rem == 0 ? Zero - : new BigInteger(sign, new int[] { rem }, false); + : new BigInteger(SignValue, new[] {rem}, false); } } @@ -2321,17 +2219,18 @@ namespace TLSharp.Core.MTProto.Crypto return this; int[] result; - if (n.QuickPow2Check()) // n is power of two + if (n.QuickPow2Check()) // n is power of two { // TODO Move before small values branch above? result = LastNBits(n.Abs().BitLength - 1); } - else { - result = (int[])this.magnitude.Clone(); + else + { + result = (int[]) magnitude.Clone(); result = Remainder(result, n.magnitude); } - return new BigInteger(sign, result, true); + return new BigInteger(SignValue, result, true); } private int[] LastNBits( @@ -2340,17 +2239,15 @@ namespace TLSharp.Core.MTProto.Crypto if (n < 1) return ZeroMagnitude; - int numWords = (n + BitsPerInt - 1) / BitsPerInt; - numWords = System.Math.Min(numWords, this.magnitude.Length); - int[] result = new int[numWords]; + var numWords = (n + BitsPerInt - 1) / BitsPerInt; + numWords = Math.Min(numWords, magnitude.Length); + var result = new int[numWords]; - Array.Copy(this.magnitude, this.magnitude.Length - numWords, result, 0, numWords); + Array.Copy(magnitude, magnitude.Length - numWords, result, 0, numWords); - int hiBits = n % 32; + var hiBits = n % 32; if (hiBits != 0) - { result[0] &= ~(-1 << hiBits); - } return result; } @@ -2362,9 +2259,9 @@ namespace TLSharp.Core.MTProto.Crypto int[] mag, int n) { - int nInts = (int)((uint)n >> 5); - int nBits = n & 0x1f; - int magLen = mag.Length; + var nInts = (int) ((uint) n >> 5); + var nBits = n & 0x1f; + var magLen = mag.Length; int[] newMag; if (nBits == 0) @@ -2372,26 +2269,28 @@ namespace TLSharp.Core.MTProto.Crypto newMag = new int[magLen + nInts]; mag.CopyTo(newMag, 0); } - else { - int i = 0; - int nBits2 = 32 - nBits; - int highBits = (int)((uint)mag[0] >> nBits2); + else + { + var i = 0; + var nBits2 = 32 - nBits; + var highBits = (int) ((uint) mag[0] >> nBits2); if (highBits != 0) { newMag = new int[magLen + nInts + 1]; newMag[i++] = highBits; } - else { + else + { newMag = new int[magLen + nInts]; } - int m = mag[0]; - for (int j = 0; j < magLen - 1; j++) + var m = mag[0]; + for (var j = 0; j < magLen - 1; j++) { - int next = mag[j + 1]; + var next = mag[j + 1]; - newMag[i++] = (m << nBits) | (int)((uint)next >> nBits2); + newMag[i++] = (m << nBits) | (int) ((uint) next >> nBits2); m = next; } @@ -2404,7 +2303,7 @@ namespace TLSharp.Core.MTProto.Crypto public BigInteger ShiftLeft( int n) { - if (sign == 0 || magnitude.Length == 0) + if (SignValue == 0 || magnitude.Length == 0) return Zero; if (n == 0) @@ -2413,19 +2312,15 @@ namespace TLSharp.Core.MTProto.Crypto if (n < 0) return ShiftRight(-n); - BigInteger result = new BigInteger(sign, ShiftLeft(magnitude, n), true); + var result = new BigInteger(SignValue, ShiftLeft(magnitude, n), true); - if (this.nBits != -1) - { - result.nBits = sign > 0 - ? this.nBits - : this.nBits + n; - } + if (nBits != -1) + result.nBits = SignValue > 0 + ? nBits + : nBits + n; - if (this.nBitLength != -1) - { - result.nBitLength = this.nBitLength + n; - } + if (nBitLength != -1) + result.nBitLength = nBitLength + n; return result; } @@ -2438,38 +2333,34 @@ namespace TLSharp.Core.MTProto.Crypto int[] mag, int n) { - int nInts = (int)((uint)n >> 5) + start; - int nBits = n & 0x1f; - int magEnd = mag.Length - 1; + var nInts = (int) ((uint) n >> 5) + start; + var nBits = n & 0x1f; + var magEnd = mag.Length - 1; if (nInts != start) { - int delta = (nInts - start); + var delta = nInts - start; - for (int i = magEnd; i >= nInts; i--) - { + for (var i = magEnd; i >= nInts; i--) mag[i] = mag[i - delta]; - } - for (int i = nInts - 1; i >= start; i--) - { + for (var i = nInts - 1; i >= start; i--) mag[i] = 0; - } } if (nBits != 0) { - int nBits2 = 32 - nBits; - int m = mag[magEnd]; + var nBits2 = 32 - nBits; + var m = mag[magEnd]; - for (int i = magEnd; i > nInts; --i) + for (var i = magEnd; i > nInts; --i) { - int next = mag[i - 1]; + var next = mag[i - 1]; - mag[i] = (int)((uint)m >> nBits) | (next << nBits2); + mag[i] = (int) ((uint) m >> nBits) | (next << nBits2); m = next; } - mag[nInts] = (int)((uint)mag[nInts] >> nBits); + mag[nInts] = (int) ((uint) mag[nInts] >> nBits); } } @@ -2480,17 +2371,17 @@ namespace TLSharp.Core.MTProto.Crypto int start, int[] mag) { - int i = mag.Length; - int m = mag[i - 1]; + var i = mag.Length; + var m = mag[i - 1]; while (--i > start) { - int next = mag[i - 1]; - mag[i] = ((int)((uint)m >> 1)) | (next << 31); + var next = mag[i - 1]; + mag[i] = (int) ((uint) m >> 1) | (next << 31); m = next; } - mag[start] = (int)((uint)mag[start] >> 1); + mag[start] = (int) ((uint) mag[start] >> 1); } public BigInteger ShiftRight( @@ -2503,7 +2394,7 @@ namespace TLSharp.Core.MTProto.Crypto return ShiftLeft(-n); if (n >= BitLength) - return (this.sign < 0 ? One.Negate() : Zero); + return SignValue < 0 ? One.Negate() : Zero; // int[] res = (int[]) this.magnitude.Clone(); // @@ -2511,39 +2402,33 @@ namespace TLSharp.Core.MTProto.Crypto // // return new BigInteger(this.sign, res, true); - int resultLength = (BitLength - n + 31) >> 5; - int[] res = new int[resultLength]; + var resultLength = (BitLength - n + 31) >> 5; + var res = new int[resultLength]; - int numInts = n >> 5; - int numBits = n & 31; + var numInts = n >> 5; + var numBits = n & 31; if (numBits == 0) { - Array.Copy(this.magnitude, 0, res, 0, res.Length); + Array.Copy(magnitude, 0, res, 0, res.Length); } - else { - int numBits2 = 32 - numBits; + else + { + var numBits2 = 32 - numBits; - int magPos = this.magnitude.Length - 1 - numInts; - for (int i = resultLength - 1; i >= 0; --i) + var magPos = magnitude.Length - 1 - numInts; + for (var i = resultLength - 1; i >= 0; --i) { - res[i] = (int)((uint)this.magnitude[magPos--] >> numBits); + res[i] = (int) ((uint) magnitude[magPos--] >> numBits); if (magPos >= 0) - { - res[i] |= this.magnitude[magPos] << numBits2; - } + res[i] |= magnitude[magPos] << numBits2; } } Debug.Assert(res[0] != 0); - return new BigInteger(this.sign, res, false); - } - - public int SignValue - { - get { return sign; } + return new BigInteger(SignValue, res, false); } /** @@ -2558,27 +2443,24 @@ namespace TLSharp.Core.MTProto.Crypto Debug.Assert(yStart < y.Length); Debug.Assert(x.Length - xStart >= y.Length - yStart); - int iT = x.Length; - int iV = y.Length; + var iT = x.Length; + var iV = y.Length; long m; - int borrow = 0; + var borrow = 0; do { m = (x[--iT] & IMASK) - (y[--iV] & IMASK) + borrow; - x[iT] = (int)m; + x[iT] = (int) m; // borrow = (m < 0) ? -1 : 0; - borrow = (int)(m >> 63); - } - while (iV > yStart); + borrow = (int) (m >> 63); + } while (iV > yStart); if (borrow != 0) - { while (--x[--iT] == -1) { } - } return x; } @@ -2586,16 +2468,16 @@ namespace TLSharp.Core.MTProto.Crypto public BigInteger Subtract( BigInteger n) { - if (n.sign == 0) + if (n.SignValue == 0) return this; - if (this.sign == 0) + if (SignValue == 0) return n.Negate(); - if (this.sign != n.sign) + if (SignValue != n.SignValue) return Add(n.Negate()); - int compare = CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude); + var compare = CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude); if (compare == 0) return Zero; @@ -2605,19 +2487,20 @@ namespace TLSharp.Core.MTProto.Crypto bigun = n; lilun = this; } - else { + else + { bigun = this; lilun = n; } - return new BigInteger(this.sign * compare, doSubBigLil(bigun.magnitude, lilun.magnitude), true); + return new BigInteger(SignValue * compare, doSubBigLil(bigun.magnitude, lilun.magnitude), true); } private static int[] doSubBigLil( int[] bigMag, int[] lilMag) { - int[] res = (int[])bigMag.Clone(); + var res = (int[]) bigMag.Clone(); return Subtract(0, res, 0, lilMag); } @@ -2635,78 +2518,71 @@ namespace TLSharp.Core.MTProto.Crypto private byte[] ToByteArray( bool unsigned) { - if (sign == 0) + if (SignValue == 0) return unsigned ? ZeroEncoding : new byte[1]; - int nBits = (unsigned && sign > 0) + var nBits = unsigned && SignValue > 0 ? BitLength : BitLength + 1; - int nBytes = GetByteLength(nBits); - byte[] bytes = new byte[nBytes]; + var nBytes = GetByteLength(nBits); + var bytes = new byte[nBytes]; - int magIndex = magnitude.Length; - int bytesIndex = bytes.Length; + var magIndex = magnitude.Length; + var bytesIndex = bytes.Length; - if (sign > 0) + if (SignValue > 0) { while (magIndex > 1) { - uint mag = (uint)magnitude[--magIndex]; - bytes[--bytesIndex] = (byte)mag; - bytes[--bytesIndex] = (byte)(mag >> 8); - bytes[--bytesIndex] = (byte)(mag >> 16); - bytes[--bytesIndex] = (byte)(mag >> 24); + var mag = (uint) magnitude[--magIndex]; + bytes[--bytesIndex] = (byte) mag; + bytes[--bytesIndex] = (byte) (mag >> 8); + bytes[--bytesIndex] = (byte) (mag >> 16); + bytes[--bytesIndex] = (byte) (mag >> 24); } - uint lastMag = (uint)magnitude[0]; + var lastMag = (uint) magnitude[0]; while (lastMag > byte.MaxValue) { - bytes[--bytesIndex] = (byte)lastMag; + bytes[--bytesIndex] = (byte) lastMag; lastMag >>= 8; } - bytes[--bytesIndex] = (byte)lastMag; + bytes[--bytesIndex] = (byte) lastMag; } else // sign < 0 { - bool carry = true; + var carry = true; while (magIndex > 1) { - uint mag = ~((uint)magnitude[--magIndex]); + var mag = ~(uint) magnitude[--magIndex]; if (carry) - { - carry = (++mag == uint.MinValue); - } + carry = ++mag == uint.MinValue; - bytes[--bytesIndex] = (byte)mag; - bytes[--bytesIndex] = (byte)(mag >> 8); - bytes[--bytesIndex] = (byte)(mag >> 16); - bytes[--bytesIndex] = (byte)(mag >> 24); + bytes[--bytesIndex] = (byte) mag; + bytes[--bytesIndex] = (byte) (mag >> 8); + bytes[--bytesIndex] = (byte) (mag >> 16); + bytes[--bytesIndex] = (byte) (mag >> 24); } - uint lastMag = (uint)magnitude[0]; + var lastMag = (uint) magnitude[0]; if (carry) - { - // Never wraps because magnitude[0] != 0 --lastMag; - } while (lastMag > byte.MaxValue) { - bytes[--bytesIndex] = (byte)~lastMag; + bytes[--bytesIndex] = (byte) ~lastMag; lastMag >>= 8; } - bytes[--bytesIndex] = (byte)~lastMag; + bytes[--bytesIndex] = (byte) ~lastMag; if (bytesIndex > 0) - { bytes[--bytesIndex] = byte.MaxValue; - } } return bytes; @@ -2736,35 +2612,32 @@ namespace TLSharp.Core.MTProto.Crypto if (magnitude == null) return "null"; - if (sign == 0) + if (SignValue == 0) return "0"; Debug.Assert(magnitude.Length > 0); - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); if (radix == 16) { sb.Append(magnitude[0].ToString("x")); - for (int i = 1; i < magnitude.Length; i++) - { + for (var i = 1; i < magnitude.Length; i++) sb.Append(magnitude[i].ToString("x8")); - } } else if (radix == 2) { sb.Append('1'); - for (int i = BitLength - 2; i >= 0; --i) - { + for (var i = BitLength - 2; i >= 0; --i) sb.Append(TestBit(i) ? '1' : '0'); - } } - else { + else + { // This is algorithm 1a from chapter 4.4 in Seminumerical Algorithms, slow but it works IList S = new List(); - BigInteger bs = ValueOf(radix); + var bs = ValueOf(radix); // The sign is handled separatly. // Notice however that for this to work, radix 16 _MUST_ be a special case, @@ -2772,47 +2645,40 @@ namespace TLSharp.Core.MTProto.Crypto // the Sun engineers made a c'tor for BigIntegers taking a BigInteger as parameter? // (Answer: Becuase Sun's BigIntger is clonable, something bouncycastle's isn't.) // BigInteger u = new BigInteger(Abs().ToString(16), 16); - BigInteger u = this.Abs(); + var u = Abs(); BigInteger b; - while (u.sign != 0) + while (u.SignValue != 0) { b = u.Mod(bs); - if (b.sign == 0) - { + if (b.SignValue == 0) S.Add("0"); - } - else { - // see how to interact with different bases - S.Add(b.magnitude[0].ToString("d")); - } + else S.Add(b.magnitude[0].ToString("d")); u = u.Divide(bs); } // Then pop the stack - for (int i = S.Count - 1; i >= 0; --i) - { - sb.Append((string)S[i]); - } + for (var i = S.Count - 1; i >= 0; --i) + sb.Append((string) S[i]); } - string s = sb.ToString(); + var s = sb.ToString(); Debug.Assert(s.Length > 0); // Strip leading zeros. (We know this number is not all zeroes though) if (s[0] == '0') { - int nonZeroPos = 0; - while (s[++nonZeroPos] == '0') { } + var nonZeroPos = 0; + while (s[++nonZeroPos] == '0') + { + } s = s.Substring(nonZeroPos); } - if (sign == -1) - { + if (SignValue == -1) s = "-" + s; - } return s; } @@ -2820,20 +2686,18 @@ namespace TLSharp.Core.MTProto.Crypto private static BigInteger createUValueOf( ulong value) { - int msw = (int)(value >> 32); - int lsw = (int)value; + var msw = (int) (value >> 32); + var lsw = (int) value; if (msw != 0) - return new BigInteger(1, new int[] { msw, lsw }, false); + return new BigInteger(1, new[] {msw, lsw}, false); if (lsw != 0) { - BigInteger n = new BigInteger(1, new int[] { lsw }, false); + var n = new BigInteger(1, new[] {lsw}, false); // Check for a power of two if ((lsw & -lsw) == lsw) - { n.nBits = 1; - } return n; } @@ -2851,7 +2715,7 @@ namespace TLSharp.Core.MTProto.Crypto return createValueOf(-value).Negate(); } - return createUValueOf((ulong)value); + return createUValueOf((ulong) value); // // store value into a byte array // byte[] b = new byte[8]; @@ -2886,21 +2750,19 @@ namespace TLSharp.Core.MTProto.Crypto public int GetLowestSetBit() { - if (this.sign == 0) + if (SignValue == 0) return -1; - int w = magnitude.Length; + var w = magnitude.Length; while (--w > 0) - { if (magnitude[w] != 0) break; - } - int word = (int)magnitude[w]; + var word = magnitude[w]; Debug.Assert(word != 0); - int b = (word & 0x0000FFFF) == 0 + var b = (word & 0x0000FFFF) == 0 ? (word & 0x00FF0000) == 0 ? 7 : 15 @@ -2910,13 +2772,13 @@ namespace TLSharp.Core.MTProto.Crypto while (b > 0) { - if ((word << b) == int.MinValue) + if (word << b == int.MinValue) break; b--; } - return ((magnitude.Length - w) * 32 - (b + 1)); + return (magnitude.Length - w) * 32 - (b + 1); } public bool TestBit( @@ -2925,71 +2787,63 @@ namespace TLSharp.Core.MTProto.Crypto if (n < 0) throw new ArithmeticException("Bit position must not be negative"); - if (sign < 0) + if (SignValue < 0) return !Not().TestBit(n); - int wordNum = n / 32; + var wordNum = n / 32; if (wordNum >= magnitude.Length) return false; - int word = magnitude[magnitude.Length - 1 - wordNum]; + var word = magnitude[magnitude.Length - 1 - wordNum]; return ((word >> (n % 32)) & 1) > 0; } public BigInteger Or( BigInteger value) { - if (this.sign == 0) + if (SignValue == 0) return value; - if (value.sign == 0) + if (value.SignValue == 0) return this; - int[] aMag = this.sign > 0 - ? this.magnitude + var aMag = SignValue > 0 + ? magnitude : Add(One).magnitude; - int[] bMag = value.sign > 0 + var bMag = value.SignValue > 0 ? value.magnitude : value.Add(One).magnitude; - bool resultNeg = sign < 0 || value.sign < 0; - int resultLength = System.Math.Max(aMag.Length, bMag.Length); - int[] resultMag = new int[resultLength]; + var resultNeg = SignValue < 0 || value.SignValue < 0; + var resultLength = Math.Max(aMag.Length, bMag.Length); + var resultMag = new int[resultLength]; - int aStart = resultMag.Length - aMag.Length; - int bStart = resultMag.Length - bMag.Length; + var aStart = resultMag.Length - aMag.Length; + var bStart = resultMag.Length - bMag.Length; - for (int i = 0; i < resultMag.Length; ++i) + for (var i = 0; i < resultMag.Length; ++i) { - int aWord = i >= aStart ? aMag[i - aStart] : 0; - int bWord = i >= bStart ? bMag[i - bStart] : 0; + var aWord = i >= aStart ? aMag[i - aStart] : 0; + var bWord = i >= bStart ? bMag[i - bStart] : 0; - if (this.sign < 0) - { + if (SignValue < 0) aWord = ~aWord; - } - if (value.sign < 0) - { + if (value.SignValue < 0) bWord = ~bWord; - } resultMag[i] = aWord | bWord; if (resultNeg) - { resultMag[i] = ~resultMag[i]; - } } - BigInteger result = new BigInteger(1, resultMag, true); + var result = new BigInteger(1, resultMag, true); // TODO Optimise this case if (resultNeg) - { result = result.Not(); - } return result; } @@ -2997,58 +2851,50 @@ namespace TLSharp.Core.MTProto.Crypto public BigInteger Xor( BigInteger value) { - if (this.sign == 0) + if (SignValue == 0) return value; - if (value.sign == 0) + if (value.SignValue == 0) return this; - int[] aMag = this.sign > 0 - ? this.magnitude + var aMag = SignValue > 0 + ? magnitude : Add(One).magnitude; - int[] bMag = value.sign > 0 + var bMag = value.SignValue > 0 ? value.magnitude : value.Add(One).magnitude; // TODO Can just replace with sign != value.sign? - bool resultNeg = (sign < 0 && value.sign >= 0) || (sign >= 0 && value.sign < 0); - int resultLength = System.Math.Max(aMag.Length, bMag.Length); - int[] resultMag = new int[resultLength]; + var resultNeg = SignValue < 0 && value.SignValue >= 0 || SignValue >= 0 && value.SignValue < 0; + var resultLength = Math.Max(aMag.Length, bMag.Length); + var resultMag = new int[resultLength]; - int aStart = resultMag.Length - aMag.Length; - int bStart = resultMag.Length - bMag.Length; + var aStart = resultMag.Length - aMag.Length; + var bStart = resultMag.Length - bMag.Length; - for (int i = 0; i < resultMag.Length; ++i) + for (var i = 0; i < resultMag.Length; ++i) { - int aWord = i >= aStart ? aMag[i - aStart] : 0; - int bWord = i >= bStart ? bMag[i - bStart] : 0; + var aWord = i >= aStart ? aMag[i - aStart] : 0; + var bWord = i >= bStart ? bMag[i - bStart] : 0; - if (this.sign < 0) - { + if (SignValue < 0) aWord = ~aWord; - } - if (value.sign < 0) - { + if (value.SignValue < 0) bWord = ~bWord; - } resultMag[i] = aWord ^ bWord; if (resultNeg) - { resultMag[i] = ~resultMag[i]; - } } - BigInteger result = new BigInteger(1, resultMag, true); + var result = new BigInteger(1, resultMag, true); // TODO Optimise this case if (resultNeg) - { result = result.Not(); - } return result; } @@ -3063,7 +2909,7 @@ namespace TLSharp.Core.MTProto.Crypto return this; // TODO Handle negative values and zero - if (sign > 0 && n < (BitLength - 1)) + if (SignValue > 0 && n < BitLength - 1) return FlipExistingBit(n); return Or(One.ShiftLeft(n)); @@ -3079,7 +2925,7 @@ namespace TLSharp.Core.MTProto.Crypto return this; // TODO Handle negative values - if (sign > 0 && n < (BitLength - 1)) + if (SignValue > 0 && n < BitLength - 1) return FlipExistingBit(n); return AndNot(One.ShiftLeft(n)); @@ -3092,7 +2938,7 @@ namespace TLSharp.Core.MTProto.Crypto throw new ArithmeticException("Bit address less than zero"); // TODO Handle negative values and zero - if (sign > 0 && n < (BitLength - 1)) + if (SignValue > 0 && n < BitLength - 1) return FlipExistingBit(n); return Xor(One.ShiftLeft(n)); @@ -3101,14 +2947,14 @@ namespace TLSharp.Core.MTProto.Crypto private BigInteger FlipExistingBit( int n) { - Debug.Assert(sign > 0); + Debug.Assert(SignValue > 0); Debug.Assert(n >= 0); Debug.Assert(n < BitLength - 1); - int[] mag = (int[])this.magnitude.Clone(); - mag[mag.Length - 1 - (n >> 5)] ^= (1 << (n & 31)); // Flip bit + var mag = (int[]) magnitude.Clone(); + mag[mag.Length - 1 - (n >> 5)] ^= 1 << (n & 31); // Flip bit //mag[mag.Length - 1 - (n / 32)] ^= (1 << (n % 32)); - return new BigInteger(this.sign, mag, false); + return new BigInteger(SignValue, mag, false); } } } \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/Crc32.cs b/TLSharp.Core/MTProto/Crypto/Crc32.cs index c22f851..c5a5eab 100644 --- a/TLSharp.Core/MTProto/Crypto/Crc32.cs +++ b/TLSharp.Core/MTProto/Crypto/Crc32.cs @@ -1,22 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using Ionic.Crc; +using System.Security.Cryptography; namespace TLSharp.Core.MTProto.Crypto { public class Crc32 : HashAlgorithm { - public const UInt32 DefaultPolynomial = 0xedb88320u; - public const UInt32 DefaultSeed = 0xffffffffu; + public const uint DefaultPolynomial = 0xedb88320u; + public const uint DefaultSeed = 0xffffffffu; + private static uint[] defaultTable; - private UInt32 hash; - private UInt32 seed; - private UInt32[] table; - private static UInt32[] defaultTable; + private uint hash; + private readonly uint seed; + private readonly uint[] table; public Crc32() { @@ -25,13 +19,15 @@ namespace TLSharp.Core.MTProto.Crypto hash = seed; } - public Crc32(UInt32 polynomial, UInt32 seed) + public Crc32(uint polynomial, uint seed) { table = InitializeTable(polynomial); this.seed = seed; hash = seed; } + public override int HashSize => 32; + public override void Initialize() { hash = seed; @@ -43,46 +39,41 @@ namespace TLSharp.Core.MTProto.Crypto } /// - /// Возвращает хеш в BigEndian + /// Возвращает хеш в BigEndian /// /// protected override byte[] HashFinal() { - byte[] hashBuffer = UInt32ToBigEndianBytes(~hash); - this.HashValue = hashBuffer; + var hashBuffer = UInt32ToBigEndianBytes(~hash); + HashValue = hashBuffer; return hashBuffer; } - public override int HashSize - { - get { return 32; } - } - - public static UInt32 Compute(byte[] buffer) + public static uint Compute(byte[] buffer) { return ~CalculateHash(InitializeTable(DefaultPolynomial), DefaultSeed, buffer, 0, buffer.Length); } - public static UInt32 Compute(UInt32 seed, byte[] buffer) + public static uint Compute(uint seed, byte[] buffer) { return ~CalculateHash(InitializeTable(DefaultPolynomial), seed, buffer, 0, buffer.Length); } - public static UInt32 Compute(UInt32 polynomial, UInt32 seed, byte[] buffer) + public static uint Compute(uint polynomial, uint seed, byte[] buffer) { return ~CalculateHash(InitializeTable(polynomial), seed, buffer, 0, buffer.Length); } - private static UInt32[] InitializeTable(UInt32 polynomial) + private static uint[] InitializeTable(uint polynomial) { if (polynomial == DefaultPolynomial && defaultTable != null) return defaultTable; - UInt32[] createTable = new UInt32[256]; - for (int i = 0; i < 256; i++) + var createTable = new uint[256]; + for (var i = 0; i < 256; i++) { - UInt32 entry = (UInt32)i; - for (int j = 0; j < 8; j++) + var entry = (uint) i; + for (var j = 0; j < 8; j++) if ((entry & 1) == 1) entry = (entry >> 1) ^ polynomial; else @@ -96,25 +87,26 @@ namespace TLSharp.Core.MTProto.Crypto return createTable; } - private static UInt32 CalculateHash(UInt32[] table, UInt32 seed, byte[] buffer, int start, int size) + private static uint CalculateHash(uint[] table, uint seed, byte[] buffer, int start, int size) { - UInt32 crc = seed; - for (int i = start; i < size; i++) + var crc = seed; + for (var i = start; i < size; i++) unchecked { - crc = (crc >> 8) ^ table[buffer[i] ^ crc & 0xff]; + crc = (crc >> 8) ^ table[buffer[i] ^ (crc & 0xff)]; } return crc; } - private byte[] UInt32ToBigEndianBytes(UInt32 x) + private byte[] UInt32ToBigEndianBytes(uint x) { - return new byte[] { - (byte)((x >> 24) & 0xff), - (byte)((x >> 16) & 0xff), - (byte)((x >> 8) & 0xff), - (byte)(x & 0xff) + return new[] + { + (byte) ((x >> 24) & 0xff), + (byte) ((x >> 16) & 0xff), + (byte) ((x >> 8) & 0xff), + (byte) (x & 0xff) }; } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/Factorizator.cs b/TLSharp.Core/MTProto/Crypto/Factorizator.cs index 5a52de7..c1a0303 100644 --- a/TLSharp.Core/MTProto/Crypto/Factorizator.cs +++ b/TLSharp.Core/MTProto/Crypto/Factorizator.cs @@ -19,39 +19,29 @@ namespace TLSharp.Core.MTProto.Crypto this.q = BigInteger.ValueOf(q); } - public BigInteger Min - { - get - { - return p.Min(q); - } - } + public BigInteger Min => p.Min(q); - public BigInteger Max - { - get - { - return p.Max(q); - } - } + public BigInteger Max => p.Max(q); public override string ToString() { return string.Format("P: {0}, Q: {1}", p, q); } } + public class Factorizator { public static Random random = new Random(); + public static long findSmallMultiplierLopatin(long what) { long g = 0; - for (int i = 0; i < 3; i++) + for (var i = 0; i < 3; i++) { - int q = (random.Next(128) & 15) + 17; + var q = (random.Next(128) & 15) + 17; long x = random.Next(1000000000) + 1, y = x; - int lim = 1 << (i + 18); - for (int j = 1; j < lim; j++) + var lim = 1 << (i + 18); + for (var j = 1; j < lim; j++) { long a = x, b = x, c = q; while (b != 0) @@ -60,36 +50,26 @@ namespace TLSharp.Core.MTProto.Crypto { c += a; if (c >= what) - { c -= what; - } } a += a; if (a >= what) - { a -= what; - } b >>= 1; } x = c; - long z = x < y ? y - x : x - y; + var z = x < y ? y - x : x - y; g = GCD(z, what); if (g != 1) - { break; - } if ((j & (j - 1)) == 0) - { y = x; - } } if (g > 1) - { break; - } } - long p = what / g; + var p = what / g; return Math.Min(p, g); } @@ -98,20 +78,12 @@ namespace TLSharp.Core.MTProto.Crypto while (a != 0 && b != 0) { while ((b & 1) == 0) - { b >>= 1; - } while ((a & 1) == 0) - { a >>= 1; - } if (a > b) - { a -= b; - } - else { - b -= a; - } + else b -= a; } return b == 0 ? a : b; } @@ -120,19 +92,14 @@ namespace TLSharp.Core.MTProto.Crypto { if (pq.BitLength < 64) { - long pqlong = pq.LongValue; - long divisor = findSmallMultiplierLopatin(pqlong); + var pqlong = pq.LongValue; + var divisor = findSmallMultiplierLopatin(pqlong); return new FactorizedPair(BigInteger.ValueOf(divisor), BigInteger.ValueOf(pqlong / divisor)); } - else { - // TODO: port pollard factorization - throw new InvalidOperationException("pq too long; TODO: port the pollard algo"); - // logger.error("pq too long; TODO: port the pollard algo"); - // return null; - } + // TODO: port pollard factorization + throw new InvalidOperationException("pq too long; TODO: port the pollard algo"); + // logger.error("pq too long; TODO: port the pollard algo"); + // return null; } - } - - -} +} \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/MD5Digest.cs b/TLSharp.Core/MTProto/Crypto/MD5Digest.cs index f7ae345..8b910ee 100644 --- a/TLSharp.Core/MTProto/Crypto/MD5Digest.cs +++ b/TLSharp.Core/MTProto/Crypto/MD5Digest.cs @@ -59,6 +59,7 @@ namespace TLSharp.Core.MTProto.Crypto public class MD5 { + private readonly MD5Digest digest = new MD5Digest(); public static string GetMd5String(string data) { @@ -67,16 +68,14 @@ namespace TLSharp.Core.MTProto.Crypto public static byte[] GetMd5Bytes(byte[] data) { - MD5Digest digest = new MD5Digest(); + var digest = new MD5Digest(); digest.BlockUpdate(data, 0, data.Length); - byte[] hash = new byte[16]; + var hash = new byte[16]; digest.DoFinal(hash, 0); return hash; } - private MD5Digest digest = new MD5Digest(); - public void Update(byte[] chunk) { digest.BlockUpdate(chunk, 0, chunk.Length); @@ -89,7 +88,7 @@ namespace TLSharp.Core.MTProto.Crypto public string FinalString() { - byte[] hash = new byte[16]; + var hash = new byte[16]; digest.DoFinal(hash, 0); return BitConverter.ToString(hash).Replace("-", "").ToLower(); } @@ -140,7 +139,7 @@ namespace TLSharp.Core.MTProto.Crypto // // fill the current word // - while ((xBufOff != 0) && (length > 0)) + while (xBufOff != 0 && length > 0) { Update(input[inOff]); inOff++; @@ -189,7 +188,7 @@ namespace TLSharp.Core.MTProto.Crypto public void Finish() { - long bitLength = (byteCount << 3); + var bitLength = byteCount << 3; // // add the pad bytes. @@ -215,6 +214,7 @@ namespace TLSharp.Core.MTProto.Crypto // round 1 left rotates // private static readonly int S11 = 7; + private static readonly int S12 = 12; private static readonly int S13 = 17; private static readonly int S14 = 22; @@ -223,6 +223,7 @@ namespace TLSharp.Core.MTProto.Crypto // round 2 left rotates // private static readonly int S21 = 5; + private static readonly int S22 = 9; private static readonly int S23 = 14; private static readonly int S24 = 20; @@ -231,6 +232,7 @@ namespace TLSharp.Core.MTProto.Crypto // round 3 left rotates // private static readonly int S31 = 4; + private static readonly int S32 = 11; private static readonly int S33 = 16; private static readonly int S34 = 23; @@ -239,6 +241,7 @@ namespace TLSharp.Core.MTProto.Crypto // round 4 left rotates // private static readonly int S41 = 6; + private static readonly int S42 = 10; private static readonly int S43 = 15; private static readonly int S44 = 21; @@ -268,10 +271,7 @@ namespace TLSharp.Core.MTProto.Crypto xOff = t.xOff; } - public override string AlgorithmName - { - get { return "MD5"; } - } + public override string AlgorithmName => "MD5"; public override int GetDigestSize() { @@ -286,21 +286,17 @@ namespace TLSharp.Core.MTProto.Crypto | ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24); if (xOff == 16) - { ProcessBlock(); - } } internal override void ProcessLength( long bitLength) { if (xOff > 14) - { ProcessBlock(); - } - X[14] = (int)(bitLength & 0xffffffff); - X[15] = (int)((ulong)bitLength >> 32); + X[14] = (int) (bitLength & 0xffffffff); + X[15] = (int) ((ulong) bitLength >> 32); } private void UnpackWord( @@ -308,10 +304,10 @@ namespace TLSharp.Core.MTProto.Crypto byte[] outBytes, int outOff) { - outBytes[outOff] = (byte)word; - outBytes[outOff + 1] = (byte)((uint)word >> 8); - outBytes[outOff + 2] = (byte)((uint)word >> 16); - outBytes[outOff + 3] = (byte)((uint)word >> 24); + outBytes[outOff] = (byte) word; + outBytes[outOff + 1] = (byte) ((uint) word >> 8); + outBytes[outOff + 2] = (byte) ((uint) word >> 16); + outBytes[outOff + 3] = (byte) ((uint) word >> 24); } public override int DoFinal( @@ -338,17 +334,15 @@ namespace TLSharp.Core.MTProto.Crypto { base.Reset(); - H1 = unchecked(0x67452301); - H2 = unchecked((int)0xefcdab89); - H3 = unchecked((int)0x98badcfe); - H4 = unchecked(0x10325476); + H1 = 0x67452301; + H2 = unchecked((int) 0xefcdab89); + H3 = unchecked((int) 0x98badcfe); + H4 = 0x10325476; xOff = 0; - for (int i = 0; i != X.Length; i++) - { + for (var i = 0; i != X.Length; i++) X[i] = 0; - } } /* @@ -359,7 +353,7 @@ namespace TLSharp.Core.MTProto.Crypto int x, int n) { - return (x << n) | (int)((uint)x >> (32 - n)); + return (x << n) | (int) ((uint) x >> (32 - n)); } /* @@ -400,90 +394,90 @@ namespace TLSharp.Core.MTProto.Crypto internal override void ProcessBlock() { - int a = H1; - int b = H2; - int c = H3; - int d = H4; + var a = H1; + var b = H2; + var c = H3; + var d = H4; // // Round 1 - F cycle, 16 times. // - a = RotateLeft((a + F(b, c, d) + X[0] + unchecked((int)0xd76aa478)), S11) + b; - d = RotateLeft((d + F(a, b, c) + X[1] + unchecked((int)0xe8c7b756)), S12) + a; - c = RotateLeft((c + F(d, a, b) + X[2] + unchecked(0x242070db)), S13) + d; - b = RotateLeft((b + F(c, d, a) + X[3] + unchecked((int)0xc1bdceee)), S14) + c; - a = RotateLeft((a + F(b, c, d) + X[4] + unchecked((int)0xf57c0faf)), S11) + b; - d = RotateLeft((d + F(a, b, c) + X[5] + unchecked(0x4787c62a)), S12) + a; - c = RotateLeft((c + F(d, a, b) + X[6] + unchecked((int)0xa8304613)), S13) + d; - b = RotateLeft((b + F(c, d, a) + X[7] + unchecked((int)0xfd469501)), S14) + c; - a = RotateLeft((a + F(b, c, d) + X[8] + unchecked(0x698098d8)), S11) + b; - d = RotateLeft((d + F(a, b, c) + X[9] + unchecked((int)0x8b44f7af)), S12) + a; - c = RotateLeft((c + F(d, a, b) + X[10] + unchecked((int)0xffff5bb1)), S13) + d; - b = RotateLeft((b + F(c, d, a) + X[11] + unchecked((int)0x895cd7be)), S14) + c; - a = RotateLeft((a + F(b, c, d) + X[12] + unchecked(0x6b901122)), S11) + b; - d = RotateLeft((d + F(a, b, c) + X[13] + unchecked((int)0xfd987193)), S12) + a; - c = RotateLeft((c + F(d, a, b) + X[14] + unchecked((int)0xa679438e)), S13) + d; - b = RotateLeft((b + F(c, d, a) + X[15] + unchecked(0x49b40821)), S14) + c; + a = RotateLeft(a + F(b, c, d) + X[0] + unchecked((int) 0xd76aa478), S11) + b; + d = RotateLeft(d + F(a, b, c) + X[1] + unchecked((int) 0xe8c7b756), S12) + a; + c = RotateLeft(c + F(d, a, b) + X[2] + 0x242070db, S13) + d; + b = RotateLeft(b + F(c, d, a) + X[3] + unchecked((int) 0xc1bdceee), S14) + c; + a = RotateLeft(a + F(b, c, d) + X[4] + unchecked((int) 0xf57c0faf), S11) + b; + d = RotateLeft(d + F(a, b, c) + X[5] + 0x4787c62a, S12) + a; + c = RotateLeft(c + F(d, a, b) + X[6] + unchecked((int) 0xa8304613), S13) + d; + b = RotateLeft(b + F(c, d, a) + X[7] + unchecked((int) 0xfd469501), S14) + c; + a = RotateLeft(a + F(b, c, d) + X[8] + 0x698098d8, S11) + b; + d = RotateLeft(d + F(a, b, c) + X[9] + unchecked((int) 0x8b44f7af), S12) + a; + c = RotateLeft(c + F(d, a, b) + X[10] + unchecked((int) 0xffff5bb1), S13) + d; + b = RotateLeft(b + F(c, d, a) + X[11] + unchecked((int) 0x895cd7be), S14) + c; + a = RotateLeft(a + F(b, c, d) + X[12] + 0x6b901122, S11) + b; + d = RotateLeft(d + F(a, b, c) + X[13] + unchecked((int) 0xfd987193), S12) + a; + c = RotateLeft(c + F(d, a, b) + X[14] + unchecked((int) 0xa679438e), S13) + d; + b = RotateLeft(b + F(c, d, a) + X[15] + 0x49b40821, S14) + c; // // Round 2 - G cycle, 16 times. // - a = RotateLeft((a + G(b, c, d) + X[1] + unchecked((int)0xf61e2562)), S21) + b; - d = RotateLeft((d + G(a, b, c) + X[6] + unchecked((int)0xc040b340)), S22) + a; - c = RotateLeft((c + G(d, a, b) + X[11] + unchecked(0x265e5a51)), S23) + d; - b = RotateLeft((b + G(c, d, a) + X[0] + unchecked((int)0xe9b6c7aa)), S24) + c; - a = RotateLeft((a + G(b, c, d) + X[5] + unchecked((int)0xd62f105d)), S21) + b; - d = RotateLeft((d + G(a, b, c) + X[10] + unchecked(0x02441453)), S22) + a; - c = RotateLeft((c + G(d, a, b) + X[15] + unchecked((int)0xd8a1e681)), S23) + d; - b = RotateLeft((b + G(c, d, a) + X[4] + unchecked((int)0xe7d3fbc8)), S24) + c; - a = RotateLeft((a + G(b, c, d) + X[9] + unchecked(0x21e1cde6)), S21) + b; - d = RotateLeft((d + G(a, b, c) + X[14] + unchecked((int)0xc33707d6)), S22) + a; - c = RotateLeft((c + G(d, a, b) + X[3] + unchecked((int)0xf4d50d87)), S23) + d; - b = RotateLeft((b + G(c, d, a) + X[8] + unchecked(0x455a14ed)), S24) + c; - a = RotateLeft((a + G(b, c, d) + X[13] + unchecked((int)0xa9e3e905)), S21) + b; - d = RotateLeft((d + G(a, b, c) + X[2] + unchecked((int)0xfcefa3f8)), S22) + a; - c = RotateLeft((c + G(d, a, b) + X[7] + unchecked(0x676f02d9)), S23) + d; - b = RotateLeft((b + G(c, d, a) + X[12] + unchecked((int)0x8d2a4c8a)), S24) + c; + a = RotateLeft(a + G(b, c, d) + X[1] + unchecked((int) 0xf61e2562), S21) + b; + d = RotateLeft(d + G(a, b, c) + X[6] + unchecked((int) 0xc040b340), S22) + a; + c = RotateLeft(c + G(d, a, b) + X[11] + 0x265e5a51, S23) + d; + b = RotateLeft(b + G(c, d, a) + X[0] + unchecked((int) 0xe9b6c7aa), S24) + c; + a = RotateLeft(a + G(b, c, d) + X[5] + unchecked((int) 0xd62f105d), S21) + b; + d = RotateLeft(d + G(a, b, c) + X[10] + 0x02441453, S22) + a; + c = RotateLeft(c + G(d, a, b) + X[15] + unchecked((int) 0xd8a1e681), S23) + d; + b = RotateLeft(b + G(c, d, a) + X[4] + unchecked((int) 0xe7d3fbc8), S24) + c; + a = RotateLeft(a + G(b, c, d) + X[9] + 0x21e1cde6, S21) + b; + d = RotateLeft(d + G(a, b, c) + X[14] + unchecked((int) 0xc33707d6), S22) + a; + c = RotateLeft(c + G(d, a, b) + X[3] + unchecked((int) 0xf4d50d87), S23) + d; + b = RotateLeft(b + G(c, d, a) + X[8] + 0x455a14ed, S24) + c; + a = RotateLeft(a + G(b, c, d) + X[13] + unchecked((int) 0xa9e3e905), S21) + b; + d = RotateLeft(d + G(a, b, c) + X[2] + unchecked((int) 0xfcefa3f8), S22) + a; + c = RotateLeft(c + G(d, a, b) + X[7] + 0x676f02d9, S23) + d; + b = RotateLeft(b + G(c, d, a) + X[12] + unchecked((int) 0x8d2a4c8a), S24) + c; // // Round 3 - H cycle, 16 times. // - a = RotateLeft((a + H(b, c, d) + X[5] + unchecked((int)0xfffa3942)), S31) + b; - d = RotateLeft((d + H(a, b, c) + X[8] + unchecked((int)0x8771f681)), S32) + a; - c = RotateLeft((c + H(d, a, b) + X[11] + unchecked(0x6d9d6122)), S33) + d; - b = RotateLeft((b + H(c, d, a) + X[14] + unchecked((int)0xfde5380c)), S34) + c; - a = RotateLeft((a + H(b, c, d) + X[1] + unchecked((int)0xa4beea44)), S31) + b; - d = RotateLeft((d + H(a, b, c) + X[4] + unchecked(0x4bdecfa9)), S32) + a; - c = RotateLeft((c + H(d, a, b) + X[7] + unchecked((int)0xf6bb4b60)), S33) + d; - b = RotateLeft((b + H(c, d, a) + X[10] + unchecked((int)0xbebfbc70)), S34) + c; - a = RotateLeft((a + H(b, c, d) + X[13] + unchecked(0x289b7ec6)), S31) + b; - d = RotateLeft((d + H(a, b, c) + X[0] + unchecked((int)0xeaa127fa)), S32) + a; - c = RotateLeft((c + H(d, a, b) + X[3] + unchecked((int)0xd4ef3085)), S33) + d; - b = RotateLeft((b + H(c, d, a) + X[6] + unchecked(0x04881d05)), S34) + c; - a = RotateLeft((a + H(b, c, d) + X[9] + unchecked((int)0xd9d4d039)), S31) + b; - d = RotateLeft((d + H(a, b, c) + X[12] + unchecked((int)0xe6db99e5)), S32) + a; - c = RotateLeft((c + H(d, a, b) + X[15] + unchecked(0x1fa27cf8)), S33) + d; - b = RotateLeft((b + H(c, d, a) + X[2] + unchecked((int)0xc4ac5665)), S34) + c; + a = RotateLeft(a + H(b, c, d) + X[5] + unchecked((int) 0xfffa3942), S31) + b; + d = RotateLeft(d + H(a, b, c) + X[8] + unchecked((int) 0x8771f681), S32) + a; + c = RotateLeft(c + H(d, a, b) + X[11] + 0x6d9d6122, S33) + d; + b = RotateLeft(b + H(c, d, a) + X[14] + unchecked((int) 0xfde5380c), S34) + c; + a = RotateLeft(a + H(b, c, d) + X[1] + unchecked((int) 0xa4beea44), S31) + b; + d = RotateLeft(d + H(a, b, c) + X[4] + 0x4bdecfa9, S32) + a; + c = RotateLeft(c + H(d, a, b) + X[7] + unchecked((int) 0xf6bb4b60), S33) + d; + b = RotateLeft(b + H(c, d, a) + X[10] + unchecked((int) 0xbebfbc70), S34) + c; + a = RotateLeft(a + H(b, c, d) + X[13] + 0x289b7ec6, S31) + b; + d = RotateLeft(d + H(a, b, c) + X[0] + unchecked((int) 0xeaa127fa), S32) + a; + c = RotateLeft(c + H(d, a, b) + X[3] + unchecked((int) 0xd4ef3085), S33) + d; + b = RotateLeft(b + H(c, d, a) + X[6] + 0x04881d05, S34) + c; + a = RotateLeft(a + H(b, c, d) + X[9] + unchecked((int) 0xd9d4d039), S31) + b; + d = RotateLeft(d + H(a, b, c) + X[12] + unchecked((int) 0xe6db99e5), S32) + a; + c = RotateLeft(c + H(d, a, b) + X[15] + 0x1fa27cf8, S33) + d; + b = RotateLeft(b + H(c, d, a) + X[2] + unchecked((int) 0xc4ac5665), S34) + c; // // Round 4 - K cycle, 16 times. // - a = RotateLeft((a + K(b, c, d) + X[0] + unchecked((int)0xf4292244)), S41) + b; - d = RotateLeft((d + K(a, b, c) + X[7] + unchecked(0x432aff97)), S42) + a; - c = RotateLeft((c + K(d, a, b) + X[14] + unchecked((int)0xab9423a7)), S43) + d; - b = RotateLeft((b + K(c, d, a) + X[5] + unchecked((int)0xfc93a039)), S44) + c; - a = RotateLeft((a + K(b, c, d) + X[12] + unchecked(0x655b59c3)), S41) + b; - d = RotateLeft((d + K(a, b, c) + X[3] + unchecked((int)0x8f0ccc92)), S42) + a; - c = RotateLeft((c + K(d, a, b) + X[10] + unchecked((int)0xffeff47d)), S43) + d; - b = RotateLeft((b + K(c, d, a) + X[1] + unchecked((int)0x85845dd1)), S44) + c; - a = RotateLeft((a + K(b, c, d) + X[8] + unchecked(0x6fa87e4f)), S41) + b; - d = RotateLeft((d + K(a, b, c) + X[15] + unchecked((int)0xfe2ce6e0)), S42) + a; - c = RotateLeft((c + K(d, a, b) + X[6] + unchecked((int)0xa3014314)), S43) + d; - b = RotateLeft((b + K(c, d, a) + X[13] + unchecked(0x4e0811a1)), S44) + c; - a = RotateLeft((a + K(b, c, d) + X[4] + unchecked((int)0xf7537e82)), S41) + b; - d = RotateLeft((d + K(a, b, c) + X[11] + unchecked((int)0xbd3af235)), S42) + a; - c = RotateLeft((c + K(d, a, b) + X[2] + unchecked(0x2ad7d2bb)), S43) + d; - b = RotateLeft((b + K(c, d, a) + X[9] + unchecked((int)0xeb86d391)), S44) + c; + a = RotateLeft(a + K(b, c, d) + X[0] + unchecked((int) 0xf4292244), S41) + b; + d = RotateLeft(d + K(a, b, c) + X[7] + 0x432aff97, S42) + a; + c = RotateLeft(c + K(d, a, b) + X[14] + unchecked((int) 0xab9423a7), S43) + d; + b = RotateLeft(b + K(c, d, a) + X[5] + unchecked((int) 0xfc93a039), S44) + c; + a = RotateLeft(a + K(b, c, d) + X[12] + 0x655b59c3, S41) + b; + d = RotateLeft(d + K(a, b, c) + X[3] + unchecked((int) 0x8f0ccc92), S42) + a; + c = RotateLeft(c + K(d, a, b) + X[10] + unchecked((int) 0xffeff47d), S43) + d; + b = RotateLeft(b + K(c, d, a) + X[1] + unchecked((int) 0x85845dd1), S44) + c; + a = RotateLeft(a + K(b, c, d) + X[8] + 0x6fa87e4f, S41) + b; + d = RotateLeft(d + K(a, b, c) + X[15] + unchecked((int) 0xfe2ce6e0), S42) + a; + c = RotateLeft(c + K(d, a, b) + X[6] + unchecked((int) 0xa3014314), S43) + d; + b = RotateLeft(b + K(c, d, a) + X[13] + 0x4e0811a1, S44) + c; + a = RotateLeft(a + K(b, c, d) + X[4] + unchecked((int) 0xf7537e82), S41) + b; + d = RotateLeft(d + K(a, b, c) + X[11] + unchecked((int) 0xbd3af235), S42) + a; + c = RotateLeft(c + K(d, a, b) + X[2] + 0x2ad7d2bb, S43) + d; + b = RotateLeft(b + K(c, d, a) + X[9] + unchecked((int) 0xeb86d391), S44) + c; H1 += a; H2 += b; @@ -494,10 +488,8 @@ namespace TLSharp.Core.MTProto.Crypto // reset the offset and clean out the word buffer. // xOff = 0; - for (int i = 0; i != X.Length; i++) - { + for (var i = 0; i != X.Length; i++) X[i] = 0; - } } } } \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/RSA.cs b/TLSharp.Core/MTProto/Crypto/RSA.cs index 55cbcb0..6ca52c5 100644 --- a/TLSharp.Core/MTProto/Crypto/RSA.cs +++ b/TLSharp.Core/MTProto/Crypto/RSA.cs @@ -5,13 +5,12 @@ using System.Security.Cryptography; namespace TLSharp.Core.MTProto.Crypto { - - class RSAServerKey + internal class RSAServerKey { + private readonly BigInteger e; private string fingerprint; - private BigInteger m; - private BigInteger e; + private readonly BigInteger m; public RSAServerKey(string fingerprint, BigInteger m, BigInteger e) { @@ -22,62 +21,63 @@ namespace TLSharp.Core.MTProto.Crypto public byte[] Encrypt(byte[] data, int offset, int length) { - - using (MemoryStream buffer = new MemoryStream(255)) - using (BinaryWriter writer = new BinaryWriter(buffer)) + using (var buffer = new MemoryStream(255)) + using (var writer = new BinaryWriter(buffer)) { using (SHA1 sha1 = new SHA1Managed()) { - byte[] hashsum = sha1.ComputeHash(data, offset, length); + var hashsum = sha1.ComputeHash(data, offset, length); writer.Write(hashsum); } buffer.Write(data, offset, length); if (length < 235) { - byte[] padding = new byte[235 - length]; + var padding = new byte[235 - length]; new Random().NextBytes(padding); buffer.Write(padding, 0, padding.Length); } - byte[] ciphertext = new BigInteger(1, buffer.ToArray()).ModPow(e, m).ToByteArrayUnsigned(); + var ciphertext = new BigInteger(1, buffer.ToArray()).ModPow(e, m).ToByteArrayUnsigned(); if (ciphertext.Length == 256) { return ciphertext; } - else { - byte[] paddedCiphertext = new byte[256]; - int padding = 256 - ciphertext.Length; - for (int i = 0; i < padding; i++) - { + { + var paddedCiphertext = new byte[256]; + var padding = 256 - ciphertext.Length; + for (var i = 0; i < padding; i++) paddedCiphertext[i] = 0; - } ciphertext.CopyTo(paddedCiphertext, padding); return paddedCiphertext; } } - } } + public class RSA { - private static readonly Dictionary serverKeys = new Dictionary() { - { "216be86c022bb4c3", new RSAServerKey("216be86c022bb4c3", new BigInteger("00C150023E2F70DB7985DED064759CFECF0AF328E69A41DAF4D6F01B538135A6F91F8F8B2A0EC9BA9720CE352EFCF6C5680FFC424BD634864902DE0B4BD6D49F4E580230E3AE97D95C8B19442B3C0A10D8F5633FECEDD6926A7F6DAB0DDB7D457F9EA81B8465FCD6FFFEED114011DF91C059CAEDAF97625F6C96ECC74725556934EF781D866B34F011FCE4D835A090196E9A5F0E4449AF7EB697DDB9076494CA5F81104A305B6DD27665722C46B60E5DF680FB16B210607EF217652E60236C255F6A28315F4083A96791D7214BF64C1DF4FD0DB1944FB26A2A57031B32EEE64AD15A8BA68885CDE74A5BFC920F6ABF59BA5C75506373E7130F9042DA922179251F", 16), new BigInteger("010001", 16)) } + private static readonly Dictionary serverKeys = new Dictionary + { + { + "216be86c022bb4c3", + new RSAServerKey("216be86c022bb4c3", + new BigInteger( + "00C150023E2F70DB7985DED064759CFECF0AF328E69A41DAF4D6F01B538135A6F91F8F8B2A0EC9BA9720CE352EFCF6C5680FFC424BD634864902DE0B4BD6D49F4E580230E3AE97D95C8B19442B3C0A10D8F5633FECEDD6926A7F6DAB0DDB7D457F9EA81B8465FCD6FFFEED114011DF91C059CAEDAF97625F6C96ECC74725556934EF781D866B34F011FCE4D835A090196E9A5F0E4449AF7EB697DDB9076494CA5F81104A305B6DD27665722C46B60E5DF680FB16B210607EF217652E60236C255F6A28315F4083A96791D7214BF64C1DF4FD0DB1944FB26A2A57031B32EEE64AD15A8BA68885CDE74A5BFC920F6ABF59BA5C75506373E7130F9042DA922179251F", + 16), new BigInteger("010001", 16)) + } }; public static byte[] Encrypt(string fingerprint, byte[] data, int offset, int length) { - string fingerprintLower = fingerprint.ToLower(); + var fingerprintLower = fingerprint.ToLower(); if (!serverKeys.ContainsKey(fingerprintLower)) - { return null; - } - RSAServerKey key = serverKeys[fingerprintLower]; + var key = serverKeys[fingerprintLower]; return key.Encrypt(data, offset, length); } } - -} +} \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Crypto/Salt.cs b/TLSharp.Core/MTProto/Crypto/Salt.cs index 7bda99a..851881a 100644 --- a/TLSharp.Core/MTProto/Crypto/Salt.cs +++ b/TLSharp.Core/MTProto/Crypto/Salt.cs @@ -1,42 +1,26 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace TLSharp.Core.MTProto.Crypto { public class Salt : IComparable { - private int validSince; - private int validUntil; - private ulong salt; - public Salt(int validSince, int validUntil, ulong salt) { - this.validSince = validSince; - this.validUntil = validUntil; - this.salt = salt; + ValidSince = validSince; + ValidUntil = validUntil; + Value = salt; } - public int ValidSince - { - get { return validSince; } - } + public int ValidSince { get; } - public int ValidUntil - { - get { return validUntil; } - } + public int ValidUntil { get; } - public ulong Value - { - get { return salt; } - } + public ulong Value { get; } public int CompareTo(Salt other) { - return validUntil.CompareTo(other.validSince); + return ValidUntil.CompareTo(other.ValidSince); } } @@ -44,51 +28,33 @@ namespace TLSharp.Core.MTProto.Crypto { private SortedSet salts; + public int Count => salts.Count; + public void Add(Salt salt) { salts.Add(salt); } - public int Count - { - get - { - return salts.Count; - } - } // TODO: get actual salt and other... } public class GetFutureSaltsResponse { - private ulong requestId; - private int now; - private SaltCollection salts; - public GetFutureSaltsResponse(ulong requestId, int now) { - this.requestId = requestId; - this.now = now; + RequestId = requestId; + Now = now; } + public ulong RequestId { get; } + + public int Now { get; } + + public SaltCollection Salts { get; } + public void AddSalt(Salt salt) { - salts.Add(salt); - } - - public ulong RequestId - { - get { return requestId; } - } - - public int Now - { - get { return now; } - } - - public SaltCollection Salts - { - get { return salts; } + Salts.Add(salt); } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/MTProto/Serializers.cs b/TLSharp.Core/MTProto/Serializers.cs index bd46ffe..faa0ba9 100644 --- a/TLSharp.Core/MTProto/Serializers.cs +++ b/TLSharp.Core/MTProto/Serializers.cs @@ -6,24 +6,32 @@ namespace TLSharp.Core.MTProto { public class Serializers { + public static string VectorToString(List list) + { + var tokens = new string[list.Count]; + for (var i = 0; i < list.Count; i++) + tokens[i] = list[i].ToString(); + return "[" + string.Join(", ", tokens) + "]"; + } public static class Bytes { public static byte[] read(BinaryReader binaryReader) { - byte firstByte = binaryReader.ReadByte(); + var firstByte = binaryReader.ReadByte(); int len, padding; if (firstByte == 254) { len = binaryReader.ReadByte() | (binaryReader.ReadByte() << 8) | (binaryReader.ReadByte() << 16); padding = len % 4; } - else { + else + { len = firstByte; padding = (len + 1) % 4; } - byte[] data = binaryReader.ReadBytes(len); + var data = binaryReader.ReadBytes(len); if (padding > 0) { padding = 4 - padding; @@ -40,33 +48,28 @@ namespace TLSharp.Core.MTProto { padding = (data.Length + 1) % 4; if (padding != 0) - { padding = 4 - padding; - } - binaryWriter.Write((byte)data.Length); + binaryWriter.Write((byte) data.Length); binaryWriter.Write(data); } - else { - padding = (data.Length) % 4; - if (padding != 0) - { - padding = 4 - padding; - } - - binaryWriter.Write((byte)254); - binaryWriter.Write((byte)(data.Length)); - binaryWriter.Write((byte)(data.Length >> 8)); - binaryWriter.Write((byte)(data.Length >> 16)); - binaryWriter.Write(data); - } - - - for (int i = 0; i < padding; i++) + else { - binaryWriter.Write((byte)0); + padding = data.Length % 4; + if (padding != 0) + padding = 4 - padding; + + binaryWriter.Write((byte) 254); + binaryWriter.Write((byte) data.Length); + binaryWriter.Write((byte) (data.Length >> 8)); + binaryWriter.Write((byte) (data.Length >> 16)); + binaryWriter.Write(data); } + + for (var i = 0; i < padding; i++) + binaryWriter.Write((byte) 0); + return binaryWriter; } } @@ -75,7 +78,7 @@ namespace TLSharp.Core.MTProto { public static string read(BinaryReader reader) { - byte[] data = Bytes.read(reader); + var data = Bytes.read(reader); return Encoding.UTF8.GetString(data, 0, data.Length); } @@ -84,15 +87,5 @@ namespace TLSharp.Core.MTProto return Bytes.write(writer, Encoding.UTF8.GetBytes(str)); } } - - public static string VectorToString(List list) - { - string[] tokens = new string[list.Count]; - for (int i = 0; i < list.Count; i++) - { - tokens[i] = list[i].ToString(); - } - return "[" + System.String.Join(", ", tokens) + "]"; - } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Network/MtProtoPlainSender.cs b/TLSharp.Core/Network/MtProtoPlainSender.cs index b88ecbb..209dd79 100644 --- a/TLSharp.Core/Network/MtProtoPlainSender.cs +++ b/TLSharp.Core/Network/MtProtoPlainSender.cs @@ -6,11 +6,11 @@ namespace TLSharp.Core.Network { public class MtProtoPlainSender { + private readonly TcpTransport _transport; + private long lastMessageId; + private readonly Random random; private int sequence = 0; private int timeOffset; - private long lastMessageId; - private Random random; - private TcpTransport _transport; public MtProtoPlainSender(TcpTransport transport) { @@ -24,12 +24,12 @@ namespace TLSharp.Core.Network { using (var binaryWriter = new BinaryWriter(memoryStream)) { - binaryWriter.Write((long)0); + binaryWriter.Write((long) 0); binaryWriter.Write(GetNewMessageId()); binaryWriter.Write(data.Length); binaryWriter.Write(data); - byte[] packet = memoryStream.ToArray(); + var packet = memoryStream.ToArray(); await _transport.Send(packet); } @@ -42,13 +42,13 @@ namespace TLSharp.Core.Network using (var memoryStream = new MemoryStream(result.Body)) { - using (BinaryReader binaryReader = new BinaryReader(memoryStream)) + using (var binaryReader = new BinaryReader(memoryStream)) { - long authKeyid = binaryReader.ReadInt64(); - long messageId = binaryReader.ReadInt64(); - int messageLength = binaryReader.ReadInt32(); + var authKeyid = binaryReader.ReadInt64(); + var messageId = binaryReader.ReadInt64(); + var messageLength = binaryReader.ReadInt32(); - byte[] response = binaryReader.ReadBytes(messageLength); + var response = binaryReader.ReadBytes(messageLength); return response; } @@ -57,21 +57,17 @@ namespace TLSharp.Core.Network private long GetNewMessageId() { - long time = Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds); - long newMessageId = ((time / 1000 + timeOffset) << 32) | - ((time % 1000) << 22) | - (random.Next(524288) << 2); // 2^19 - // [ unix timestamp : 32 bit] [ milliseconds : 10 bit ] [ buffer space : 1 bit ] [ random : 19 bit ] [ msg_id type : 2 bit ] = [ msg_id : 64 bit ] + var time = Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds); + var newMessageId = ((time / 1000 + timeOffset) << 32) | + ((time % 1000) << 22) | + (random.Next(524288) << 2); // 2^19 + // [ unix timestamp : 32 bit] [ milliseconds : 10 bit ] [ buffer space : 1 bit ] [ random : 19 bit ] [ msg_id type : 2 bit ] = [ msg_id : 64 bit ] if (lastMessageId >= newMessageId) - { newMessageId = lastMessageId + 4; - } lastMessageId = newMessageId; return newMessageId; } - - } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Network/MtProtoSender.cs b/TLSharp.Core/Network/MtProtoSender.cs index 8a959ca..bef30db 100644 --- a/TLSharp.Core/Network/MtProtoSender.cs +++ b/TLSharp.Core/Network/MtProtoSender.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Text.RegularExpressions; -using System.Threading; using System.Threading.Tasks; using Ionic.Zlib; +using TeleSharp.TL; using TLSharp.Core.MTProto; using TLSharp.Core.MTProto.Crypto; using TLSharp.Core.Requests; @@ -14,217 +13,219 @@ using TLSharp.Core.Utils; namespace TLSharp.Core.Network { - public class MtProtoSender - { - //private ulong sessionId = GenerateRandomUlong(); + public class MtProtoSender + { + private readonly Session _session; + //private ulong sessionId = GenerateRandomUlong(); - private TcpTransport _transport; - private Session _session; + private TcpTransport _transport; - public List needConfirmation = new List(); + public List needConfirmation = new List(); - public MtProtoSender(TcpTransport transport, Session session) - { - _transport = transport; - _session = session; - } + public MtProtoSender(TcpTransport transport, Session session) + { + _transport = transport; + _session = session; + } - public void ChangeTransport(TcpTransport transport) - { - _transport = transport; - } + public void ChangeTransport(TcpTransport transport) + { + _transport = transport; + } - private int GenerateSequence(bool confirmed) - { - return confirmed ? _session.Sequence++ * 2 + 1 : _session.Sequence * 2; - } + private int GenerateSequence(bool confirmed) + { + return confirmed ? _session.Sequence++ * 2 + 1 : _session.Sequence * 2; + } - public async Task Send(TeleSharp.TL.TLMethod request) - { - // TODO: refactor - if (needConfirmation.Any()) - { - var ackRequest = new AckRequest(needConfirmation); - using (var memory = new MemoryStream()) - using (var writer = new BinaryWriter(memory)) - { - ackRequest.SerializeBody(writer); - await Send(memory.ToArray(), ackRequest); - needConfirmation.Clear(); - } - } + public async Task Send(TLMethod request) + { + // TODO: refactor + if (needConfirmation.Any()) + { + var ackRequest = new AckRequest(needConfirmation); + using (var memory = new MemoryStream()) + using (var writer = new BinaryWriter(memory)) + { + ackRequest.SerializeBody(writer); + await Send(memory.ToArray(), ackRequest); + needConfirmation.Clear(); + } + } - using (var memory = new MemoryStream()) - using (var writer = new BinaryWriter(memory)) - { - request.SerializeBody(writer); - await Send(memory.ToArray(), request); - } + using (var memory = new MemoryStream()) + using (var writer = new BinaryWriter(memory)) + { + request.SerializeBody(writer); + await Send(memory.ToArray(), request); + } - _session.Save(); - } + _session.Save(); + } - public async Task Send(byte[] packet, TeleSharp.TL.TLMethod request) - { - request.MessageId = _session.GetNewMessageId(); + public async Task Send(byte[] packet, TLMethod request) + { + request.MessageId = _session.GetNewMessageId(); - byte[] msgKey; - byte[] ciphertext; - using (MemoryStream plaintextPacket = makeMemory(8 + 8 + 8 + 4 + 4 + packet.Length)) - { - using (BinaryWriter plaintextWriter = new BinaryWriter(plaintextPacket)) - { - plaintextWriter.Write(_session.Salt); - plaintextWriter.Write(_session.Id); - plaintextWriter.Write(request.MessageId); - plaintextWriter.Write(GenerateSequence(request.Confirmed)); - plaintextWriter.Write(packet.Length); - plaintextWriter.Write(packet); + byte[] msgKey; + byte[] ciphertext; + using (var plaintextPacket = makeMemory(8 + 8 + 8 + 4 + 4 + packet.Length)) + { + using (var plaintextWriter = new BinaryWriter(plaintextPacket)) + { + plaintextWriter.Write(_session.Salt); + plaintextWriter.Write(_session.Id); + plaintextWriter.Write(request.MessageId); + plaintextWriter.Write(GenerateSequence(request.Confirmed)); + plaintextWriter.Write(packet.Length); + plaintextWriter.Write(packet); - msgKey = Helpers.CalcMsgKey(plaintextPacket.GetBuffer()); - ciphertext = AES.EncryptAES(Helpers.CalcKey(_session.AuthKey.Data, msgKey, true), plaintextPacket.GetBuffer()); - } - } + msgKey = Helpers.CalcMsgKey(plaintextPacket.GetBuffer()); + ciphertext = AES.EncryptAES(Helpers.CalcKey(_session.AuthKey.Data, msgKey, true), + plaintextPacket.GetBuffer()); + } + } - using (MemoryStream ciphertextPacket = makeMemory(8 + 16 + ciphertext.Length)) - { - using (BinaryWriter writer = new BinaryWriter(ciphertextPacket)) - { - writer.Write(_session.AuthKey.Id); - writer.Write(msgKey); - writer.Write(ciphertext); + using (var ciphertextPacket = makeMemory(8 + 16 + ciphertext.Length)) + { + using (var writer = new BinaryWriter(ciphertextPacket)) + { + writer.Write(_session.AuthKey.Id); + writer.Write(msgKey); + writer.Write(ciphertext); - await _transport.Send(ciphertextPacket.GetBuffer()); - } - } - } + await _transport.Send(ciphertextPacket.GetBuffer()); + } + } + } - private Tuple DecodeMessage(byte[] body) - { - byte[] message; - ulong remoteMessageId; - int remoteSequence; + private Tuple DecodeMessage(byte[] body) + { + byte[] message; + ulong remoteMessageId; + int remoteSequence; - using (var inputStream = new MemoryStream(body)) - using (var inputReader = new BinaryReader(inputStream)) - { - if (inputReader.BaseStream.Length < 8) - throw new InvalidOperationException($"Can't decode packet"); + using (var inputStream = new MemoryStream(body)) + using (var inputReader = new BinaryReader(inputStream)) + { + if (inputReader.BaseStream.Length < 8) + throw new InvalidOperationException($"Can't decode packet"); - ulong remoteAuthKeyId = inputReader.ReadUInt64(); // TODO: check auth key id - byte[] msgKey = inputReader.ReadBytes(16); // TODO: check msg_key correctness - AESKeyData keyData = Helpers.CalcKey(_session.AuthKey.Data, msgKey, false); + var remoteAuthKeyId = inputReader.ReadUInt64(); // TODO: check auth key id + var msgKey = inputReader.ReadBytes(16); // TODO: check msg_key correctness + var keyData = Helpers.CalcKey(_session.AuthKey.Data, msgKey, false); - byte[] plaintext = AES.DecryptAES(keyData, inputReader.ReadBytes((int)(inputStream.Length - inputStream.Position))); + var plaintext = AES.DecryptAES(keyData, + inputReader.ReadBytes((int) (inputStream.Length - inputStream.Position))); - using (MemoryStream plaintextStream = new MemoryStream(plaintext)) - using (BinaryReader plaintextReader = new BinaryReader(plaintextStream)) - { - var remoteSalt = plaintextReader.ReadUInt64(); - var remoteSessionId = plaintextReader.ReadUInt64(); - remoteMessageId = plaintextReader.ReadUInt64(); - remoteSequence = plaintextReader.ReadInt32(); - int msgLen = plaintextReader.ReadInt32(); - message = plaintextReader.ReadBytes(msgLen); - } - } - return new Tuple(message, remoteMessageId, remoteSequence); - } + using (var plaintextStream = new MemoryStream(plaintext)) + using (var plaintextReader = new BinaryReader(plaintextStream)) + { + var remoteSalt = plaintextReader.ReadUInt64(); + var remoteSessionId = plaintextReader.ReadUInt64(); + remoteMessageId = plaintextReader.ReadUInt64(); + remoteSequence = plaintextReader.ReadInt32(); + var msgLen = plaintextReader.ReadInt32(); + message = plaintextReader.ReadBytes(msgLen); + } + } + return new Tuple(message, remoteMessageId, remoteSequence); + } - public async Task Receive(TeleSharp.TL.TLMethod request) - { - while (!request.ConfirmReceived) - { - var result = DecodeMessage((await _transport.Receieve()).Body); + public async Task Receive(TLMethod request) + { + while (!request.ConfirmReceived) + { + var result = DecodeMessage((await _transport.Receieve()).Body); - using (var messageStream = new MemoryStream(result.Item1, false)) - using (var messageReader = new BinaryReader(messageStream)) - { - processMessage(result.Item2, result.Item3, messageReader, request); - } - } + using (var messageStream = new MemoryStream(result.Item1, false)) + using (var messageReader = new BinaryReader(messageStream)) + { + processMessage(result.Item2, result.Item3, messageReader, request); + } + } - return null; - } + return null; + } - public async Task SendPingAsync() - { - var pingRequest = new PingRequest(); - using (var memory = new MemoryStream()) - using (var writer = new BinaryWriter(memory)) - { - pingRequest.SerializeBody(writer); - await Send(memory.ToArray(), pingRequest); - } + public async Task SendPingAsync() + { + var pingRequest = new PingRequest(); + using (var memory = new MemoryStream()) + using (var writer = new BinaryWriter(memory)) + { + pingRequest.SerializeBody(writer); + await Send(memory.ToArray(), pingRequest); + } - await Receive(pingRequest); - } + await Receive(pingRequest); + } - private bool processMessage(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) - { - // TODO: check salt - // TODO: check sessionid - // TODO: check seqno + private bool processMessage(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) + { + // TODO: check salt + // TODO: check sessionid + // TODO: check seqno - //logger.debug("processMessage: msg_id {0}, sequence {1}, data {2}", BitConverter.ToString(((MemoryStream)messageReader.BaseStream).GetBuffer(), (int) messageReader.BaseStream.Position, (int) (messageReader.BaseStream.Length - messageReader.BaseStream.Position)).Replace("-","").ToLower()); - needConfirmation.Add(messageId); + //logger.debug("processMessage: msg_id {0}, sequence {1}, data {2}", BitConverter.ToString(((MemoryStream)messageReader.BaseStream).GetBuffer(), (int) messageReader.BaseStream.Position, (int) (messageReader.BaseStream.Length - messageReader.BaseStream.Position)).Replace("-","").ToLower()); + needConfirmation.Add(messageId); - uint code = messageReader.ReadUInt32(); - messageReader.BaseStream.Position -= 4; - switch (code) - { - case 0x73f1f8dc: // container - //logger.debug("MSG container"); - return HandleContainer(messageId, sequence, messageReader, request); - case 0x7abe77ec: // ping - //logger.debug("MSG ping"); - return HandlePing(messageId, sequence, messageReader); - case 0x347773c5: // pong - //logger.debug("MSG pong"); - return HandlePong(messageId, sequence, messageReader, request); - case 0xae500895: // future_salts - //logger.debug("MSG future_salts"); - return HandleFutureSalts(messageId, sequence, messageReader); - case 0x9ec20908: // new_session_created - //logger.debug("MSG new_session_created"); - return HandleNewSessionCreated(messageId, sequence, messageReader); - case 0x62d6b459: // msgs_ack - //logger.debug("MSG msds_ack"); - return HandleMsgsAck(messageId, sequence, messageReader); - case 0xedab447b: // bad_server_salt - //logger.debug("MSG bad_server_salt"); - return HandleBadServerSalt(messageId, sequence, messageReader, request); - case 0xa7eff811: // bad_msg_notification - //logger.debug("MSG bad_msg_notification"); - return HandleBadMsgNotification(messageId, sequence, messageReader); - case 0x276d3ec6: // msg_detailed_info - //logger.debug("MSG msg_detailed_info"); - return HandleMsgDetailedInfo(messageId, sequence, messageReader); - case 0xf35c6d01: // rpc_result - //logger.debug("MSG rpc_result"); - return HandleRpcResult(messageId, sequence, messageReader, request); - case 0x3072cfa1: // gzip_packed - //logger.debug("MSG gzip_packed"); - return HandleGzipPacked(messageId, sequence, messageReader, request); - case 0xe317af7e: - case 0xd3f45784: - case 0x2b2fbd4e: - case 0x78d4dec1: - case 0x725b04c3: - case 0x74ae4240: - return HandleUpdate(messageId, sequence, messageReader); - default: - //logger.debug("unknown message: {0}", code); - return false; - } - } + var code = messageReader.ReadUInt32(); + messageReader.BaseStream.Position -= 4; + switch (code) + { + case 0x73f1f8dc: // container + //logger.debug("MSG container"); + return HandleContainer(messageId, sequence, messageReader, request); + case 0x7abe77ec: // ping + //logger.debug("MSG ping"); + return HandlePing(messageId, sequence, messageReader); + case 0x347773c5: // pong + //logger.debug("MSG pong"); + return HandlePong(messageId, sequence, messageReader, request); + case 0xae500895: // future_salts + //logger.debug("MSG future_salts"); + return HandleFutureSalts(messageId, sequence, messageReader); + case 0x9ec20908: // new_session_created + //logger.debug("MSG new_session_created"); + return HandleNewSessionCreated(messageId, sequence, messageReader); + case 0x62d6b459: // msgs_ack + //logger.debug("MSG msds_ack"); + return HandleMsgsAck(messageId, sequence, messageReader); + case 0xedab447b: // bad_server_salt + //logger.debug("MSG bad_server_salt"); + return HandleBadServerSalt(messageId, sequence, messageReader, request); + case 0xa7eff811: // bad_msg_notification + //logger.debug("MSG bad_msg_notification"); + return HandleBadMsgNotification(messageId, sequence, messageReader); + case 0x276d3ec6: // msg_detailed_info + //logger.debug("MSG msg_detailed_info"); + return HandleMsgDetailedInfo(messageId, sequence, messageReader); + case 0xf35c6d01: // rpc_result + //logger.debug("MSG rpc_result"); + return HandleRpcResult(messageId, sequence, messageReader, request); + case 0x3072cfa1: // gzip_packed + //logger.debug("MSG gzip_packed"); + return HandleGzipPacked(messageId, sequence, messageReader, request); + case 0xe317af7e: + case 0xd3f45784: + case 0x2b2fbd4e: + case 0x78d4dec1: + case 0x725b04c3: + case 0x74ae4240: + return HandleUpdate(messageId, sequence, messageReader); + default: + //logger.debug("unknown message: {0}", code); + return false; + } + } - private bool HandleUpdate(ulong messageId, int sequence, BinaryReader messageReader) - { - return false; + private bool HandleUpdate(ulong messageId, int sequence, BinaryReader messageReader) + { + return false; - /* + /* try { UpdatesEvent(TL.Parse(messageReader)); @@ -236,31 +237,31 @@ namespace TLSharp.Core.Network return false; } */ - } + } - private bool HandleGzipPacked(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) - { - uint code = messageReader.ReadUInt32(); - byte[] packedData = GZipStream.UncompressBuffer(Serializers.Bytes.read(messageReader)); - using (MemoryStream packedStream = new MemoryStream(packedData, false)) - using (BinaryReader compressedReader = new BinaryReader(packedStream)) - { - processMessage(messageId, sequence, compressedReader, request); - } + private bool HandleGzipPacked(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) + { + var code = messageReader.ReadUInt32(); + byte[] packedData = GZipStream.UncompressBuffer(Serializers.Bytes.read(messageReader)); + using (var packedStream = new MemoryStream(packedData, false)) + using (var compressedReader = new BinaryReader(packedStream)) + { + processMessage(messageId, sequence, compressedReader, request); + } - return true; - } + return true; + } - private bool HandleRpcResult(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) - { - uint code = messageReader.ReadUInt32(); - ulong requestId = messageReader.ReadUInt64(); + private bool HandleRpcResult(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) + { + var code = messageReader.ReadUInt32(); + var requestId = messageReader.ReadUInt64(); - if (requestId == (ulong)request.MessageId) - request.ConfirmReceived = true; + if (requestId == (ulong) request.MessageId) + request.ConfirmReceived = true; - //throw new NotImplementedException(); - /* + //throw new NotImplementedException(); + /* lock (runningRequests) { if (!runningRequests.ContainsKey(requestId)) @@ -275,128 +276,129 @@ namespace TLSharp.Core.Network } */ - uint innerCode = messageReader.ReadUInt32(); - if (innerCode == 0x2144ca19) - { // rpc_error - int errorCode = messageReader.ReadInt32(); - string errorMessage = Serializers.String.read(messageReader); + var innerCode = messageReader.ReadUInt32(); + if (innerCode == 0x2144ca19) + { + // rpc_error + var errorCode = messageReader.ReadInt32(); + var errorMessage = Serializers.String.read(messageReader); - if (errorMessage.StartsWith("FLOOD_WAIT_")) - { - var resultString = Regex.Match(errorMessage, @"\d+").Value; - var seconds = int.Parse(resultString); - throw new FloodException(TimeSpan.FromSeconds(seconds)); - } - else if (errorMessage.StartsWith("PHONE_MIGRATE_")) - { - var resultString = Regex.Match(errorMessage, @"\d+").Value; - var dcIdx = int.Parse(resultString); - throw new PhoneMigrationException(dcIdx); - } - else if (errorMessage.StartsWith("FILE_MIGRATE_")) - { - var resultString = Regex.Match(errorMessage, @"\d+").Value; - var dcIdx = int.Parse(resultString); - throw new FileMigrationException(dcIdx); - } - else if (errorMessage.StartsWith("USER_MIGRATE_")) - { - var resultString = Regex.Match(errorMessage, @"\d+").Value; - var dcIdx = int.Parse(resultString); - throw new UserMigrationException(dcIdx); - } - else if (errorMessage == "PHONE_CODE_INVALID") - { - throw new InvalidPhoneCodeException("The numeric code used to authenticate does not match the numeric code sent by SMS/Telegram"); - } - else if (errorMessage == "SESSION_PASSWORD_NEEDED") - { - throw new CloudPasswordNeededException("This Account has Cloud Password !"); - } - else - { - throw new InvalidOperationException(errorMessage); - } + if (errorMessage.StartsWith("FLOOD_WAIT_")) + { + var resultString = Regex.Match(errorMessage, @"\d+").Value; + var seconds = int.Parse(resultString); + throw new FloodException(TimeSpan.FromSeconds(seconds)); + } + if (errorMessage.StartsWith("PHONE_MIGRATE_")) + { + var resultString = Regex.Match(errorMessage, @"\d+").Value; + var dcIdx = int.Parse(resultString); + throw new PhoneMigrationException(dcIdx); + } + if (errorMessage.StartsWith("FILE_MIGRATE_")) + { + var resultString = Regex.Match(errorMessage, @"\d+").Value; + var dcIdx = int.Parse(resultString); + throw new FileMigrationException(dcIdx); + } + if (errorMessage.StartsWith("USER_MIGRATE_")) + { + var resultString = Regex.Match(errorMessage, @"\d+").Value; + var dcIdx = int.Parse(resultString); + throw new UserMigrationException(dcIdx); + } + if (errorMessage == "PHONE_CODE_INVALID") + throw new InvalidPhoneCodeException( + "The numeric code used to authenticate does not match the numeric code sent by SMS/Telegram"); + if (errorMessage == "SESSION_PASSWORD_NEEDED") + throw new CloudPasswordNeededException("This Account has Cloud Password !"); + throw new InvalidOperationException(errorMessage); + } + if (innerCode == 0x3072cfa1) + { + try + { + // gzip_packed + var packedData = Serializers.Bytes.read(messageReader); + using (var ms = new MemoryStream()) + { + using (var packedStream = new MemoryStream(packedData, false)) + using (var zipStream = new GZipStream(packedStream, CompressionMode.Decompress)) + { + zipStream.CopyTo(ms); + ms.Position = 0; + } + using (var compressedReader = new BinaryReader(ms)) + { + request.deserializeResponse(compressedReader); + } + } + } + catch (ZlibException ex) + { + } + } + else + { + messageReader.BaseStream.Position -= 4; + request.deserializeResponse(messageReader); + } - } - else if (innerCode == 0x3072cfa1) - { - try - { - // gzip_packed - byte[] packedData = Serializers.Bytes.read(messageReader); - using (var ms = new MemoryStream()) - { - using (var packedStream = new MemoryStream(packedData, false)) - using (var zipStream = new GZipStream(packedStream, CompressionMode.Decompress)) - { - zipStream.CopyTo(ms); - ms.Position = 0; - } - using (var compressedReader = new BinaryReader(ms)) - { - request.deserializeResponse(compressedReader); - } - } - } - catch (ZlibException ex) - { + return false; + } - } - } - else - { - messageReader.BaseStream.Position -= 4; - request.deserializeResponse(messageReader); - } + private bool HandleMsgDetailedInfo(ulong messageId, int sequence, BinaryReader messageReader) + { + return false; + } - return false; - } + private bool HandleBadMsgNotification(ulong messageId, int sequence, BinaryReader messageReader) + { + var code = messageReader.ReadUInt32(); + var requestId = messageReader.ReadUInt64(); + var requestSequence = messageReader.ReadInt32(); + var errorCode = messageReader.ReadInt32(); - private bool HandleMsgDetailedInfo(ulong messageId, int sequence, BinaryReader messageReader) - { - return false; - } - - private bool HandleBadMsgNotification(ulong messageId, int sequence, BinaryReader messageReader) - { - uint code = messageReader.ReadUInt32(); - ulong requestId = messageReader.ReadUInt64(); - int requestSequence = messageReader.ReadInt32(); - int errorCode = messageReader.ReadInt32(); - - switch (errorCode) - { - case 16: - throw new InvalidOperationException("msg_id too low (most likely, client time is wrong; it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted)"); - case 17: - throw new InvalidOperationException("msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id)"); - case 18: - throw new InvalidOperationException("incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4)"); - case 19: - throw new InvalidOperationException("container msg_id is the same as msg_id of a previously received message (this must never happen)"); - case 20: - throw new InvalidOperationException("message too old, and it cannot be verified whether the server has received a message with this msg_id or not"); - case 32: - throw new InvalidOperationException("msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno)"); - case 33: - throw new InvalidOperationException(" msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno)"); - case 34: - throw new InvalidOperationException("an even msg_seqno expected (irrelevant message), but odd received"); - case 35: - throw new InvalidOperationException("odd msg_seqno expected (relevant message), but even received"); - case 48: - throw new InvalidOperationException("incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it)"); - case 64: - throw new InvalidOperationException("invalid container"); - - } - throw new NotImplementedException("This should never happens"); - /* + switch (errorCode) + { + case 16: + throw new InvalidOperationException( + "msg_id too low (most likely, client time is wrong; it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted)"); + case 17: + throw new InvalidOperationException( + "msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id)"); + case 18: + throw new InvalidOperationException( + "incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4)"); + case 19: + throw new InvalidOperationException( + "container msg_id is the same as msg_id of a previously received message (this must never happen)"); + case 20: + throw new InvalidOperationException( + "message too old, and it cannot be verified whether the server has received a message with this msg_id or not"); + case 32: + throw new InvalidOperationException( + "msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno)"); + case 33: + throw new InvalidOperationException( + " msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno)"); + case 34: + throw new InvalidOperationException( + "an even msg_seqno expected (irrelevant message), but odd received"); + case 35: + throw new InvalidOperationException("odd msg_seqno expected (relevant message), but even received"); + case 48: + throw new InvalidOperationException( + "incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it)"); + case 64: + throw new InvalidOperationException("invalid container"); + } + throw new NotImplementedException("This should never happens"); + /* logger.debug("bad_msg_notification: msgid {0}, seq {1}, errorcode {2}", requestId, requestSequence, errorCode); */ - /* + /* if (!runningRequests.ContainsKey(requestId)) { logger.debug("bad msg notification on unknown request"); @@ -404,60 +406,60 @@ namespace TLSharp.Core.Network } */ - //OnBrokenSessionEvent(); - //MTProtoRequest request = runningRequests[requestId]; - //request.OnException(new MTProtoBadMessageException(errorCode)); + //OnBrokenSessionEvent(); + //MTProtoRequest request = runningRequests[requestId]; + //request.OnException(new MTProtoBadMessageException(errorCode)); - return true; - } + return true; + } - private bool HandleBadServerSalt(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) - { - uint code = messageReader.ReadUInt32(); - ulong badMsgId = messageReader.ReadUInt64(); - int badMsgSeqNo = messageReader.ReadInt32(); - int errorCode = messageReader.ReadInt32(); - ulong newSalt = messageReader.ReadUInt64(); + private bool HandleBadServerSalt(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) + { + var code = messageReader.ReadUInt32(); + var badMsgId = messageReader.ReadUInt64(); + var badMsgSeqNo = messageReader.ReadInt32(); + var errorCode = messageReader.ReadInt32(); + var newSalt = messageReader.ReadUInt64(); - //logger.debug("bad_server_salt: msgid {0}, seq {1}, errorcode {2}, newsalt {3}", badMsgId, badMsgSeqNo, errorCode, newSalt); + //logger.debug("bad_server_salt: msgid {0}, seq {1}, errorcode {2}, newsalt {3}", badMsgId, badMsgSeqNo, errorCode, newSalt); - _session.Salt = newSalt; + _session.Salt = newSalt; - //resend - Send(request); - /* - if(!runningRequests.ContainsKey(badMsgId)) { - logger.debug("bad server salt on unknown message"); - return true; - } - */ + //resend + Send(request); + /* + if(!runningRequests.ContainsKey(badMsgId)) { + logger.debug("bad server salt on unknown message"); + return true; + } + */ - //MTProtoRequest request = runningRequests[badMsgId]; - //request.OnException(new MTProtoBadServerSaltException(salt)); + //MTProtoRequest request = runningRequests[badMsgId]; + //request.OnException(new MTProtoBadServerSaltException(salt)); - return true; - } + return true; + } - private bool HandleMsgsAck(ulong messageId, int sequence, BinaryReader messageReader) - { - return false; - } + private bool HandleMsgsAck(ulong messageId, int sequence, BinaryReader messageReader) + { + return false; + } - private bool HandleNewSessionCreated(ulong messageId, int sequence, BinaryReader messageReader) - { - return false; - } + private bool HandleNewSessionCreated(ulong messageId, int sequence, BinaryReader messageReader) + { + return false; + } - private bool HandleFutureSalts(ulong messageId, int sequence, BinaryReader messageReader) - { - uint code = messageReader.ReadUInt32(); - ulong requestId = messageReader.ReadUInt64(); + private bool HandleFutureSalts(ulong messageId, int sequence, BinaryReader messageReader) + { + var code = messageReader.ReadUInt32(); + var requestId = messageReader.ReadUInt64(); - messageReader.BaseStream.Position -= 12; + messageReader.BaseStream.Position -= 12; - throw new NotImplementedException("Handle future server salts function isn't implemented."); - /* + throw new NotImplementedException("Handle future server salts function isn't implemented."); + /* if (!runningRequests.ContainsKey(requestId)) { logger.info("future salts on unknown request"); @@ -465,110 +467,107 @@ namespace TLSharp.Core.Network } */ - // MTProtoRequest request = runningRequests[requestId]; - // runningRequests.Remove(requestId); - // request.OnResponse(messageReader); + // MTProtoRequest request = runningRequests[requestId]; + // runningRequests.Remove(requestId); + // request.OnResponse(messageReader); - return true; - } + return true; + } - private bool HandlePong(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) - { - uint code = messageReader.ReadUInt32(); - ulong msgId = messageReader.ReadUInt64(); + private bool HandlePong(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) + { + var code = messageReader.ReadUInt32(); + var msgId = messageReader.ReadUInt64(); - if (msgId == (ulong)request.MessageId) - { - request.ConfirmReceived = true; - } + if (msgId == (ulong) request.MessageId) + request.ConfirmReceived = true; - return false; - } + return false; + } - private bool HandlePing(ulong messageId, int sequence, BinaryReader messageReader) - { - return false; - } + private bool HandlePing(ulong messageId, int sequence, BinaryReader messageReader) + { + return false; + } - private bool HandleContainer(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) - { - uint code = messageReader.ReadUInt32(); - int size = messageReader.ReadInt32(); - for (int i = 0; i < size; i++) - { - ulong innerMessageId = messageReader.ReadUInt64(); - int innerSequence = messageReader.ReadInt32(); - int innerLength = messageReader.ReadInt32(); - long beginPosition = messageReader.BaseStream.Position; - try - { - if (!processMessage(innerMessageId, sequence, messageReader, request)) - { - messageReader.BaseStream.Position = beginPosition + innerLength; - } - } - catch (Exception e) - { - // logger.error("failed to process message in contailer: {0}", e); - messageReader.BaseStream.Position = beginPosition + innerLength; - } - } + private bool HandleContainer(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) + { + var code = messageReader.ReadUInt32(); + var size = messageReader.ReadInt32(); + for (var i = 0; i < size; i++) + { + var innerMessageId = messageReader.ReadUInt64(); + var innerSequence = messageReader.ReadInt32(); + var innerLength = messageReader.ReadInt32(); + var beginPosition = messageReader.BaseStream.Position; + try + { + if (!processMessage(innerMessageId, sequence, messageReader, request)) + messageReader.BaseStream.Position = beginPosition + innerLength; + } + catch (Exception e) + { + // logger.error("failed to process message in contailer: {0}", e); + messageReader.BaseStream.Position = beginPosition + innerLength; + } + } - return false; - } + return false; + } - private MemoryStream makeMemory(int len) - { - return new MemoryStream(new byte[len], 0, len, true, true); - } - } + private MemoryStream makeMemory(int len) + { + return new MemoryStream(new byte[len], 0, len, true, true); + } + } - public class FloodException : Exception - { - public TimeSpan TimeToWait { get; private set; } + public class FloodException : Exception + { + internal FloodException(TimeSpan timeToWait) + : base( + $"Flood prevention. Telegram now requires your program to do requests again only after {timeToWait.TotalSeconds} seconds have passed ({nameof(TimeToWait)} property)." + + " If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.") + { + TimeToWait = timeToWait; + } - internal FloodException(TimeSpan timeToWait) - : base($"Flood prevention. Telegram now requires your program to do requests again only after {timeToWait.TotalSeconds} seconds have passed ({nameof(TimeToWait)} property)." + - " If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.") - { - TimeToWait = timeToWait; - } - } + public TimeSpan TimeToWait { get; } + } - internal abstract class DataCenterMigrationException : Exception - { - internal int DC { get; private set; } + internal abstract class DataCenterMigrationException : Exception + { + private const string REPORT_MESSAGE = + " See: https://github.com/sochix/TLSharp#i-get-a-xxxmigrationexception-or-a-migrate_x-error"; - private const string REPORT_MESSAGE = - " See: https://github.com/sochix/TLSharp#i-get-a-xxxmigrationexception-or-a-migrate_x-error"; + protected DataCenterMigrationException(string msg, int dc) : base(msg + REPORT_MESSAGE) + { + DC = dc; + } - protected DataCenterMigrationException(string msg, int dc) : base (msg + REPORT_MESSAGE) - { - DC = dc; - } - } + internal int DC { get; } + } - internal class PhoneMigrationException : DataCenterMigrationException - { - internal PhoneMigrationException(int dc) - : base ($"Phone number registered to a different DC: {dc}.", dc) - { - } - } + internal class PhoneMigrationException : DataCenterMigrationException + { + internal PhoneMigrationException(int dc) + : base($"Phone number registered to a different DC: {dc}.", dc) + { + } + } - internal class FileMigrationException : DataCenterMigrationException - { - internal FileMigrationException(int dc) - : base ($"File located on a different DC: {dc}.", dc) - { - } - } + internal class FileMigrationException : DataCenterMigrationException + { + internal FileMigrationException(int dc) + : base($"File located on a different DC: {dc}.", dc) + { + } + } - internal class UserMigrationException : DataCenterMigrationException - { - internal UserMigrationException(int dc) - : base($"User located on a different DC: {dc}.", dc) - { - } - } + internal class UserMigrationException : DataCenterMigrationException + { + internal UserMigrationException(int dc) + : base($"User located on a different DC: {dc}.", dc) + { + } + } } \ No newline at end of file diff --git a/TLSharp.Core/Network/TcpMessage.cs b/TLSharp.Core/Network/TcpMessage.cs index 91ef84c..876cd83 100644 --- a/TLSharp.Core/Network/TcpMessage.cs +++ b/TLSharp.Core/Network/TcpMessage.cs @@ -6,9 +6,6 @@ namespace TLSharp.Core.Network { public class TcpMessage { - public int SequneceNumber { get; private set; } - public byte[] Body { get; private set; } - public TcpMessage(int seqNumber, byte[] body) { if (body == null) @@ -18,6 +15,9 @@ namespace TLSharp.Core.Network Body = body; } + public int SequneceNumber { get; } + public byte[] Body { get; } + public byte[] Encode() { using (var memoryStream = new MemoryStream()) @@ -66,21 +66,19 @@ namespace TLSharp.Core.Network throw new InvalidOperationException(string.Format("invalid packet length: {0}", packetLength)); var seq = binaryReader.ReadInt32(); - byte[] packet = binaryReader.ReadBytes(packetLength - 12); - var checksum = (int)binaryReader.ReadInt32(); + var packet = binaryReader.ReadBytes(packetLength - 12); + var checksum = binaryReader.ReadInt32(); var crc32 = new CRC32(); crc32.SlurpBlock(body, 0, packetLength - 4); var validChecksum = crc32.Crc32Result; if (checksum != validChecksum) - { throw new InvalidOperationException("invalid checksum! skip"); - } return new TcpMessage(seq, packet); } } } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Network/TcpTransport.cs b/TLSharp.Core/Network/TcpTransport.cs index 254153e..c922bc3 100644 --- a/TLSharp.Core/Network/TcpTransport.cs +++ b/TLSharp.Core/Network/TcpTransport.cs @@ -10,7 +10,7 @@ namespace TLSharp.Core.Network public class TcpTransport : IDisposable { private readonly TcpClient _tcpClient; - private int sendCounter = 0; + private int sendCounter; public TcpTransport(string address, int port, TcpClientConnectionHandler handler = null) { @@ -22,7 +22,15 @@ namespace TLSharp.Core.Network _tcpClient.Connect(ipAddress, port); } else + { _tcpClient = handler(address, port); + } + } + + public void Dispose() + { + if (_tcpClient.Connected) + _tcpClient.Close(); } public async Task Send(byte[] packet) @@ -43,16 +51,16 @@ namespace TLSharp.Core.Network var packetLengthBytes = new byte[4]; if (await stream.ReadAsync(packetLengthBytes, 0, 4) != 4) throw new InvalidOperationException("Couldn't read the packet length"); - int packetLength = BitConverter.ToInt32(packetLengthBytes, 0); + var packetLength = BitConverter.ToInt32(packetLengthBytes, 0); var seqBytes = new byte[4]; if (await stream.ReadAsync(seqBytes, 0, 4) != 4) throw new InvalidOperationException("Couldn't read the sequence"); - int seq = BitConverter.ToInt32(seqBytes, 0); + var seq = BitConverter.ToInt32(seqBytes, 0); - int readBytes = 0; + var readBytes = 0; var body = new byte[packetLength - 12]; - int neededToRead = packetLength - 12; + var neededToRead = packetLength - 12; do { @@ -61,15 +69,14 @@ namespace TLSharp.Core.Network neededToRead -= availableBytes; Buffer.BlockCopy(bodyByte, 0, body, readBytes, availableBytes); readBytes += availableBytes; - } - while (readBytes != packetLength - 12); + } while (readBytes != packetLength - 12); var crcBytes = new byte[4]; if (await stream.ReadAsync(crcBytes, 0, 4) != 4) throw new InvalidOperationException("Couldn't read the crc"); - int checksum = BitConverter.ToInt32(crcBytes, 0); + var checksum = BitConverter.ToInt32(crcBytes, 0); - byte[] rv = new byte[packetLengthBytes.Length + seqBytes.Length + body.Length]; + var rv = new byte[packetLengthBytes.Length + seqBytes.Length + body.Length]; Buffer.BlockCopy(packetLengthBytes, 0, rv, 0, packetLengthBytes.Length); Buffer.BlockCopy(seqBytes, 0, rv, packetLengthBytes.Length, seqBytes.Length); @@ -79,17 +86,9 @@ namespace TLSharp.Core.Network var validChecksum = crc32.Crc32Result; if (checksum != validChecksum) - { throw new InvalidOperationException("invalid checksum! skip"); - } return new TcpMessage(seq, body); } - - public void Dispose() - { - if (_tcpClient.Connected) - _tcpClient.Close(); - } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Properties/AssemblyInfo.cs b/TLSharp.Core/Properties/AssemblyInfo.cs index 856dc61..8fa3b1d 100644 --- a/TLSharp.Core/Properties/AssemblyInfo.cs +++ b/TLSharp.Core/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TLSharp.Core/Requests/AckRequest.cs b/TLSharp.Core/Requests/AckRequest.cs index 0a06b3a..777f001 100644 --- a/TLSharp.Core/Requests/AckRequest.cs +++ b/TLSharp.Core/Requests/AckRequest.cs @@ -5,7 +5,7 @@ using TeleSharp.TL; namespace TLSharp.Core.Requests { - public class AckRequest : TeleSharp.TL.TLMethod + public class AckRequest : TLMethod { private readonly List _msgs; @@ -14,15 +14,18 @@ namespace TLSharp.Core.Requests _msgs = msgs; } + public override bool Confirmed => false; + public override bool Responded { get; } + + public override int Constructor => 0x62d6b459; + public override void SerializeBody(BinaryWriter writer) { writer.Write(0x62d6b459); // msgs_ack writer.Write(0x1cb5c415); // Vector writer.Write(_msgs.Count); - foreach (ulong messageId in _msgs) - { + foreach (var messageId in _msgs) writer.Write(messageId); - } } public override void DeserializeBody(BinaryReader reader) @@ -34,16 +37,5 @@ namespace TLSharp.Core.Requests { throw new NotImplementedException(); } - - public override bool Confirmed => false; - public override bool Responded { get; } - - public override int Constructor - { - get - { - return 0x62d6b459; - } - } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Requests/PingRequest.cs b/TLSharp.Core/Requests/PingRequest.cs index 48aa61b..12b4f7f 100644 --- a/TLSharp.Core/Requests/PingRequest.cs +++ b/TLSharp.Core/Requests/PingRequest.cs @@ -1,16 +1,13 @@ using System; -using System.Collections.Generic; using System.IO; using TeleSharp.TL; using TLSharp.Core.Utils; namespace TLSharp.Core.Requests { - public class PingRequest : TeleSharp.TL.TLMethod + public class PingRequest : TLMethod { - public PingRequest() - { - } + public override int Constructor => 0x7abe77ec; public override void SerializeBody(BinaryWriter writer) { @@ -27,13 +24,5 @@ namespace TLSharp.Core.Requests { throw new NotImplementedException(); } - - public override int Constructor - { - get - { - return 0x7abe77ec; - } - } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Session.cs b/TLSharp.Core/Session.cs index 7a13da9..218755f 100644 --- a/TLSharp.Core/Session.cs +++ b/TLSharp.Core/Session.cs @@ -43,7 +43,6 @@ namespace TLSharp.Core { public void Save(Session session) { - } public Session Load(string sessionUserId) @@ -54,9 +53,18 @@ namespace TLSharp.Core public class Session { - private const string defaultConnectionAddress = "149.154.175.100";//"149.154.167.50"; + private const string defaultConnectionAddress = "149.154.175.100"; //"149.154.167.50"; - private const int defaultConnectionPort = 443; + private const int defaultConnectionPort = 443; + + private readonly ISessionStore _store; + private readonly Random random; + + private Session(ISessionStore store) + { + random = new Random(); + _store = store; + } public string SessionUserId { get; set; } public string ServerAddress { get; set; } @@ -69,15 +77,6 @@ namespace TLSharp.Core public long LastMessageId { get; set; } public int SessionExpires { get; set; } public TLUser TLUser { get; set; } - private Random random; - - private ISessionStore _store; - - private Session(ISessionStore store) - { - random = new Random(); - _store = store; - } public byte[] ToBytes() { @@ -123,12 +122,12 @@ namespace TLSharp.Core var port = reader.ReadInt32(); var isAuthExsist = reader.ReadInt32() == 1; - int sessionExpires = 0; + var sessionExpires = 0; TLUser TLUser = null; if (isAuthExsist) { sessionExpires = reader.ReadInt32(); - TLUser = (TLUser)ObjectUtils.DeserializeObject(reader); + TLUser = (TLUser) ObjectUtils.DeserializeObject(reader); } var authData = Serializers.Bytes.read(reader); @@ -169,25 +168,23 @@ namespace TLSharp.Core private static ulong GenerateRandomUlong() { var random = new Random(); - ulong rand = (((ulong)random.Next()) << 32) | ((ulong)random.Next()); + var rand = ((ulong) random.Next() << 32) | (ulong) random.Next(); return rand; } public long GetNewMessageId() { - long time = Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds); - long newMessageId = ((time / 1000 + TimeOffset) << 32) | - ((time % 1000) << 22) | - (random.Next(524288) << 2); // 2^19 - // [ unix timestamp : 32 bit] [ milliseconds : 10 bit ] [ buffer space : 1 bit ] [ random : 19 bit ] [ msg_id type : 2 bit ] = [ msg_id : 64 bit ] + var time = Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds); + var newMessageId = ((time / 1000 + TimeOffset) << 32) | + ((time % 1000) << 22) | + (random.Next(524288) << 2); // 2^19 + // [ unix timestamp : 32 bit] [ milliseconds : 10 bit ] [ buffer space : 1 bit ] [ random : 19 bit ] [ msg_id type : 2 bit ] = [ msg_id : 64 bit ] if (LastMessageId >= newMessageId) - { newMessageId = LastMessageId + 4; - } LastMessageId = newMessageId; return newMessageId; } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index a4fa06a..771a19d 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -16,19 +16,20 @@ using TLSharp.Core.MTProto.Crypto; using TLSharp.Core.Network; using TLSharp.Core.Utils; using TLAuthorization = TeleSharp.TL.Auth.TLAuthorization; +using TLRequestSearch = TeleSharp.TL.Contacts.TLRequestSearch; namespace TLSharp.Core { public class TelegramClient : IDisposable { - private MtProtoSender _sender; + private readonly string _apiHash = ""; + private readonly int _apiId; + private readonly TcpClientConnectionHandler _handler; private AuthKey _key; + private MtProtoSender _sender; + private readonly Session _session; private TcpTransport _transport; - private string _apiHash = ""; - private int _apiId = 0; - private Session _session; private List dcOptions; - private TcpClientConnectionHandler _handler; public TelegramClient(int apiId, string apiHash, ISessionStore store = null, string sessionUserId = "session", TcpClientConnectionHandler handler = null) @@ -50,6 +51,15 @@ namespace TLSharp.Core _transport = new TcpTransport(_session.ServerAddress, _session.Port, _handler); } + public void Dispose() + { + if (_transport != null) + { + _transport.Dispose(); + _transport = null; + } + } + public async Task ConnectAsync(bool reconnect = false) { if (_session.AuthKey == null || reconnect) @@ -63,7 +73,7 @@ namespace TLSharp.Core //set-up layer var config = new TLRequestGetConfig(); - var request = new TLRequestInitConnection() + var request = new TLRequestInitConnection { api_id = _apiId, app_version = "1.0.0", @@ -72,11 +82,11 @@ namespace TLSharp.Core query = config, system_version = "Win 10.0" }; - var invokewithLayer = new TLRequestInvokeWithLayer() { layer = 57, query = request }; + var invokewithLayer = new TLRequestInvokeWithLayer {layer = 57, query = request}; await _sender.Send(invokewithLayer); await _sender.Receive(invokewithLayer); - dcOptions = ((TLConfig)invokewithLayer.Response).dc_options.lists; + dcOptions = ((TLConfig) invokewithLayer.Response).dc_options.lists; return true; } @@ -102,33 +112,31 @@ namespace TLSharp.Core public async Task IsPhoneRegisteredAsync(string phoneNumber) { - if (String.IsNullOrWhiteSpace(phoneNumber)) + if (string.IsNullOrWhiteSpace(phoneNumber)) throw new ArgumentNullException(nameof(phoneNumber)); if (_sender == null) throw new InvalidOperationException("Not connected!"); - var authCheckPhoneRequest = new TLRequestCheckPhone() { phone_number = phoneNumber }; + var authCheckPhoneRequest = new TLRequestCheckPhone {phone_number = phoneNumber}; var completed = false; - while(!completed) - { + while (!completed) try { await _sender.Send(authCheckPhoneRequest); await _sender.Receive(authCheckPhoneRequest); completed = true; } - catch(PhoneMigrationException e) + catch (PhoneMigrationException e) { await ReconnectToDcAsync(e.DC); } - } return authCheckPhoneRequest.Response.phone_registered; } public async Task SendCodeRequestAsync(string phoneNumber) { - if (String.IsNullOrWhiteSpace(phoneNumber)) + if (string.IsNullOrWhiteSpace(phoneNumber)) throw new ArgumentNullException(nameof(phoneNumber)); var completed = false; @@ -137,7 +145,7 @@ namespace TLSharp.Core while (!completed) { - request = new TLRequestSendCode() { phone_number = phoneNumber, api_id = _apiId, api_hash = _apiHash }; + request = new TLRequestSendCode {phone_number = phoneNumber, api_id = _apiId, api_hash = _apiHash}; try { await _sender.Send(request); @@ -156,23 +164,29 @@ namespace TLSharp.Core public async Task MakeAuthAsync(string phoneNumber, string phoneCodeHash, string code) { - if (String.IsNullOrWhiteSpace(phoneNumber)) + if (string.IsNullOrWhiteSpace(phoneNumber)) throw new ArgumentNullException(nameof(phoneNumber)); - if (String.IsNullOrWhiteSpace(phoneCodeHash)) + if (string.IsNullOrWhiteSpace(phoneCodeHash)) throw new ArgumentNullException(nameof(phoneCodeHash)); - if (String.IsNullOrWhiteSpace(code)) + if (string.IsNullOrWhiteSpace(code)) throw new ArgumentNullException(nameof(code)); - var request = new TLRequestSignIn() { phone_number = phoneNumber, phone_code_hash = phoneCodeHash, phone_code = code }; + var request = new TLRequestSignIn + { + phone_number = phoneNumber, + phone_code_hash = phoneCodeHash, + phone_code = code + }; await _sender.Send(request); await _sender.Receive(request); - OnUserAuthenticated(((TLUser)request.Response.user)); + OnUserAuthenticated((TLUser) request.Response.user); - return ((TLUser)request.Response.user); + return (TLUser) request.Response.user; } + public async Task GetPasswordSetting() { var request = new TLRequestGetPassword(); @@ -180,37 +194,45 @@ namespace TLSharp.Core await _sender.Send(request); await _sender.Receive(request); - return ((TLPassword)request.Response); + return (TLPassword) request.Response; } public async Task MakeAuthWithPasswordAsync(TLPassword password, string password_str) { + var password_bytes = Encoding.UTF8.GetBytes(password_str); + var rv = password.current_salt.Concat(password_bytes).Concat(password.current_salt); - byte[] password_bytes = Encoding.UTF8.GetBytes(password_str); - IEnumerable rv = password.current_salt.Concat(password_bytes).Concat(password.current_salt); - - SHA256Managed hashstring = new SHA256Managed(); + var hashstring = new SHA256Managed(); var password_hash = hashstring.ComputeHash(rv.ToArray()); - var request = new TLRequestCheckPassword() { password_hash = password_hash }; + var request = new TLRequestCheckPassword {password_hash = password_hash}; await _sender.Send(request); await _sender.Receive(request); - OnUserAuthenticated(((TLUser)request.Response.user)); + OnUserAuthenticated((TLUser) request.Response.user); - return ((TLUser)request.Response.user); + return (TLUser) request.Response.user; } - public async Task SignUpAsync(string phoneNumber, string phoneCodeHash, string code, string firstName, string lastName) + public async Task SignUpAsync(string phoneNumber, string phoneCodeHash, string code, string firstName, + string lastName) { - var request = new TLRequestSignUp() { phone_number = phoneNumber, phone_code = code, phone_code_hash = phoneCodeHash, first_name = firstName, last_name = lastName }; + var request = new TLRequestSignUp + { + phone_number = phoneNumber, + phone_code = code, + phone_code_hash = phoneCodeHash, + first_name = firstName, + last_name = lastName + }; await _sender.Send(request); await _sender.Receive(request); - OnUserAuthenticated(((TLUser)request.Response.user)); + OnUserAuthenticated((TLUser) request.Response.user); - return ((TLUser)request.Response.user); + return (TLUser) request.Response.user; } + public async Task SendRequestAsync(TLMethod methodToExecute) { await _sender.Send(methodToExecute); @@ -218,7 +240,7 @@ namespace TLSharp.Core var result = methodToExecute.GetType().GetProperty("Response").GetValue(methodToExecute); - return (T)result; + return (T) result; } public async Task GetContactsAsync() @@ -226,7 +248,7 @@ namespace TLSharp.Core if (!IsUserAuthorized()) throw new InvalidOperationException("Authorize user first!"); - var req = new TLRequestGetContacts() { hash = "" }; + var req = new TLRequestGetContacts {hash = ""}; return await SendRequestAsync(req); } @@ -237,52 +259,53 @@ namespace TLSharp.Core throw new InvalidOperationException("Authorize user first!"); return await SendRequestAsync( - new TLRequestSendMessage() - { - peer = peer, - message = message, - random_id = Helpers.GenerateRandomLong() - }); + new TLRequestSendMessage + { + peer = peer, + message = message, + random_id = Helpers.GenerateRandomLong() + }); } - public async Task SendTypingAsync(TLAbsInputPeer peer) + public async Task SendTypingAsync(TLAbsInputPeer peer) { - var req = new TLRequestSetTyping() + var req = new TLRequestSetTyping { action = new TLSendMessageTypingAction(), peer = peer }; - return await SendRequestAsync(req); + return await SendRequestAsync(req); } public async Task GetUserDialogsAsync() { var peer = new TLInputPeerSelf(); return await SendRequestAsync( - new TLRequestGetDialogs() { offset_date = 0, offset_peer = peer, limit = 100 }); + new TLRequestGetDialogs {offset_date = 0, offset_peer = peer, limit = 100}); } public async Task SendUploadedPhoto(TLAbsInputPeer peer, TLAbsInputFile file, string caption) { - return await SendRequestAsync(new TLRequestSendMedia() + return await SendRequestAsync(new TLRequestSendMedia { random_id = Helpers.GenerateRandomLong(), background = false, clear_draft = false, - media = new TLInputMediaUploadedPhoto() { file = file, caption = caption }, + media = new TLInputMediaUploadedPhoto {file = file, caption = caption}, peer = peer }); } public async Task SendUploadedDocument( - TLAbsInputPeer peer, TLAbsInputFile file, string caption, string mimeType, TLVector attributes) + TLAbsInputPeer peer, TLAbsInputFile file, string caption, string mimeType, + TLVector attributes) { - return await SendRequestAsync(new TLRequestSendMedia() + return await SendRequestAsync(new TLRequestSendMedia { random_id = Helpers.GenerateRandomLong(), background = false, clear_draft = false, - media = new TLInputMediaUploadedDocument() + media = new TLInputMediaUploadedDocument { file = file, caption = caption, @@ -298,7 +321,7 @@ namespace TLSharp.Core TLFile result = null; try { - result = await SendRequestAsync(new TLRequestGetFile() + result = await SendRequestAsync(new TLRequestGetFile { location = location, limit = filePartSize, @@ -307,7 +330,8 @@ namespace TLSharp.Core } catch (FileMigrationException ex) { - var exportedAuth = await SendRequestAsync(new TLRequestExportAuthorization() { dc_id = ex.DC }); + var exportedAuth = + await SendRequestAsync(new TLRequestExportAuthorization {dc_id = ex.DC}); var authKey = _session.AuthKey; var timeOffset = _session.TimeOffset; @@ -328,7 +352,6 @@ namespace TLSharp.Core _session.ServerAddress = serverAddress; _session.Port = serverPort; await ConnectAsync(); - } return result; @@ -337,32 +360,32 @@ namespace TLSharp.Core public async Task SendPingAsync() { await _sender.SendPingAsync(); - } - - public async Task GetHistoryAsync(TLAbsInputPeer peer, int offset, int max_id, int limit) - { - if (!IsUserAuthorized()) - throw new InvalidOperationException("Authorize user first!"); - - var req = new TLRequestGetHistory() - { - peer = peer, - add_offset = offset, - max_id = max_id, - limit = limit - }; - return await SendRequestAsync(req); + } + + public async Task GetHistoryAsync(TLAbsInputPeer peer, int offset, int max_id, int limit) + { + if (!IsUserAuthorized()) + throw new InvalidOperationException("Authorize user first!"); + + var req = new TLRequestGetHistory + { + peer = peer, + add_offset = offset, + max_id = max_id, + limit = limit + }; + return await SendRequestAsync(req); } /// - /// Serch user or chat. API: contacts.search#11f812d8 q:string limit:int = contacts.Found; + /// Serch user or chat. API: contacts.search#11f812d8 q:string limit:int = contacts.Found; /// /// User or chat name /// Max result count /// public async Task SearchUserAsync(string q, int limit = 10) { - var r = new TeleSharp.TL.Contacts.TLRequestSearch + var r = new TLRequestSearch { q = q, limit = limit @@ -378,15 +401,6 @@ namespace TLSharp.Core _session.Save(); } - - public void Dispose() - { - if (_transport != null) - { - _transport.Dispose(); - _transport = null; - } - } } public class MissingApiConfigurationException : Exception @@ -401,10 +415,15 @@ namespace TLSharp.Core public class InvalidPhoneCodeException : Exception { - internal InvalidPhoneCodeException(string msg) : base(msg) { } + internal InvalidPhoneCodeException(string msg) : base(msg) + { + } } + public class CloudPasswordNeededException : Exception { - internal CloudPasswordNeededException(string msg) : base(msg) { } + internal CloudPasswordNeededException(string msg) : base(msg) + { + } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Utils/Helpers.cs b/TLSharp.Core/Utils/Helpers.cs index cff71ec..2bc99ca 100644 --- a/TLSharp.Core/Utils/Helpers.cs +++ b/TLSharp.Core/Utils/Helpers.cs @@ -6,55 +6,55 @@ namespace TLSharp.Core.Utils { public class Helpers { - private static Random random = new Random(); + private static readonly Random random = new Random(); public static ulong GenerateRandomUlong() { - ulong rand = (((ulong)random.Next()) << 32) | ((ulong)random.Next()); + var rand = ((ulong) random.Next() << 32) | (ulong) random.Next(); return rand; } public static long GenerateRandomLong() { - long rand = (((long)random.Next()) << 32) | ((long)random.Next()); + var rand = ((long) random.Next() << 32) | random.Next(); return rand; } public static byte[] GenerateRandomBytes(int num) { - byte[] data = new byte[num]; + var data = new byte[num]; random.NextBytes(data); return data; } public static AESKeyData CalcKey(byte[] sharedKey, byte[] msgKey, bool client) { - int x = client ? 0 : 8; - byte[] buffer = new byte[48]; + var x = client ? 0 : 8; + var buffer = new byte[48]; - Array.Copy(msgKey, 0, buffer, 0, 16); // buffer[0:16] = msgKey - Array.Copy(sharedKey, x, buffer, 16, 32); // buffer[16:48] = authKey[x:x+32] - byte[] sha1a = sha1(buffer); // sha1a = sha1(buffer) + Array.Copy(msgKey, 0, buffer, 0, 16); // buffer[0:16] = msgKey + Array.Copy(sharedKey, x, buffer, 16, 32); // buffer[16:48] = authKey[x:x+32] + var sha1a = sha1(buffer); // sha1a = sha1(buffer) - Array.Copy(sharedKey, 32 + x, buffer, 0, 16); // buffer[0:16] = authKey[x+32:x+48] - Array.Copy(msgKey, 0, buffer, 16, 16); // buffer[16:32] = msgKey - Array.Copy(sharedKey, 48 + x, buffer, 32, 16); // buffer[32:48] = authKey[x+48:x+64] - byte[] sha1b = sha1(buffer); // sha1b = sha1(buffer) + Array.Copy(sharedKey, 32 + x, buffer, 0, 16); // buffer[0:16] = authKey[x+32:x+48] + Array.Copy(msgKey, 0, buffer, 16, 16); // buffer[16:32] = msgKey + Array.Copy(sharedKey, 48 + x, buffer, 32, 16); // buffer[32:48] = authKey[x+48:x+64] + var sha1b = sha1(buffer); // sha1b = sha1(buffer) - Array.Copy(sharedKey, 64 + x, buffer, 0, 32); // buffer[0:32] = authKey[x+64:x+96] - Array.Copy(msgKey, 0, buffer, 32, 16); // buffer[32:48] = msgKey - byte[] sha1c = sha1(buffer); // sha1c = sha1(buffer) + Array.Copy(sharedKey, 64 + x, buffer, 0, 32); // buffer[0:32] = authKey[x+64:x+96] + Array.Copy(msgKey, 0, buffer, 32, 16); // buffer[32:48] = msgKey + var sha1c = sha1(buffer); // sha1c = sha1(buffer) - Array.Copy(msgKey, 0, buffer, 0, 16); // buffer[0:16] = msgKey - Array.Copy(sharedKey, 96 + x, buffer, 16, 32); // buffer[16:48] = authKey[x+96:x+128] - byte[] sha1d = sha1(buffer); // sha1d = sha1(buffer) + Array.Copy(msgKey, 0, buffer, 0, 16); // buffer[0:16] = msgKey + Array.Copy(sharedKey, 96 + x, buffer, 16, 32); // buffer[16:48] = authKey[x+96:x+128] + var sha1d = sha1(buffer); // sha1d = sha1(buffer) - byte[] key = new byte[32]; // key = sha1a[0:8] + sha1b[8:20] + sha1c[4:16] + var key = new byte[32]; // key = sha1a[0:8] + sha1b[8:20] + sha1c[4:16] Array.Copy(sha1a, 0, key, 0, 8); Array.Copy(sha1b, 8, key, 8, 12); Array.Copy(sha1c, 4, key, 20, 12); - byte[] iv = new byte[32]; // iv = sha1a[8:20] + sha1b[0:8] + sha1c[16:20] + sha1d[0:8] + var iv = new byte[32]; // iv = sha1a[8:20] + sha1b[0:8] + sha1c[16:20] + sha1d[0:8] Array.Copy(sha1a, 8, iv, 0, 12); Array.Copy(sha1b, 0, iv, 12, 8); Array.Copy(sha1c, 16, iv, 20, 4); @@ -65,14 +65,14 @@ namespace TLSharp.Core.Utils public static byte[] CalcMsgKey(byte[] data) { - byte[] msgKey = new byte[16]; + var msgKey = new byte[16]; Array.Copy(sha1(data), 4, msgKey, 0, 16); return msgKey; } public static byte[] CalcMsgKey(byte[] data, int offset, int limit) { - byte[] msgKey = new byte[16]; + var msgKey = new byte[16]; Array.Copy(sha1(data, offset, limit), 4, msgKey, 0, 16); return msgKey; } @@ -93,4 +93,4 @@ namespace TLSharp.Core.Utils } } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/Utils/UploadHelper.cs b/TLSharp.Core/Utils/UploadHelper.cs index 68fc176..50de8f3 100644 --- a/TLSharp.Core/Utils/UploadHelper.cs +++ b/TLSharp.Core/Utils/UploadHelper.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; @@ -20,7 +19,7 @@ namespace TLSharp.Core.Utils var hash = md5.ComputeHash(data); var hashResult = new StringBuilder(hash.Length * 2); - foreach (byte t in hash) + foreach (var t in hash) hashResult.Append(t.ToString("x2")); md5_checksum = hashResult.ToString(); @@ -29,7 +28,8 @@ namespace TLSharp.Core.Utils return md5_checksum; } - public static async Task UploadFile(this TelegramClient client, string name, StreamReader reader) + public static async Task UploadFile(this TelegramClient client, string name, + StreamReader reader) { const long tenMb = 10 * 1024 * 1024; return await UploadFile(name, reader, client, reader.BaseStream.Length >= tenMb); @@ -41,7 +41,7 @@ namespace TLSharp.Core.Utils using (reader) { - reader.BaseStream.Read(file, 0, (int)reader.BaseStream.Length); + reader.BaseStream.Read(file, 0, (int) reader.BaseStream.Length); } return file; @@ -56,8 +56,7 @@ namespace TLSharp.Core.Utils using (var stream = new MemoryStream(file)) { while (stream.Position != stream.Length) - { - if ((stream.Length - stream.Position) > maxFilePart) + if (stream.Length - stream.Position > maxFilePart) { var temp = new byte[maxFilePart]; stream.Read(temp, 0, maxFilePart); @@ -67,10 +66,9 @@ namespace TLSharp.Core.Utils { var length = stream.Length - stream.Position; var temp = new byte[length]; - stream.Read(temp, 0, (int)(length)); + stream.Read(temp, 0, (int) length); fileParts.Enqueue(temp); } - } } return fileParts; @@ -82,15 +80,14 @@ namespace TLSharp.Core.Utils var file = GetFile(reader); var fileParts = GetFileParts(file); - int partNumber = 0; - int partsCount = fileParts.Count; - long file_id = BitConverter.ToInt64(Helpers.GenerateRandomBytes(8), 0); + var partNumber = 0; + var partsCount = fileParts.Count; + var file_id = BitConverter.ToInt64(Helpers.GenerateRandomBytes(8), 0); while (fileParts.Count != 0) { var part = fileParts.Dequeue(); if (isBigFileUpload) - { await client.SendRequestAsync(new TLRequestSaveBigFilePart { file_id = file_id, @@ -98,38 +95,30 @@ namespace TLSharp.Core.Utils bytes = part, file_total_parts = partsCount }); - } else - { await client.SendRequestAsync(new TLRequestSaveFilePart { file_id = file_id, file_part = partNumber, bytes = part }); - } partNumber++; } if (isBigFileUpload) - { return new TLInputFileBig { id = file_id, name = name, parts = partsCount }; - } - else + return new TLInputFile { - return new TLInputFile - { - id = file_id, - name = name, - parts = partsCount, - md5_checksum = GetFileHash(file) - }; - } + id = file_id, + name = name, + parts = partsCount, + md5_checksum = GetFileHash(file) + }; } } -} +} \ No newline at end of file diff --git a/TLSharp.Core/packages.config b/TLSharp.Core/packages.config index 0051856..460da5f 100644 --- a/TLSharp.Core/packages.config +++ b/TLSharp.Core/packages.config @@ -1,4 +1,5 @@  + diff --git a/TLSharp.Tests.NUnit/Test.cs b/TLSharp.Tests.NUnit/Test.cs index 40e54ac..724b1e5 100644 --- a/TLSharp.Tests.NUnit/Test.cs +++ b/TLSharp.Tests.NUnit/Test.cs @@ -1,7 +1,4 @@ - -using System; -using System.Threading.Tasks; - +using System.Threading.Tasks; using NUnit.Framework; namespace TLSharp.Tests @@ -16,7 +13,7 @@ namespace TLSharp.Tests } [Test] - public async override Task AuthUser() + public override async Task AuthUser() { await base.AuthUser(); } @@ -82,4 +79,4 @@ namespace TLSharp.Tests await base.SendMessageByUserNameTest(); } } -} +} \ No newline at end of file diff --git a/TLSharp.Tests.NUnit/packages.config b/TLSharp.Tests.NUnit/packages.config index c714ef3..49b3c20 100644 --- a/TLSharp.Tests.NUnit/packages.config +++ b/TLSharp.Tests.NUnit/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/TLSharp.Tests.VS/Properties/AssemblyInfo.cs b/TLSharp.Tests.VS/Properties/AssemblyInfo.cs index 2eef1f8..129f45e 100644 --- a/TLSharp.Tests.VS/Properties/AssemblyInfo.cs +++ b/TLSharp.Tests.VS/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TLSharp.Tests.VS/TLSharpTestsVs.cs b/TLSharp.Tests.VS/TLSharpTestsVs.cs index 8f6c58d..af4a531 100644 --- a/TLSharp.Tests.VS/TLSharpTestsVs.cs +++ b/TLSharp.Tests.VS/TLSharpTestsVs.cs @@ -1,6 +1,4 @@ - -using System.Threading.Tasks; - +using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TLSharp.Tests @@ -13,7 +11,7 @@ namespace TLSharp.Tests { base.Init(o => Assert.IsNotNull(o), b => Assert.IsTrue(b)); } - + [TestMethod] public override async Task AuthUser() { @@ -67,6 +65,7 @@ namespace TLSharp.Tests { await base.CheckPhones(); } + [TestMethod] [Ignore] public override async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError() @@ -80,4 +79,4 @@ namespace TLSharp.Tests await base.SendMessageByUserNameTest(); } } -} +} \ No newline at end of file diff --git a/TLSharp.Tests/Properties/AssemblyInfo.cs b/TLSharp.Tests/Properties/AssemblyInfo.cs index 706d0a4..4d1eec6 100644 --- a/TLSharp.Tests/Properties/AssemblyInfo.cs +++ b/TLSharp.Tests/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TLSharp.Tests/TLSharpTests.cs b/TLSharp.Tests/TLSharpTests.cs index 487b535..93d29c3 100644 --- a/TLSharp.Tests/TLSharpTests.cs +++ b/TLSharp.Tests/TLSharpTests.cs @@ -1,23 +1,22 @@ - -using System; +using System; using System.Configuration; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; - using TeleSharp.TL; using TeleSharp.TL.Messages; using TLSharp.Core; using TLSharp.Core.Network; -using TLSharp.Core.Requests; using TLSharp.Core.Utils; namespace TLSharp.Tests { public class TLSharpTests { + internal static Action IsNotNullHanlder; + internal static Action IsTrueHandler; private string NumberToSendMessage { get; set; } private string NumberToAuthenticate { get; set; } @@ -38,22 +37,6 @@ namespace TLSharp.Tests private int ApiId { get; set; } - class Assert - { - static internal void IsNotNull(object obj) - { - IsNotNullHanlder(obj); - } - - static internal void IsTrue(bool cond) - { - IsTrueHandler(cond); - } - } - - internal static Action IsNotNullHanlder; - internal static Action IsTrueHandler; - protected void Init(Action notNullHandler, Action trueHandler) { IsNotNullHanlder = notNullHandler; @@ -71,14 +54,15 @@ namespace TLSharp.Tests } catch (MissingApiConfigurationException ex) { - throw new Exception($"Please add your API settings to the `app.config` file. (More info: {MissingApiConfigurationException.InfoUrl})", - ex); + throw new Exception( + $"Please add your API settings to the `app.config` file. (More info: {MissingApiConfigurationException.InfoUrl})", + ex); } } private void GatherTestConfiguration() { - string appConfigMsgWarning = "{0} not configured in app.config! Some tests may fail."; + var appConfigMsgWarning = "{0} not configured in app.config! Some tests may fail."; ApiHash = ConfigurationManager.AppSettings[nameof(ApiHash)]; if (string.IsNullOrEmpty(ApiHash)) @@ -128,10 +112,9 @@ namespace TLSharp.Tests var hash = await client.SendCodeRequestAsync(NumberToAuthenticate); var code = CodeToAuthenticate; // you can change code in debugger too - if (String.IsNullOrWhiteSpace(code)) - { - throw new Exception("CodeToAuthenticate is empty in the app.config file, fill it with the code you just got now by SMS/Telegram"); - } + if (string.IsNullOrWhiteSpace(code)) + throw new Exception( + "CodeToAuthenticate is empty in the app.config file, fill it with the code you just got now by SMS/Telegram"); TLUser user = null; try @@ -143,12 +126,13 @@ namespace TLSharp.Tests var password = await client.GetPasswordSetting(); var password_str = PasswordToAuthenticate; - user = await client.MakeAuthWithPasswordAsync(password,password_str); + user = await client.MakeAuthWithPasswordAsync(password, password_str); } catch (InvalidPhoneCodeException ex) { - throw new Exception("CodeToAuthenticate is wrong in the app.config file, fill it with the code you just got now by SMS/Telegram", - ex); + throw new Exception( + "CodeToAuthenticate is wrong in the app.config file, fill it with the code you just got now by SMS/Telegram", + ex); } Assert.IsNotNull(user); Assert.IsTrue(client.IsUserAuthorized()); @@ -158,12 +142,13 @@ namespace TLSharp.Tests { NumberToSendMessage = ConfigurationManager.AppSettings[nameof(NumberToSendMessage)]; if (string.IsNullOrWhiteSpace(NumberToSendMessage)) - throw new Exception($"Please fill the '{nameof(NumberToSendMessage)}' setting in app.config file first"); + throw new Exception( + $"Please fill the '{nameof(NumberToSendMessage)}' setting in app.config file first"); // this is because the contacts in the address come without the "+" prefix - var normalizedNumber = NumberToSendMessage.StartsWith("+") ? - NumberToSendMessage.Substring(1, NumberToSendMessage.Length - 1) : - NumberToSendMessage; + var normalizedNumber = NumberToSendMessage.StartsWith("+") + ? NumberToSendMessage.Substring(1, NumberToSendMessage.Length - 1) + : NumberToSendMessage; var client = NewClient(); @@ -176,13 +161,11 @@ namespace TLSharp.Tests .FirstOrDefault(x => x.phone == normalizedNumber); if (user == null) - { - throw new System.Exception("Number was not found in Contacts List of user: " + NumberToSendMessage); - } + throw new Exception("Number was not found in Contacts List of user: " + NumberToSendMessage); - await client.SendTypingAsync(new TLInputPeerUser() { user_id = user.id }); + await client.SendTypingAsync(new TLInputPeerUser {user_id = user.id}); Thread.Sleep(3000); - await client.SendMessageAsync(new TLInputPeerUser() { user_id = user.id }, "TEST"); + await client.SendMessageAsync(new TLInputPeerUser {user_id = user.id}, "TEST"); } public virtual async Task SendMessageToChannelTest() @@ -196,7 +179,8 @@ namespace TLSharp.Tests .OfType() .FirstOrDefault(c => c.title == "TestGroup"); - await client.SendMessageAsync(new TLInputPeerChannel() { channel_id = chat.id, access_hash = chat.access_hash.Value }, "TEST MSG"); + await client.SendMessageAsync( + new TLInputPeerChannel {channel_id = chat.id, access_hash = chat.access_hash.Value}, "TEST MSG"); } public virtual async Task SendPhotoToContactTest() @@ -211,8 +195,8 @@ namespace TLSharp.Tests .OfType() .FirstOrDefault(x => x.phone == NumberToSendMessage); - var fileResult = (TLInputFile)await client.UploadFile("cat.jpg", new StreamReader("data/cat.jpg")); - await client.SendUploadedPhoto(new TLInputPeerUser() { user_id = user.id }, fileResult, "kitty"); + var fileResult = (TLInputFile) await client.UploadFile("cat.jpg", new StreamReader("data/cat.jpg")); + await client.SendUploadedPhoto(new TLInputPeerUser {user_id = user.id}, fileResult, "kitty"); } public virtual async Task SendBigFileToContactTest() @@ -227,10 +211,11 @@ namespace TLSharp.Tests .OfType() .FirstOrDefault(x => x.phone == NumberToSendMessage); - var fileResult = (TLInputFileBig)await client.UploadFile("some.zip", new StreamReader("")); + var fileResult = + (TLInputFileBig) await client.UploadFile("some.zip", new StreamReader("")); await client.SendUploadedDocument( - new TLInputPeerUser() { user_id = user.id }, + new TLInputPeerUser {user_id = user.id}, fileResult, "some zips", "application/zip", @@ -249,8 +234,8 @@ namespace TLSharp.Tests .OfType() .FirstOrDefault(x => x.phone == NumberToSendMessage); - var inputPeer = new TLInputPeerUser() { user_id = user.id }; - var res = await client.SendRequestAsync(new TLRequestGetHistory() { peer = inputPeer }); + var inputPeer = new TLInputPeerUser {user_id = user.id}; + var res = await client.SendRequestAsync(new TLRequestGetHistory {peer = inputPeer}); var document = res.messages.lists .OfType() .Where(m => m.media != null) @@ -261,14 +246,14 @@ namespace TLSharp.Tests .First(); var resFile = await client.GetFile( - new TLInputDocumentFileLocation() + new TLInputDocumentFileLocation { access_hash = document.access_hash, id = document.id, version = document.version }, document.size); - + Assert.IsTrue(resFile.bytes.Length > 0); } @@ -283,18 +268,18 @@ namespace TLSharp.Tests var user = result.users.lists .OfType() .FirstOrDefault(x => x.id == 5880094); - - var photo = ((TLUserProfilePhoto)user.photo); + + var photo = (TLUserProfilePhoto) user.photo; var photoLocation = (TLFileLocation) photo.photo_big; - var resFile = await client.GetFile(new TLInputFileLocation() + var resFile = await client.GetFile(new TLInputFileLocation { local_id = photoLocation.local_id, secret = photoLocation.secret, volume_id = photoLocation.volume_id }, 1024); - var res = await client.GetUserDialogsAsync(); + var res = await client.GetUserDialogsAsync(); Assert.IsTrue(resFile.bytes.Length > 0); } @@ -326,8 +311,7 @@ namespace TLSharp.Tests public virtual async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError() { - for (int i = 0; i < 50; i++) - { + for (var i = 0; i < 50; i++) try { await CheckPhones(); @@ -337,14 +321,14 @@ namespace TLSharp.Tests Console.WriteLine($"FLOODEXCEPTION: {floodException}"); Thread.Sleep(floodException.TimeToWait); } - } } public virtual async Task SendMessageByUserNameTest() { UserNameToSendMessage = ConfigurationManager.AppSettings[nameof(UserNameToSendMessage)]; if (string.IsNullOrWhiteSpace(UserNameToSendMessage)) - throw new Exception($"Please fill the '{nameof(UserNameToSendMessage)}' setting in app.config file first"); + throw new Exception( + $"Please fill the '{nameof(UserNameToSendMessage)}' setting in app.config file first"); var client = NewClient(); @@ -368,13 +352,24 @@ namespace TLSharp.Tests } if (user == null) + throw new Exception("Username was not found: " + UserNameToSendMessage); + + await client.SendTypingAsync(new TLInputPeerUser {user_id = user.id}); + Thread.Sleep(3000); + await client.SendMessageAsync(new TLInputPeerUser {user_id = user.id}, "TEST"); + } + + private class Assert + { + internal static void IsNotNull(object obj) { - throw new System.Exception("Username was not found: " + UserNameToSendMessage); + IsNotNullHanlder(obj); } - await client.SendTypingAsync(new TLInputPeerUser() { user_id = user.id }); - Thread.Sleep(3000); - await client.SendMessageAsync(new TLInputPeerUser() { user_id = user.id }, "TEST"); + internal static void IsTrue(bool cond) + { + IsTrueHandler(cond); + } } } -} +} \ No newline at end of file diff --git a/TLSharp.Tests/app.config b/TLSharp.Tests/app.config index 490261d..eaf69f7 100644 --- a/TLSharp.Tests/app.config +++ b/TLSharp.Tests/app.config @@ -1,15 +1,16 @@ - + + - - - - - - + + + + + + - + \ No newline at end of file diff --git a/TLSharp.Tests/packages.config b/TLSharp.Tests/packages.config index 6b8deb9..98e4889 100644 --- a/TLSharp.Tests/packages.config +++ b/TLSharp.Tests/packages.config @@ -1,3 +1,4 @@  + \ No newline at end of file diff --git a/TeleSharp.Generator/App.config b/TeleSharp.Generator/App.config index 88fa402..51fffc7 100644 --- a/TeleSharp.Generator/App.config +++ b/TeleSharp.Generator/App.config @@ -1,6 +1,7 @@ - + + - - - + + + \ No newline at end of file diff --git a/TeleSharp.Generator/Models.cs b/TeleSharp.Generator/Models.cs index 8e43820..61f6c5f 100644 --- a/TeleSharp.Generator/Models.cs +++ b/TeleSharp.Generator/Models.cs @@ -1,36 +1,38 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json.Schema; +using System.Collections.Generic; + namespace TeleSharp.Generator { - class Method + internal class Method { public int id { get; set; } public string method { get; set; } + [Newtonsoft.Json.JsonProperty("params")] public List Params { get; set; } - public string type { get; set; } + public string type { get; set; } } - class Param + + internal class Param { public string name { get; set; } public string type { get; set; } } - class Constructor + + internal class Constructor { public int id { get; set; } public string predicate { get; set; } + [Newtonsoft.Json.JsonProperty("params")] public List Params { get; set; } + public string type { get; set; } } - class Schema + + internal class Schema { public List constructors { get; set; } public List methods { get; set; } } -} +} \ No newline at end of file diff --git a/TeleSharp.Generator/Program.cs b/TeleSharp.Generator/Program.cs index 535017b..6875510 100644 --- a/TeleSharp.Generator/Program.cs +++ b/TeleSharp.Generator/Program.cs @@ -1,35 +1,44 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.CodeDom; -using System.Reflection; -using System.Text.RegularExpressions; +using Newtonsoft.Json; namespace TeleSharp.Generator { - class Program + internal class Program { - static List keywords = new List(new string[] { "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", "event", "explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", "in", "int", "interface", "internal", "is", "lock", "long", "namespace", "new", "null", "object", "operator", "out", "out", "override", "params", "private", "protected", "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", "using", "virtual", "void", "volatile", "while", "add", "alias", "ascending", "async", "await", "descending", "dynamic", "from", "get", "global", "group", "into", "join", "let", "orderby", "partial", "partial", "remove", "select", "set", "value", "var", "where", "where", "yield" }); - static List interfacesList = new List(); - static List classesList = new List(); - static void Main(string[] args) + private static readonly List keywords = new List(new[] { + "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", + "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", "event", "explicit", "extern", + "false", "finally", "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", "in", "int", + "interface", "internal", "is", "lock", "long", "namespace", "new", "null", "object", "operator", "out", + "out", "override", "params", "private", "protected", "public", "readonly", "ref", "return", "sbyte", + "sealed", "short", "sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw", "true", + "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", "using", "virtual", "void", "volatile", + "while", "add", "alias", "ascending", "async", "await", "descending", "dynamic", "from", "get", "global", + "group", "into", "join", "let", "orderby", "partial", "partial", "remove", "select", "set", "value", "var", + "where", "where", "yield" + }); - string AbsStyle = File.ReadAllText("ConstructorAbs.tmp"); - string NormalStyle = File.ReadAllText("Constructor.tmp"); - string MethodStyle = File.ReadAllText("Method.tmp"); + private static readonly List interfacesList = new List(); + private static readonly List classesList = new List(); + + private static void Main(string[] args) + { + var AbsStyle = File.ReadAllText("ConstructorAbs.tmp"); + var NormalStyle = File.ReadAllText("Constructor.tmp"); + var MethodStyle = File.ReadAllText("Method.tmp"); //string method = File.ReadAllText("constructor.tt"); - string Json = ""; + var Json = ""; string url; - if (args.Count() == 0) url = "tl-schema.json"; else url = args[0]; + if (args.Count() == 0) url = "tl-schema.json"; + else url = args[0]; Json = File.ReadAllText(url); - FileStream file = File.OpenWrite("Result.cs"); - StreamWriter sw = new StreamWriter(file); + var file = File.OpenWrite("Result.cs"); + var sw = new StreamWriter(file); Schema schema = JsonConvert.DeserializeObject(Json); foreach (var c in schema.constructors) { @@ -41,14 +50,19 @@ namespace TeleSharp.Generator var list = schema.constructors.Where(x => x.type == c.type); if (list.Count() > 1) { - string path = (GetNameSpace(c.type).Replace("TeleSharp.TL", "TL\\").Replace(".", "") + "\\" + GetNameofClass(c.type, true) + ".cs").Replace("\\\\", "\\"); - FileStream classFile = MakeFile(path); - using (StreamWriter writer = new StreamWriter(classFile)) + var path = (GetNameSpace(c.type).Replace("TeleSharp.TL", "TL\\").Replace(".", "") + "\\" + + GetNameofClass(c.type, true) + ".cs").Replace("\\\\", "\\"); + var classFile = MakeFile(path); + using (var writer = new StreamWriter(classFile)) { - string nspace = (GetNameSpace(c.type).Replace("TeleSharp.TL", "TL\\").Replace(".", "")).Replace("\\\\", "\\").Replace("\\", "."); + var nspace = GetNameSpace(c.type) + .Replace("TeleSharp.TL", "TL\\") + .Replace(".", "") + .Replace("\\\\", "\\") + .Replace("\\", "."); if (nspace.EndsWith(".")) nspace = nspace.Remove(nspace.Length - 1, 1); - string temp = AbsStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); + var temp = AbsStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); temp = temp.Replace("/* NAME */", GetNameofClass(c.type, true)); writer.Write(temp); writer.Close(); @@ -63,65 +77,85 @@ namespace TeleSharp.Generator } foreach (var c in schema.constructors) { - string path = (GetNameSpace(c.predicate).Replace("TeleSharp.TL", "TL\\").Replace(".", "") + "\\" + GetNameofClass(c.predicate, false) + ".cs").Replace("\\\\", "\\"); - FileStream classFile = MakeFile(path); - using (StreamWriter writer = new StreamWriter(classFile)) + var path = (GetNameSpace(c.predicate).Replace("TeleSharp.TL", "TL\\").Replace(".", "") + "\\" + + GetNameofClass(c.predicate, false) + ".cs").Replace("\\\\", "\\"); + var classFile = MakeFile(path); + using (var writer = new StreamWriter(classFile)) { #region About Class - string nspace = (GetNameSpace(c.predicate).Replace("TeleSharp.TL", "TL\\").Replace(".", "")).Replace("\\\\", "\\").Replace("\\", "."); + + var nspace = GetNameSpace(c.predicate) + .Replace("TeleSharp.TL", "TL\\") + .Replace(".", "") + .Replace("\\\\", "\\") + .Replace("\\", "."); if (nspace.EndsWith(".")) nspace = nspace.Remove(nspace.Length - 1, 1); - string temp = NormalStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); - temp = (c.type == "himself") ? temp.Replace("/* PARENT */", "TLObject") : temp.Replace("/* PARENT */", GetNameofClass(c.type, true)); + var temp = NormalStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); + temp = c.type == "himself" + ? temp.Replace("/* PARENT */", "TLObject") + : temp.Replace("/* PARENT */", GetNameofClass(c.type, true)); temp = temp.Replace("/*Constructor*/", c.id.ToString()); temp = temp.Replace("/* NAME */", GetNameofClass(c.predicate, false)); + #endregion + #region Fields - string fields = ""; + + var fields = ""; foreach (var tmp in c.Params) - { - fields += $" public {CheckForFlagBase(tmp.type, GetTypeName(tmp.type))} {CheckForKeyword(tmp.name)} " + "{get;set;}" + Environment.NewLine; - } + fields += + $" public {CheckForFlagBase(tmp.type, GetTypeName(tmp.type))} {CheckForKeyword(tmp.name)} " + + "{get;set;}" + Environment.NewLine; temp = temp.Replace("/* PARAMS */", fields); + #endregion + #region ComputeFlagFunc - if (!c.Params.Any(x => x.name == "flags")) temp = temp.Replace("/* COMPUTE */", ""); + + if (!c.Params.Any(x => x.name == "flags")) + { + temp = temp.Replace("/* COMPUTE */", ""); + } else { var compute = "flags = 0;" + Environment.NewLine; foreach (var param in c.Params.Where(x => IsFlagBase(x.type))) - { if (IsTrueFlag(param.type)) - { - compute += $"flags = {CheckForKeyword(param.name)} ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + Environment.NewLine; - } + compute += + $"flags = {CheckForKeyword(param.name)} ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + + Environment.NewLine; else - { - compute += $"flags = {CheckForKeyword(param.name)} != null ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + Environment.NewLine; - } - } + compute += + $"flags = {CheckForKeyword(param.name)} != null ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + + Environment.NewLine; temp = temp.Replace("/* COMPUTE */", compute); } + #endregion + #region SerializeFunc + var serialize = ""; - if (c.Params.Any(x => x.name == "flags")) serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(flags);" + Environment.NewLine; + if (c.Params.Any(x => x.name == "flags")) + serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(flags);" + Environment.NewLine; foreach (var p in c.Params.Where(x => x.name != "flags")) - { serialize += WriteWriteCode(p) + Environment.NewLine; - } temp = temp.Replace("/* SERIALIZE */", serialize); + #endregion + #region DeSerializeFunc + var deserialize = ""; foreach (var p in c.Params) - { deserialize += WriteReadCode(p) + Environment.NewLine; - } temp = temp.Replace("/* DESERIALIZE */", deserialize); + #endregion + writer.Write(temp); writer.Close(); classFile.Close(); @@ -129,151 +163,174 @@ namespace TeleSharp.Generator } foreach (var c in schema.methods) { - string path = (GetNameSpace(c.method).Replace("TeleSharp.TL", "TL\\").Replace(".", "") + "\\" + GetNameofClass(c.method, false, true) + ".cs").Replace("\\\\", "\\"); - FileStream classFile = MakeFile(path); - using (StreamWriter writer = new StreamWriter(classFile)) + var path = (GetNameSpace(c.method).Replace("TeleSharp.TL", "TL\\").Replace(".", "") + "\\" + + GetNameofClass(c.method, false, true) + ".cs").Replace("\\\\", "\\"); + var classFile = MakeFile(path); + using (var writer = new StreamWriter(classFile)) { #region About Class - string nspace = (GetNameSpace(c.method).Replace("TeleSharp.TL", "TL\\").Replace(".", "")).Replace("\\\\", "\\").Replace("\\", "."); + + var nspace = GetNameSpace(c.method) + .Replace("TeleSharp.TL", "TL\\") + .Replace(".", "") + .Replace("\\\\", "\\") + .Replace("\\", "."); if (nspace.EndsWith(".")) nspace = nspace.Remove(nspace.Length - 1, 1); - string temp = MethodStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); + var temp = MethodStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); temp = temp.Replace("/* PARENT */", "TLMethod"); temp = temp.Replace("/*Constructor*/", c.id.ToString()); temp = temp.Replace("/* NAME */", GetNameofClass(c.method, false, true)); + #endregion + #region Fields - string fields = ""; + + var fields = ""; foreach (var tmp in c.Params) - { - fields += $" public {CheckForFlagBase(tmp.type, GetTypeName(tmp.type))} {CheckForKeyword(tmp.name)} " + "{get;set;}" + Environment.NewLine; - } - fields += $" public {CheckForFlagBase(c.type, GetTypeName(c.type))} Response" + "{ get; set;}" + Environment.NewLine; + fields += + $" public {CheckForFlagBase(tmp.type, GetTypeName(tmp.type))} {CheckForKeyword(tmp.name)} " + + "{get;set;}" + Environment.NewLine; + fields += $" public {CheckForFlagBase(c.type, GetTypeName(c.type))} Response" + + "{ get; set;}" + Environment.NewLine; temp = temp.Replace("/* PARAMS */", fields); + #endregion + #region ComputeFlagFunc - if (!c.Params.Any(x => x.name == "flags")) temp = temp.Replace("/* COMPUTE */", ""); + + if (!c.Params.Any(x => x.name == "flags")) + { + temp = temp.Replace("/* COMPUTE */", ""); + } else { var compute = "flags = 0;" + Environment.NewLine; foreach (var param in c.Params.Where(x => IsFlagBase(x.type))) - { if (IsTrueFlag(param.type)) - { - compute += $"flags = {CheckForKeyword(param.name)} ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + Environment.NewLine; - } + compute += + $"flags = {CheckForKeyword(param.name)} ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + + Environment.NewLine; else - { - compute += $"flags = {CheckForKeyword(param.name)} != null ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + Environment.NewLine; - } - } + compute += + $"flags = {CheckForKeyword(param.name)} != null ? (flags | {GetBitMask(param.type)}) : (flags & ~{GetBitMask(param.type)});" + + Environment.NewLine; temp = temp.Replace("/* COMPUTE */", compute); } + #endregion + #region SerializeFunc + var serialize = ""; - if (c.Params.Any(x => x.name == "flags")) serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(flags);" + Environment.NewLine; + if (c.Params.Any(x => x.name == "flags")) + serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(flags);" + Environment.NewLine; foreach (var p in c.Params.Where(x => x.name != "flags")) - { serialize += WriteWriteCode(p) + Environment.NewLine; - } temp = temp.Replace("/* SERIALIZE */", serialize); + #endregion + #region DeSerializeFunc + var deserialize = ""; foreach (var p in c.Params) - { deserialize += WriteReadCode(p) + Environment.NewLine; - } temp = temp.Replace("/* DESERIALIZE */", deserialize); + #endregion + #region DeSerializeRespFunc + var deserializeResp = ""; - Param p2 = new Param() { name = "Response", type = c.type }; + var p2 = new Param {name = "Response", type = c.type}; deserializeResp += WriteReadCode(p2) + Environment.NewLine; temp = temp.Replace("/* DESERIALIZEResp */", deserializeResp); + #endregion + writer.Write(temp); writer.Close(); classFile.Close(); } } } + public static string FormatName(string input) { - if (String.IsNullOrEmpty(input)) + if (string.IsNullOrEmpty(input)) throw new ArgumentException("ARGH!"); if (input.IndexOf('.') != -1) { input = input.Replace(".", " "); var temp = ""; foreach (var s in input.Split(' ')) - { temp += FormatName(s) + " "; - } input = temp.Trim(); } return input.First().ToString().ToUpper() + input.Substring(1); } + public static string CheckForKeyword(string name) { if (keywords.Contains(name)) return "@" + name; return name; } + public static string GetNameofClass(string type, bool isinterface = false, bool ismethod = false) { if (!ismethod) - { if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1) - return isinterface ? "TLAbs" + FormatName(type.Split('.')[1]) : "TL" + FormatName(type.Split('.')[1]); + return isinterface + ? "TLAbs" + FormatName(type.Split('.')[1]) + : "TL" + FormatName(type.Split('.')[1]); else if (type.IndexOf('.') != -1 && type.IndexOf('?') != -1) - return isinterface ? "TLAbs" + FormatName(type.Split('?')[1]) : "TL" + FormatName(type.Split('?')[1]); + return isinterface + ? "TLAbs" + FormatName(type.Split('?')[1]) + : "TL" + FormatName(type.Split('?')[1]); else return isinterface ? "TLAbs" + FormatName(type) : "TL" + FormatName(type); - } - else - { - if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1) - return "TLRequest" + FormatName(type.Split('.')[1]); - else if (type.IndexOf('.') != -1 && type.IndexOf('?') != -1) - return "TLRequest" + FormatName(type.Split('?')[1]); - else - return "TLRequest" + FormatName(type); - } + if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1) + return "TLRequest" + FormatName(type.Split('.')[1]); + if (type.IndexOf('.') != -1 && type.IndexOf('?') != -1) + return "TLRequest" + FormatName(type.Split('?')[1]); + return "TLRequest" + FormatName(type); } + private static bool IsFlagBase(string type) { return type.IndexOf("?") != -1; } + private static int GetBitMask(string type) { - return (int)Math.Pow((double)2, (double)int.Parse(type.Split('?')[0].Split('.')[1])); + return (int) Math.Pow(2, int.Parse(type.Split('?')[0].Split('.')[1])); } + private static bool IsTrueFlag(string type) { return type.Split('?')[1] == "true"; } + public static string GetNameSpace(string type) { if (type.IndexOf('.') != -1) return "TeleSharp.TL" + FormatName(type.Split('.')[0]); - else - return "TeleSharp.TL"; + return "TeleSharp.TL"; } + public static string CheckForFlagBase(string type, string result) { if (type.IndexOf('?') == -1) return result; - else - { - string innerType = type.Split('?')[1]; - if (innerType == "true") return result; - else if ((new string[] { "bool", "int", "uint", "long", "double" }).Contains(result)) return result + "?"; - else return result; - } + var innerType = type.Split('?')[1]; + if (innerType == "true") return result; + if (new[] {"bool", "int", "uint", "long", "double"}.Contains(result)) return result + "?"; + return result; } + public static string GetTypeName(string type) { switch (type.ToLower()) @@ -308,75 +365,74 @@ namespace TeleSharp.Generator if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1) - { - - if (interfacesList.Any(x => x.ToLower() == (type).ToLower())) + if (interfacesList.Any(x => x.ToLower() == type.ToLower())) return FormatName(type.Split('.')[0]) + "." + "TLAbs" + type.Split('.')[1]; - else if (classesList.Any(x => x.ToLower() == (type).ToLower())) + else if (classesList.Any(x => x.ToLower() == type.ToLower())) return FormatName(type.Split('.')[0]) + "." + "TL" + type.Split('.')[1]; else return FormatName(type.Split('.')[1]); - } - else if (type.IndexOf('?') == -1) - { + if (type.IndexOf('?') == -1) if (interfacesList.Any(x => x.ToLower() == type.ToLower())) return "TLAbs" + type; else if (classesList.Any(x => x.ToLower() == type.ToLower())) return "TL" + type; else return type; - } - else - { - return GetTypeName(type.Split('?')[1]); - } - - + return GetTypeName(type.Split('?')[1]); } + public static string LookTypeInLists(string src) { if (interfacesList.Any(x => x.ToLower() == src.ToLower())) return "TLAbs" + FormatName(src); - else if (classesList.Any(x => x.ToLower() == src.ToLower())) + if (classesList.Any(x => x.ToLower() == src.ToLower())) return "TL" + FormatName(src); - else - return src; + return src; } + public static string WriteWriteCode(Param p, bool flag = false) { switch (p.type.ToLower()) { case "#": case "int": - return flag ? $"bw.Write({CheckForKeyword(p.name)}.Value);" : $"bw.Write({CheckForKeyword(p.name)});"; + return flag + ? $"bw.Write({CheckForKeyword(p.name)}.Value);" + : $"bw.Write({CheckForKeyword(p.name)});"; case "long": - return flag ? $"bw.Write({CheckForKeyword(p.name)}.Value);" : $"bw.Write({CheckForKeyword(p.name)});"; + return flag + ? $"bw.Write({CheckForKeyword(p.name)}.Value);" + : $"bw.Write({CheckForKeyword(p.name)});"; case "string": return $"StringUtil.Serialize({CheckForKeyword(p.name)},bw);"; case "bool": - return flag ? $"BoolUtil.Serialize({CheckForKeyword(p.name)}.Value,bw);" : $"BoolUtil.Serialize({CheckForKeyword(p.name)},bw);"; + return flag + ? $"BoolUtil.Serialize({CheckForKeyword(p.name)}.Value,bw);" + : $"BoolUtil.Serialize({CheckForKeyword(p.name)},bw);"; case "true": return $"BoolUtil.Serialize({CheckForKeyword(p.name)},bw);"; case "bytes": return $"BytesUtil.Serialize({CheckForKeyword(p.name)},bw);"; case "double": - return flag ? $"bw.Write({CheckForKeyword(p.name)}.Value);" : $"bw.Write({CheckForKeyword(p.name)});"; + return flag + ? $"bw.Write({CheckForKeyword(p.name)}.Value);" + : $"bw.Write({CheckForKeyword(p.name)});"; default: if (!IsFlagBase(p.type)) + { return $"ObjectUtils.SerializeObject({CheckForKeyword(p.name)},bw);"; + } else { if (IsTrueFlag(p.type)) return $""; - else - { - Param p2 = new Param() { name = p.name, type = p.type.Split('?')[1] }; - return $"if ((flags & {GetBitMask(p.type).ToString()}) != 0)" + Environment.NewLine + - WriteWriteCode(p2, true); - } + var p2 = new Param {name = p.name, type = p.type.Split('?')[1]}; + return $"if ((flags & {GetBitMask(p.type)}) != 0)" + Environment.NewLine + + WriteWriteCode(p2, true); } } } + public static string WriteReadCode(Param p) { switch (p.type.ToLower()) @@ -399,26 +455,25 @@ namespace TeleSharp.Generator if (!IsFlagBase(p.type)) { if (p.type.ToLower().Contains("vector")) - { - return $"{CheckForKeyword(p.name)} = ({GetTypeName(p.type)})ObjectUtils.DeserializeVector<{GetTypeName(p.type).Replace("TLVector<", "").Replace(">", "")}>(br);"; - } - else return $"{CheckForKeyword(p.name)} = ({GetTypeName(p.type)})ObjectUtils.DeserializeObject(br);"; + return + $"{CheckForKeyword(p.name)} = ({GetTypeName(p.type)})ObjectUtils.DeserializeVector<{GetTypeName(p.type).Replace("TLVector<", "").Replace(">", "")}>(br);"; + return $"{CheckForKeyword(p.name)} = ({GetTypeName(p.type)})ObjectUtils.DeserializeObject(br);"; } else { if (IsTrueFlag(p.type)) - return $"{CheckForKeyword(p.name)} = (flags & {GetBitMask(p.type).ToString()}) != 0;"; - else { - Param p2 = new Param() { name = p.name, type = p.type.Split('?')[1] }; - return $"if ((flags & {GetBitMask(p.type).ToString()}) != 0)" + Environment.NewLine + - WriteReadCode(p2) + Environment.NewLine + - "else" + Environment.NewLine + - $"{CheckForKeyword(p.name)} = null;" + Environment.NewLine; + return $"{CheckForKeyword(p.name)} = (flags & {GetBitMask(p.type)}) != 0;"; } + var p2 = new Param {name = p.name, type = p.type.Split('?')[1]}; + return $"if ((flags & {GetBitMask(p.type)}) != 0)" + Environment.NewLine + + WriteReadCode(p2) + Environment.NewLine + + "else" + Environment.NewLine + + $"{CheckForKeyword(p.name)} = null;" + Environment.NewLine; } } } + public static FileStream MakeFile(string path) { if (!Directory.Exists(Path.GetDirectoryName(path))) @@ -428,5 +483,4 @@ namespace TeleSharp.Generator return File.OpenWrite(path); } } - } \ No newline at end of file diff --git a/TeleSharp.Generator/Properties/AssemblyInfo.cs b/TeleSharp.Generator/Properties/AssemblyInfo.cs index 7c4146a..143fffd 100644 --- a/TeleSharp.Generator/Properties/AssemblyInfo.cs +++ b/TeleSharp.Generator/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TeleSharp.Generator/packages.config b/TeleSharp.Generator/packages.config index 9d64bf3..5e6b4fe 100644 --- a/TeleSharp.Generator/packages.config +++ b/TeleSharp.Generator/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/TeleSharp.TL/ObjectDeserializer.cs b/TeleSharp.TL/ObjectDeserializer.cs index 3c695ab..2abd794 100644 --- a/TeleSharp.TL/ObjectDeserializer.cs +++ b/TeleSharp.TL/ObjectDeserializer.cs @@ -1,50 +1,48 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public class ObjectUtils { public static object DeserializeObject(BinaryReader reader) { - int Constructor = reader.ReadInt32(); + var Constructor = reader.ReadInt32(); object obj; - Type t =null; - try { + Type t = null; + try + { t = TLContext.getType(Constructor); obj = Activator.CreateInstance(t); } - catch(Exception ex) + catch (Exception ex) { throw new InvalidDataException("Constructor Invalid Or Context.Init Not Called !", ex); } if (t.IsSubclassOf(typeof(TLMethod))) { - ((TLMethod)obj).deserializeResponse(reader); + ((TLMethod) obj).deserializeResponse(reader); return obj; } - else if (t.IsSubclassOf(typeof(TLObject))) + if (t.IsSubclassOf(typeof(TLObject))) { - ((TLObject)obj).DeserializeBody(reader); + ((TLObject) obj).DeserializeBody(reader); return obj; } - else throw new NotImplementedException("Weird Type : " + t.Namespace + " | " + t.Name); + throw new NotImplementedException("Weird Type : " + t.Namespace + " | " + t.Name); } - public static void SerializeObject(object obj,BinaryWriter writer) + + public static void SerializeObject(object obj, BinaryWriter writer) { - ((TLObject)obj).SerializeBody(writer); + ((TLObject) obj).SerializeBody(writer); } + public static TLVector DeserializeVector(BinaryReader reader) { if (reader.ReadInt32() != 481674261) throw new InvalidDataException("Bad Constructor"); - TLVector t = new TLVector(); + var t = new TLVector(); t.DeserializeBody(reader); return t; } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/Properties/AssemblyInfo.cs b/TeleSharp.TL/Properties/AssemblyInfo.cs index 3ff3c97..e166dba 100644 --- a/TeleSharp.TL/Properties/AssemblyInfo.cs +++ b/TeleSharp.TL/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLAbsPassword.cs b/TeleSharp.TL/TL/Account/TLAbsPassword.cs index 9bfacaf..7570a8b 100644 --- a/TeleSharp.TL/TL/Account/TLAbsPassword.cs +++ b/TeleSharp.TL/TL/Account/TLAbsPassword.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Account { public abstract class TLAbsPassword : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLAuthorizations.cs b/TeleSharp.TL/TL/Account/TLAuthorizations.cs index 4d27cad..c2b8c3c 100644 --- a/TeleSharp.TL/TL/Account/TLAuthorizations.cs +++ b/TeleSharp.TL/TL/Account/TLAuthorizations.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(307276766)] + [TLObject(307276766)] public class TLAuthorizations : TLObject { - public override int Constructor + public override int Constructor => 307276766; + + public TLVector authorizations { get; set; } + + + public void ComputeFlags() { - get - { - return 307276766; - } } - public TLVector authorizations {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - authorizations = (TLVector)ObjectUtils.DeserializeVector(br); - + authorizations = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(authorizations,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(authorizations, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLNoPassword.cs b/TeleSharp.TL/TL/Account/TLNoPassword.cs index 23d604d..bcc8b88 100644 --- a/TeleSharp.TL/TL/Account/TLNoPassword.cs +++ b/TeleSharp.TL/TL/Account/TLNoPassword.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-1764049896)] + [TLObject(-1764049896)] public class TLNoPassword : TLAbsPassword { - public override int Constructor + public override int Constructor => -1764049896; + + public byte[] new_salt { get; set; } + public string email_unconfirmed_pattern { get; set; } + + + public void ComputeFlags() { - get - { - return -1764049896; - } } - public byte[] new_salt {get;set;} - public string email_unconfirmed_pattern {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { new_salt = BytesUtil.Deserialize(br); -email_unconfirmed_pattern = StringUtil.Deserialize(br); - + email_unconfirmed_pattern = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(new_salt,bw); -StringUtil.Serialize(email_unconfirmed_pattern,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(new_salt, bw); + StringUtil.Serialize(email_unconfirmed_pattern, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLPassword.cs b/TeleSharp.TL/TL/Account/TLPassword.cs index 1fc6dc0..8cf15da 100644 --- a/TeleSharp.TL/TL/Account/TLPassword.cs +++ b/TeleSharp.TL/TL/Account/TLPassword.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(2081952796)] + [TLObject(2081952796)] public class TLPassword : TLAbsPassword { - public override int Constructor + public override int Constructor => 2081952796; + + public byte[] current_salt { get; set; } + public byte[] new_salt { get; set; } + public string hint { get; set; } + public bool has_recovery { get; set; } + public string email_unconfirmed_pattern { get; set; } + + + public void ComputeFlags() { - get - { - return 2081952796; - } } - public byte[] current_salt {get;set;} - public byte[] new_salt {get;set;} - public string hint {get;set;} - public bool has_recovery {get;set;} - public string email_unconfirmed_pattern {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { current_salt = BytesUtil.Deserialize(br); -new_salt = BytesUtil.Deserialize(br); -hint = StringUtil.Deserialize(br); -has_recovery = BoolUtil.Deserialize(br); -email_unconfirmed_pattern = StringUtil.Deserialize(br); - + new_salt = BytesUtil.Deserialize(br); + hint = StringUtil.Deserialize(br); + has_recovery = BoolUtil.Deserialize(br); + email_unconfirmed_pattern = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(current_salt,bw); -BytesUtil.Serialize(new_salt,bw); -StringUtil.Serialize(hint,bw); -BoolUtil.Serialize(has_recovery,bw); -StringUtil.Serialize(email_unconfirmed_pattern,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(current_salt, bw); + BytesUtil.Serialize(new_salt, bw); + StringUtil.Serialize(hint, bw); + BoolUtil.Serialize(has_recovery, bw); + StringUtil.Serialize(email_unconfirmed_pattern, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs b/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs index e581108..2be0c5f 100644 --- a/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs +++ b/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs @@ -1,80 +1,65 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-2037289493)] + [TLObject(-2037289493)] public class TLPasswordInputSettings : TLObject { - public override int Constructor + public override int Constructor => -2037289493; + + public int flags { get; set; } + public byte[] new_salt { get; set; } + public byte[] new_password_hash { get; set; } + public string hint { get; set; } + public string email { get; set; } + + + public void ComputeFlags() { - get - { - return -2037289493; - } + flags = 0; + flags = new_salt != null ? flags | 1 : flags & ~1; + flags = new_password_hash != null ? flags | 1 : flags & ~1; + flags = hint != null ? flags | 1 : flags & ~1; + flags = email != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public byte[] new_salt {get;set;} - public byte[] new_password_hash {get;set;} - public string hint {get;set;} - public string email {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = new_salt != null ? (flags | 1) : (flags & ~1); -flags = new_password_hash != null ? (flags | 1) : (flags & ~1); -flags = hint != null ? (flags | 1) : (flags & ~1); -flags = email != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -if ((flags & 1) != 0) -new_salt = BytesUtil.Deserialize(br); -else -new_salt = null; + if ((flags & 1) != 0) + new_salt = BytesUtil.Deserialize(br); + else + new_salt = null; -if ((flags & 1) != 0) -new_password_hash = BytesUtil.Deserialize(br); -else -new_password_hash = null; - -if ((flags & 1) != 0) -hint = StringUtil.Deserialize(br); -else -hint = null; - -if ((flags & 2) != 0) -email = StringUtil.Deserialize(br); -else -email = null; + if ((flags & 1) != 0) + new_password_hash = BytesUtil.Deserialize(br); + else + new_password_hash = null; + if ((flags & 1) != 0) + hint = StringUtil.Deserialize(br); + else + hint = null; + if ((flags & 2) != 0) + email = StringUtil.Deserialize(br); + else + email = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -if ((flags & 1) != 0) -BytesUtil.Serialize(new_salt,bw); -if ((flags & 1) != 0) -BytesUtil.Serialize(new_password_hash,bw); -if ((flags & 1) != 0) -StringUtil.Serialize(hint,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(email,bw); - + bw.Write(flags); + if ((flags & 1) != 0) + BytesUtil.Serialize(new_salt, bw); + if ((flags & 1) != 0) + BytesUtil.Serialize(new_password_hash, bw); + if ((flags & 1) != 0) + StringUtil.Serialize(hint, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(email, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLPasswordSettings.cs b/TeleSharp.TL/TL/Account/TLPasswordSettings.cs index bb8c1f4..0f03ce6 100644 --- a/TeleSharp.TL/TL/Account/TLPasswordSettings.cs +++ b/TeleSharp.TL/TL/Account/TLPasswordSettings.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-1212732749)] + [TLObject(-1212732749)] public class TLPasswordSettings : TLObject { - public override int Constructor + public override int Constructor => -1212732749; + + public string email { get; set; } + + + public void ComputeFlags() { - get - { - return -1212732749; - } } - public string email {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { email = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(email,bw); - + bw.Write(Constructor); + StringUtil.Serialize(email, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLPrivacyRules.cs b/TeleSharp.TL/TL/Account/TLPrivacyRules.cs index 6ede6a3..e6702dd 100644 --- a/TeleSharp.TL/TL/Account/TLPrivacyRules.cs +++ b/TeleSharp.TL/TL/Account/TLPrivacyRules.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1430961007)] + [TLObject(1430961007)] public class TLPrivacyRules : TLObject { - public override int Constructor + public override int Constructor => 1430961007; + + public TLVector rules { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1430961007; - } } - public TLVector rules {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - rules = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + rules = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(rules,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(rules, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs b/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs index c386a1a..e393273 100644 --- a/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs +++ b/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1891839707)] + [TLObject(1891839707)] public class TLRequestChangePhone : TLMethod { - public override int Constructor + public override int Constructor => 1891839707; + + public string phone_number { get; set; } + public string phone_code_hash { get; set; } + public string phone_code { get; set; } + public TLAbsUser Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1891839707; - } } - public string phone_number {get;set;} - public string phone_code_hash {get;set;} - public string phone_code {get;set;} - public TLAbsUser Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -phone_code_hash = StringUtil.Deserialize(br); -phone_code = StringUtil.Deserialize(br); - + phone_code_hash = StringUtil.Deserialize(br); + phone_code = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(phone_code_hash,bw); -StringUtil.Serialize(phone_code,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(phone_code_hash, bw); + StringUtil.Serialize(phone_code, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUser) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs b/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs index 87c4382..71b8076 100644 --- a/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs +++ b/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(655677548)] + [TLObject(655677548)] public class TLRequestCheckUsername : TLMethod { - public override int Constructor + public override int Constructor => 655677548; + + public string username { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 655677548; - } } - public string username {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(username,bw); - + bw.Write(Constructor); + StringUtil.Serialize(username, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs b/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs index 9613505..e6c87ec 100644 --- a/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs +++ b/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1596029123)] + [TLObject(1596029123)] public class TLRequestConfirmPhone : TLMethod { - public override int Constructor + public override int Constructor => 1596029123; + + public string phone_code_hash { get; set; } + public string phone_code { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1596029123; - } } - public string phone_code_hash {get;set;} - public string phone_code {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_code_hash = StringUtil.Deserialize(br); -phone_code = StringUtil.Deserialize(br); - + phone_code = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_code_hash,bw); -StringUtil.Serialize(phone_code,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_code_hash, bw); + StringUtil.Serialize(phone_code, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs b/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs index 749d620..59f9ec3 100644 --- a/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs +++ b/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1099779595)] + [TLObject(1099779595)] public class TLRequestDeleteAccount : TLMethod { - public override int Constructor + public override int Constructor => 1099779595; + + public string reason { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1099779595; - } } - public string reason {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { reason = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(reason,bw); - + bw.Write(Constructor); + StringUtil.Serialize(reason, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs b/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs index 36c8c88..8e55ea5 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(150761757)] + [TLObject(150761757)] public class TLRequestGetAccountTTL : TLMethod { - public override int Constructor + public override int Constructor => 150761757; + + public TLAccountDaysTTL Response { get; set; } + + + public void ComputeFlags() { - get - { - return 150761757; - } } - public TLAccountDaysTTL Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAccountDaysTTL)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAccountDaysTTL) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs b/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs index 3c4891f..8cb6614 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-484392616)] + [TLObject(-484392616)] public class TLRequestGetAuthorizations : TLMethod { - public override int Constructor + public override int Constructor => -484392616; + + public TLAuthorizations Response { get; set; } + + + public void ComputeFlags() { - get - { - return -484392616; - } } - public Account.TLAuthorizations Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Account.TLAuthorizations)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorizations) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs b/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs index bf56b9a..3e7d003 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(313765169)] + [TLObject(313765169)] public class TLRequestGetNotifySettings : TLMethod { - public override int Constructor + public override int Constructor => 313765169; + + public TLAbsInputNotifyPeer peer { get; set; } + public TLAbsPeerNotifySettings Response { get; set; } + + + public void ComputeFlags() { - get - { - return 313765169; - } } - public TLAbsInputNotifyPeer peer {get;set;} - public TLAbsPeerNotifySettings Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputNotifyPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsPeerNotifySettings) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs b/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs index 5b4a494..ba2d943 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1418342645)] + [TLObject(1418342645)] public class TLRequestGetPassword : TLMethod { - public override int Constructor + public override int Constructor => 1418342645; + + public TLAbsPassword Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1418342645; - } } - public Account.TLAbsPassword Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Account.TLAbsPassword)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsPassword) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs b/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs index 79d46c0..bf012c9 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-1131605573)] + [TLObject(-1131605573)] public class TLRequestGetPasswordSettings : TLMethod { - public override int Constructor + public override int Constructor => -1131605573; + + public byte[] current_password_hash { get; set; } + public TLPasswordSettings Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1131605573; - } } - public byte[] current_password_hash {get;set;} - public Account.TLPasswordSettings Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { current_password_hash = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(current_password_hash,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(current_password_hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Account.TLPasswordSettings)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPasswordSettings) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs b/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs index 7672a74..3a03c47 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-623130288)] + [TLObject(-623130288)] public class TLRequestGetPrivacy : TLMethod { - public override int Constructor + public override int Constructor => -623130288; + + public TLAbsInputPrivacyKey key { get; set; } + public TLPrivacyRules Response { get; set; } + + + public void ComputeFlags() { - get - { - return -623130288; - } } - public TLAbsInputPrivacyKey key {get;set;} - public Account.TLPrivacyRules Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - key = (TLAbsInputPrivacyKey)ObjectUtils.DeserializeObject(br); - + key = (TLAbsInputPrivacyKey) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(key,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(key, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Account.TLPrivacyRules)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPrivacyRules) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs b/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs index 6d148c7..ee76bc4 100644 --- a/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs +++ b/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-1068696894)] + [TLObject(-1068696894)] public class TLRequestGetWallPapers : TLMethod { - public override int Constructor + public override int Constructor => -1068696894; + + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1068696894; - } } - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs b/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs index 06e4f9c..8f09d26 100644 --- a/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs +++ b/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1669245048)] + [TLObject(1669245048)] public class TLRequestRegisterDevice : TLMethod { - public override int Constructor + public override int Constructor => 1669245048; + + public int token_type { get; set; } + public string token { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1669245048; - } } - public int token_type {get;set;} - public string token {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { token_type = br.ReadInt32(); -token = StringUtil.Deserialize(br); - + token = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(token_type); -StringUtil.Serialize(token,bw); - + StringUtil.Serialize(token, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs b/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs index 21e7d47..300e3b9 100644 --- a/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs +++ b/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-1374118561)] + [TLObject(-1374118561)] public class TLRequestReportPeer : TLMethod { - public override int Constructor + public override int Constructor => -1374118561; + + public TLAbsInputPeer peer { get; set; } + public TLAbsReportReason reason { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1374118561; - } } - public TLAbsInputPeer peer {get;set;} - public TLAbsReportReason reason {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -reason = (TLAbsReportReason)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + reason = (TLAbsReportReason) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(reason,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(reason, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs b/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs index db2abbd..01f7041 100644 --- a/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs +++ b/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-545786948)] + [TLObject(-545786948)] public class TLRequestResetAuthorization : TLMethod { - public override int Constructor + public override int Constructor => -545786948; + + public long hash { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -545786948; - } } - public long hash {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); - } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs b/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs index 863f0ae..3aec4fc 100644 --- a/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs +++ b/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-612493497)] + [TLObject(-612493497)] public class TLRequestResetNotifySettings : TLMethod { - public override int Constructor + public override int Constructor => -612493497; + + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -612493497; - } } - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs b/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs index 1cb46d9..e769ba5 100644 --- a/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs +++ b/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs @@ -1,66 +1,52 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Auth; + namespace TeleSharp.TL.Account { - [TLObject(149257707)] + [TLObject(149257707)] public class TLRequestSendChangePhoneCode : TLMethod { - public override int Constructor + public override int Constructor => 149257707; + + public int flags { get; set; } + public bool allow_flashcall { get; set; } + public string phone_number { get; set; } + public bool? current_number { get; set; } + public TLSentCode Response { get; set; } + + + public void ComputeFlags() { - get - { - return 149257707; - } + flags = 0; + flags = allow_flashcall ? flags | 1 : flags & ~1; + flags = current_number != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool allow_flashcall {get;set;} - public string phone_number {get;set;} - public bool? current_number {get;set;} - public Auth.TLSentCode Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = allow_flashcall ? (flags | 1) : (flags & ~1); -flags = current_number != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -allow_flashcall = (flags & 1) != 0; -phone_number = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -current_number = BoolUtil.Deserialize(br); -else -current_number = null; - - + allow_flashcall = (flags & 1) != 0; + phone_number = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + current_number = BoolUtil.Deserialize(br); + else + current_number = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(phone_number,bw); -if ((flags & 1) != 0) -BoolUtil.Serialize(current_number.Value,bw); + bw.Write(flags); + StringUtil.Serialize(phone_number, bw); + if ((flags & 1) != 0) + BoolUtil.Serialize(current_number.Value, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLSentCode) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs b/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs index 5abe7be..1da78d5 100644 --- a/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs +++ b/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs @@ -1,66 +1,52 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Auth; + namespace TeleSharp.TL.Account { - [TLObject(353818557)] + [TLObject(353818557)] public class TLRequestSendConfirmPhoneCode : TLMethod { - public override int Constructor + public override int Constructor => 353818557; + + public int flags { get; set; } + public bool allow_flashcall { get; set; } + public string hash { get; set; } + public bool? current_number { get; set; } + public TLSentCode Response { get; set; } + + + public void ComputeFlags() { - get - { - return 353818557; - } + flags = 0; + flags = allow_flashcall ? flags | 1 : flags & ~1; + flags = current_number != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool allow_flashcall {get;set;} - public string hash {get;set;} - public bool? current_number {get;set;} - public Auth.TLSentCode Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = allow_flashcall ? (flags | 1) : (flags & ~1); -flags = current_number != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -allow_flashcall = (flags & 1) != 0; -hash = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -current_number = BoolUtil.Deserialize(br); -else -current_number = null; - - + allow_flashcall = (flags & 1) != 0; + hash = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + current_number = BoolUtil.Deserialize(br); + else + current_number = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(hash,bw); -if ((flags & 1) != 0) -BoolUtil.Serialize(current_number.Value,bw); + bw.Write(flags); + StringUtil.Serialize(hash, bw); + if ((flags & 1) != 0) + BoolUtil.Serialize(current_number.Value, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLSentCode) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs b/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs index 64b6cb7..d89048a 100644 --- a/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs +++ b/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(608323678)] + [TLObject(608323678)] public class TLRequestSetAccountTTL : TLMethod { - public override int Constructor + public override int Constructor => 608323678; + + public TLAccountDaysTTL ttl { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 608323678; - } } - public TLAccountDaysTTL ttl {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - ttl = (TLAccountDaysTTL)ObjectUtils.DeserializeObject(br); - + ttl = (TLAccountDaysTTL) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(ttl,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(ttl, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs b/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs index 25d6f4a..5fa3aff 100644 --- a/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs +++ b/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-906486552)] + [TLObject(-906486552)] public class TLRequestSetPrivacy : TLMethod { - public override int Constructor + public override int Constructor => -906486552; + + public TLAbsInputPrivacyKey key { get; set; } + public TLVector rules { get; set; } + public TLPrivacyRules Response { get; set; } + + + public void ComputeFlags() { - get - { - return -906486552; - } } - public TLAbsInputPrivacyKey key {get;set;} - public TLVector rules {get;set;} - public Account.TLPrivacyRules Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - key = (TLAbsInputPrivacyKey)ObjectUtils.DeserializeObject(br); -rules = (TLVector)ObjectUtils.DeserializeVector(br); - + key = (TLAbsInputPrivacyKey) ObjectUtils.DeserializeObject(br); + rules = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(key,bw); -ObjectUtils.SerializeObject(rules,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(key, bw); + ObjectUtils.SerializeObject(rules, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Account.TLPrivacyRules)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPrivacyRules) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs b/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs index f805f78..07224b0 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1707432768)] + [TLObject(1707432768)] public class TLRequestUnregisterDevice : TLMethod { - public override int Constructor + public override int Constructor => 1707432768; + + public int token_type { get; set; } + public string token { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1707432768; - } } - public int token_type {get;set;} - public string token {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { token_type = br.ReadInt32(); -token = StringUtil.Deserialize(br); - + token = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(token_type); -StringUtil.Serialize(token,bw); - + StringUtil.Serialize(token, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs b/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs index 40b70f7..55707d6 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(954152242)] + [TLObject(954152242)] public class TLRequestUpdateDeviceLocked : TLMethod { - public override int Constructor + public override int Constructor => 954152242; + + public int period { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 954152242; - } } - public int period {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { period = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(period); - } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs b/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs index 75ca0eb..52f8753 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-2067899501)] + [TLObject(-2067899501)] public class TLRequestUpdateNotifySettings : TLMethod { - public override int Constructor + public override int Constructor => -2067899501; + + public TLAbsInputNotifyPeer peer { get; set; } + public TLInputPeerNotifySettings settings { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2067899501; - } } - public TLAbsInputNotifyPeer peer {get;set;} - public TLInputPeerNotifySettings settings {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br); -settings = (TLInputPeerNotifySettings)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputNotifyPeer) ObjectUtils.DeserializeObject(br); + settings = (TLInputPeerNotifySettings) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(settings,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(settings, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs b/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs index 74892e1..f098330 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(-92517498)] + [TLObject(-92517498)] public class TLRequestUpdatePasswordSettings : TLMethod { - public override int Constructor + public override int Constructor => -92517498; + + public byte[] current_password_hash { get; set; } + public TLPasswordInputSettings new_settings { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -92517498; - } } - public byte[] current_password_hash {get;set;} - public Account.TLPasswordInputSettings new_settings {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { current_password_hash = BytesUtil.Deserialize(br); -new_settings = (Account.TLPasswordInputSettings)ObjectUtils.DeserializeObject(br); - + new_settings = (TLPasswordInputSettings) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(current_password_hash,bw); -ObjectUtils.SerializeObject(new_settings,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(current_password_hash, bw); + ObjectUtils.SerializeObject(new_settings, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs b/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs index 2d4333b..a25f778 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs @@ -1,77 +1,62 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(2018596725)] + [TLObject(2018596725)] public class TLRequestUpdateProfile : TLMethod { - public override int Constructor + public override int Constructor => 2018596725; + + public int flags { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public string about { get; set; } + public TLAbsUser Response { get; set; } + + + public void ComputeFlags() { - get - { - return 2018596725; - } + flags = 0; + flags = first_name != null ? flags | 1 : flags & ~1; + flags = last_name != null ? flags | 2 : flags & ~2; + flags = about != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public string about {get;set;} - public TLAbsUser Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = first_name != null ? (flags | 1) : (flags & ~1); -flags = last_name != null ? (flags | 2) : (flags & ~2); -flags = about != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -if ((flags & 1) != 0) -first_name = StringUtil.Deserialize(br); -else -first_name = null; - -if ((flags & 2) != 0) -last_name = StringUtil.Deserialize(br); -else -last_name = null; - -if ((flags & 4) != 0) -about = StringUtil.Deserialize(br); -else -about = null; + if ((flags & 1) != 0) + first_name = StringUtil.Deserialize(br); + else + first_name = null; + if ((flags & 2) != 0) + last_name = StringUtil.Deserialize(br); + else + last_name = null; + if ((flags & 4) != 0) + about = StringUtil.Deserialize(br); + else + about = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -if ((flags & 1) != 0) -StringUtil.Serialize(first_name,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(last_name,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(about,bw); - + bw.Write(flags); + if ((flags & 1) != 0) + StringUtil.Serialize(first_name, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(last_name, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(about, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUser) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs b/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs index 5a70bc0..043aa33 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1713919532)] + [TLObject(1713919532)] public class TLRequestUpdateStatus : TLMethod { - public override int Constructor + public override int Constructor => 1713919532; + + public bool offline { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1713919532; - } } - public bool offline {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offline = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BoolUtil.Serialize(offline,bw); - + bw.Write(Constructor); + BoolUtil.Serialize(offline, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs b/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs index 97cf21e..26cec25 100644 --- a/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs +++ b/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Account { - [TLObject(1040964988)] + [TLObject(1040964988)] public class TLRequestUpdateUsername : TLMethod { - public override int Constructor + public override int Constructor => 1040964988; + + public string username { get; set; } + public TLAbsUser Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1040964988; - } } - public string username {get;set;} - public TLAbsUser Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(username,bw); - + bw.Write(Constructor); + StringUtil.Serialize(username, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUser) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs b/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs index fa01532..a9e16e8 100644 --- a/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs +++ b/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Auth { public abstract class TLAbsCodeType : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs b/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs index c77d063..f948067 100644 --- a/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs +++ b/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Auth { public abstract class TLAbsSentCodeType : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLAuthorization.cs b/TeleSharp.TL/TL/Auth/TLAuthorization.cs index 8060687..5dc81b6 100644 --- a/TeleSharp.TL/TL/Auth/TLAuthorization.cs +++ b/TeleSharp.TL/TL/Auth/TLAuthorization.cs @@ -1,56 +1,42 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-855308010)] + [TLObject(-855308010)] public class TLAuthorization : TLObject { - public override int Constructor + public override int Constructor => -855308010; + + public int flags { get; set; } + public int? tmp_sessions { get; set; } + public TLAbsUser user { get; set; } + + + public void ComputeFlags() { - get - { - return -855308010; - } + flags = 0; + flags = tmp_sessions != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public int? tmp_sessions {get;set;} - public TLAbsUser user {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = tmp_sessions != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -if ((flags & 1) != 0) -tmp_sessions = br.ReadInt32(); -else -tmp_sessions = null; - -user = (TLAbsUser)ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + tmp_sessions = br.ReadInt32(); + else + tmp_sessions = null; + user = (TLAbsUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -if ((flags & 1) != 0) -bw.Write(tmp_sessions.Value); -ObjectUtils.SerializeObject(user,bw); - + bw.Write(flags); + if ((flags & 1) != 0) + bw.Write(tmp_sessions.Value); + ObjectUtils.SerializeObject(user, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs b/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs index 6bcc3b2..18e74d1 100644 --- a/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs +++ b/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-2128698738)] + [TLObject(-2128698738)] public class TLCheckedPhone : TLObject { - public override int Constructor + public override int Constructor => -2128698738; + + public bool phone_registered { get; set; } + + + public void ComputeFlags() { - get - { - return -2128698738; - } } - public bool phone_registered {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_registered = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BoolUtil.Serialize(phone_registered,bw); - + bw.Write(Constructor); + BoolUtil.Serialize(phone_registered, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs b/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs index 7e8110a..26e0b60 100644 --- a/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs +++ b/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1948046307)] + [TLObject(1948046307)] public class TLCodeTypeCall : TLAbsCodeType { - public override int Constructor + public override int Constructor => 1948046307; + + + public void ComputeFlags() { - get - { - return 1948046307; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs b/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs index 01f3dca..b520f2b 100644 --- a/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs +++ b/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(577556219)] + [TLObject(577556219)] public class TLCodeTypeFlashCall : TLAbsCodeType { - public override int Constructor + public override int Constructor => 577556219; + + + public void ComputeFlags() { - get - { - return 577556219; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs b/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs index c7ff712..59a7586 100644 --- a/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs +++ b/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1923290508)] + [TLObject(1923290508)] public class TLCodeTypeSms : TLAbsCodeType { - public override int Constructor + public override int Constructor => 1923290508; + + + public void ComputeFlags() { - get - { - return 1923290508; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs b/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs index 7a2b924..690203e 100644 --- a/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs +++ b/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-543777747)] + [TLObject(-543777747)] public class TLExportedAuthorization : TLObject { - public override int Constructor + public override int Constructor => -543777747; + + public int id { get; set; } + public byte[] bytes { get; set; } + + + public void ComputeFlags() { - get - { - return -543777747; - } } - public int id {get;set;} - public byte[] bytes {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -BytesUtil.Serialize(bytes,bw); - + BytesUtil.Serialize(bytes, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs b/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs index 75fdbb9..eaa44f3 100644 --- a/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs +++ b/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(326715557)] + [TLObject(326715557)] public class TLPasswordRecovery : TLObject { - public override int Constructor + public override int Constructor => 326715557; + + public string email_pattern { get; set; } + + + public void ComputeFlags() { - get - { - return 326715557; - } } - public string email_pattern {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { email_pattern = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(email_pattern,bw); - + bw.Write(Constructor); + StringUtil.Serialize(email_pattern, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs b/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs index eb72bfd..7064738 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-841733627)] + [TLObject(-841733627)] public class TLRequestBindTempAuthKey : TLMethod { - public override int Constructor + public override int Constructor => -841733627; + + public long perm_auth_key_id { get; set; } + public long nonce { get; set; } + public int expires_at { get; set; } + public byte[] encrypted_message { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -841733627; - } } - public long perm_auth_key_id {get;set;} - public long nonce {get;set;} - public int expires_at {get;set;} - public byte[] encrypted_message {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { perm_auth_key_id = br.ReadInt64(); -nonce = br.ReadInt64(); -expires_at = br.ReadInt32(); -encrypted_message = BytesUtil.Deserialize(br); - + nonce = br.ReadInt64(); + expires_at = br.ReadInt32(); + encrypted_message = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(perm_auth_key_id); -bw.Write(nonce); -bw.Write(expires_at); -BytesUtil.Serialize(encrypted_message,bw); - + bw.Write(nonce); + bw.Write(expires_at); + BytesUtil.Serialize(encrypted_message, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs b/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs index 0c7f61d..f7c00a7 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(520357240)] + [TLObject(520357240)] public class TLRequestCancelCode : TLMethod { - public override int Constructor + public override int Constructor => 520357240; + + public string phone_number { get; set; } + public string phone_code_hash { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 520357240; - } } - public string phone_number {get;set;} - public string phone_code_hash {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -phone_code_hash = StringUtil.Deserialize(br); - + phone_code_hash = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(phone_code_hash,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(phone_code_hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs b/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs index 4b28ef0..0057c9c 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(174260510)] + [TLObject(174260510)] public class TLRequestCheckPassword : TLMethod { - public override int Constructor + public override int Constructor => 174260510; + + public byte[] password_hash { get; set; } + public TLAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return 174260510; - } } - public byte[] password_hash {get;set;} - public Auth.TLAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { password_hash = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(password_hash,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(password_hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs b/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs index 2930bfe..2435a69 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1877286395)] + [TLObject(1877286395)] public class TLRequestCheckPhone : TLMethod { - public override int Constructor + public override int Constructor => 1877286395; + + public string phone_number { get; set; } + public TLCheckedPhone Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1877286395; - } } - public string phone_number {get;set;} - public Auth.TLCheckedPhone Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLCheckedPhone)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLCheckedPhone) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs b/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs index d88431f..70bddb8 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-1907842680)] + [TLObject(-1907842680)] public class TLRequestDropTempAuthKeys : TLMethod { - public override int Constructor + public override int Constructor => -1907842680; + + public TLVector except_auth_keys { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1907842680; - } } - public TLVector except_auth_keys {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - except_auth_keys = (TLVector)ObjectUtils.DeserializeVector(br); - + except_auth_keys = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(except_auth_keys,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(except_auth_keys, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs b/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs index 065e81a..bf0c444 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-440401971)] + [TLObject(-440401971)] public class TLRequestExportAuthorization : TLMethod { - public override int Constructor + public override int Constructor => -440401971; + + public int dc_id { get; set; } + public TLExportedAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return -440401971; - } } - public int dc_id {get;set;} - public Auth.TLExportedAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { dc_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(dc_id); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLExportedAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLExportedAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs b/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs index d77e720..0adcc32 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-470837741)] + [TLObject(-470837741)] public class TLRequestImportAuthorization : TLMethod { - public override int Constructor + public override int Constructor => -470837741; + + public int id { get; set; } + public byte[] bytes { get; set; } + public TLAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return -470837741; - } } - public int id {get;set;} - public byte[] bytes {get;set;} - public Auth.TLAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -BytesUtil.Serialize(bytes,bw); - + BytesUtil.Serialize(bytes, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs b/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs index a6d6e05..9fc1f42 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs @@ -1,59 +1,45 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1738800940)] + [TLObject(1738800940)] public class TLRequestImportBotAuthorization : TLMethod { - public override int Constructor + public override int Constructor => 1738800940; + + public int flags { get; set; } + public int api_id { get; set; } + public string api_hash { get; set; } + public string bot_auth_token { get; set; } + public TLAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1738800940; - } + flags = 0; } - public int flags {get;set;} - public int api_id {get;set;} - public string api_hash {get;set;} - public string bot_auth_token {get;set;} - public Auth.TLAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -api_id = br.ReadInt32(); -api_hash = StringUtil.Deserialize(br); -bot_auth_token = StringUtil.Deserialize(br); - + api_id = br.ReadInt32(); + api_hash = StringUtil.Deserialize(br); + bot_auth_token = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(api_id); -StringUtil.Serialize(api_hash,bw); -StringUtil.Serialize(bot_auth_token,bw); - + bw.Write(flags); + bw.Write(api_id); + StringUtil.Serialize(api_hash, bw); + StringUtil.Serialize(bot_auth_token, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs b/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs index bad6f1c..ee03df6 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1461180992)] + [TLObject(1461180992)] public class TLRequestLogOut : TLMethod { - public override int Constructor + public override int Constructor => 1461180992; + + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1461180992; - } } - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs b/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs index 1172549..718354f 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1319464594)] + [TLObject(1319464594)] public class TLRequestRecoverPassword : TLMethod { - public override int Constructor + public override int Constructor => 1319464594; + + public string code { get; set; } + public TLAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1319464594; - } } - public string code {get;set;} - public Auth.TLAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { code = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(code,bw); - + bw.Write(Constructor); + StringUtil.Serialize(code, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs b/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs index bf6660c..73090d0 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-661144474)] + [TLObject(-661144474)] public class TLRequestRequestPasswordRecovery : TLMethod { - public override int Constructor + public override int Constructor => -661144474; + + public TLPasswordRecovery Response { get; set; } + + + public void ComputeFlags() { - get - { - return -661144474; - } } - public Auth.TLPasswordRecovery Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLPasswordRecovery)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPasswordRecovery) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs b/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs index 88fa179..ac4f46b 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1056025023)] + [TLObject(1056025023)] public class TLRequestResendCode : TLMethod { - public override int Constructor + public override int Constructor => 1056025023; + + public string phone_number { get; set; } + public string phone_code_hash { get; set; } + public TLSentCode Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1056025023; - } } - public string phone_number {get;set;} - public string phone_code_hash {get;set;} - public Auth.TLSentCode Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -phone_code_hash = StringUtil.Deserialize(br); - + phone_code_hash = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(phone_code_hash,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(phone_code_hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLSentCode) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs b/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs index c6d9a51..338fb81 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-1616179942)] + [TLObject(-1616179942)] public class TLRequestResetAuthorizations : TLMethod { - public override int Constructor + public override int Constructor => -1616179942; + + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1616179942; - } } - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs b/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs index ddb8efe..e74fc66 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs @@ -1,72 +1,58 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-2035355412)] + [TLObject(-2035355412)] public class TLRequestSendCode : TLMethod { - public override int Constructor + public override int Constructor => -2035355412; + + public int flags { get; set; } + public bool allow_flashcall { get; set; } + public string phone_number { get; set; } + public bool? current_number { get; set; } + public int api_id { get; set; } + public string api_hash { get; set; } + public TLSentCode Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2035355412; - } + flags = 0; + flags = allow_flashcall ? flags | 1 : flags & ~1; + flags = current_number != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool allow_flashcall {get;set;} - public string phone_number {get;set;} - public bool? current_number {get;set;} - public int api_id {get;set;} - public string api_hash {get;set;} - public Auth.TLSentCode Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = allow_flashcall ? (flags | 1) : (flags & ~1); -flags = current_number != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -allow_flashcall = (flags & 1) != 0; -phone_number = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -current_number = BoolUtil.Deserialize(br); -else -current_number = null; - -api_id = br.ReadInt32(); -api_hash = StringUtil.Deserialize(br); + allow_flashcall = (flags & 1) != 0; + phone_number = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + current_number = BoolUtil.Deserialize(br); + else + current_number = null; + api_id = br.ReadInt32(); + api_hash = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(phone_number,bw); -if ((flags & 1) != 0) -BoolUtil.Serialize(current_number.Value,bw); -bw.Write(api_id); -StringUtil.Serialize(api_hash,bw); + bw.Write(flags); + StringUtil.Serialize(phone_number, bw); + if ((flags & 1) != 0) + BoolUtil.Serialize(current_number.Value, bw); + bw.Write(api_id); + StringUtil.Serialize(api_hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLSentCode) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs b/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs index eae4082..5678bf6 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1998331287)] + [TLObject(1998331287)] public class TLRequestSendInvites : TLMethod { - public override int Constructor + public override int Constructor => 1998331287; + + public TLVector phone_numbers { get; set; } + public string message { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1998331287; - } } - public TLVector phone_numbers {get;set;} - public string message {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - phone_numbers = (TLVector)ObjectUtils.DeserializeVector(br); -message = StringUtil.Deserialize(br); - + phone_numbers = ObjectUtils.DeserializeVector(br); + message = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(phone_numbers,bw); -StringUtil.Serialize(message,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(phone_numbers, bw); + StringUtil.Serialize(message, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs b/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs index e6ab344..89ff84b 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-1126886015)] + [TLObject(-1126886015)] public class TLRequestSignIn : TLMethod { - public override int Constructor + public override int Constructor => -1126886015; + + public string phone_number { get; set; } + public string phone_code_hash { get; set; } + public string phone_code { get; set; } + public TLAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1126886015; - } } - public string phone_number {get;set;} - public string phone_code_hash {get;set;} - public string phone_code {get;set;} - public Auth.TLAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -phone_code_hash = StringUtil.Deserialize(br); -phone_code = StringUtil.Deserialize(br); - + phone_code_hash = StringUtil.Deserialize(br); + phone_code = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(phone_code_hash,bw); -StringUtil.Serialize(phone_code,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(phone_code_hash, bw); + StringUtil.Serialize(phone_code, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs b/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs index de55845..50049a5 100644 --- a/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs +++ b/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(453408308)] + [TLObject(453408308)] public class TLRequestSignUp : TLMethod { - public override int Constructor + public override int Constructor => 453408308; + + public string phone_number { get; set; } + public string phone_code_hash { get; set; } + public string phone_code { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public TLAuthorization Response { get; set; } + + + public void ComputeFlags() { - get - { - return 453408308; - } } - public string phone_number {get;set;} - public string phone_code_hash {get;set;} - public string phone_code {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public Auth.TLAuthorization Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -phone_code_hash = StringUtil.Deserialize(br); -phone_code = StringUtil.Deserialize(br); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); - + phone_code_hash = StringUtil.Deserialize(br); + phone_code = StringUtil.Deserialize(br); + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(phone_code_hash,bw); -StringUtil.Serialize(phone_code,bw); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(phone_code_hash, bw); + StringUtil.Serialize(phone_code, bw); + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAuthorization) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLSentCode.cs b/TeleSharp.TL/TL/Auth/TLSentCode.cs index fd33414..66722e7 100644 --- a/TeleSharp.TL/TL/Auth/TLSentCode.cs +++ b/TeleSharp.TL/TL/Auth/TLSentCode.cs @@ -1,72 +1,57 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1577067778)] + [TLObject(1577067778)] public class TLSentCode : TLObject { - public override int Constructor + public override int Constructor => 1577067778; + + public int flags { get; set; } + public bool phone_registered { get; set; } + public TLAbsSentCodeType type { get; set; } + public string phone_code_hash { get; set; } + public TLAbsCodeType next_type { get; set; } + public int? timeout { get; set; } + + + public void ComputeFlags() { - get - { - return 1577067778; - } + flags = 0; + flags = phone_registered ? flags | 1 : flags & ~1; + flags = next_type != null ? flags | 2 : flags & ~2; + flags = timeout != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool phone_registered {get;set;} - public Auth.TLAbsSentCodeType type {get;set;} - public string phone_code_hash {get;set;} - public Auth.TLAbsCodeType next_type {get;set;} - public int? timeout {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = phone_registered ? (flags | 1) : (flags & ~1); -flags = next_type != null ? (flags | 2) : (flags & ~2); -flags = timeout != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -phone_registered = (flags & 1) != 0; -type = (Auth.TLAbsSentCodeType)ObjectUtils.DeserializeObject(br); -phone_code_hash = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -next_type = (Auth.TLAbsCodeType)ObjectUtils.DeserializeObject(br); -else -next_type = null; - -if ((flags & 4) != 0) -timeout = br.ReadInt32(); -else -timeout = null; - + phone_registered = (flags & 1) != 0; + type = (TLAbsSentCodeType) ObjectUtils.DeserializeObject(br); + phone_code_hash = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + next_type = (TLAbsCodeType) ObjectUtils.DeserializeObject(br); + else + next_type = null; + if ((flags & 4) != 0) + timeout = br.ReadInt32(); + else + timeout = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(type,bw); -StringUtil.Serialize(phone_code_hash,bw); -if ((flags & 2) != 0) -ObjectUtils.SerializeObject(next_type,bw); -if ((flags & 4) != 0) -bw.Write(timeout.Value); + bw.Write(flags); + ObjectUtils.SerializeObject(type, bw); + StringUtil.Serialize(phone_code_hash, bw); + if ((flags & 2) != 0) + ObjectUtils.SerializeObject(next_type, bw); + if ((flags & 4) != 0) + bw.Write(timeout.Value); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs b/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs index 42511bf..f319643 100644 --- a/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs +++ b/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1035688326)] + [TLObject(1035688326)] public class TLSentCodeTypeApp : TLAbsSentCodeType { - public override int Constructor + public override int Constructor => 1035688326; + + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 1035688326; - } } - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(length); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs b/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs index a470688..f2e3a3b 100644 --- a/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs +++ b/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(1398007207)] + [TLObject(1398007207)] public class TLSentCodeTypeCall : TLAbsSentCodeType { - public override int Constructor + public override int Constructor => 1398007207; + + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 1398007207; - } } - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(length); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs b/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs index 8f25207..834afd1 100644 --- a/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs +++ b/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-1425815847)] + [TLObject(-1425815847)] public class TLSentCodeTypeFlashCall : TLAbsSentCodeType { - public override int Constructor + public override int Constructor => -1425815847; + + public string pattern { get; set; } + + + public void ComputeFlags() { - get - { - return -1425815847; - } } - public string pattern {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { pattern = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(pattern,bw); - + bw.Write(Constructor); + StringUtil.Serialize(pattern, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs b/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs index af9aa39..27c18dc 100644 --- a/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs +++ b/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Auth { - [TLObject(-1073693790)] + [TLObject(-1073693790)] public class TLSentCodeTypeSms : TLAbsSentCodeType { - public override int Constructor + public override int Constructor => -1073693790; + + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return -1073693790; - } } - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(length); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs b/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs index 4e4f9ca..efbe83c 100644 --- a/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs +++ b/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-791039645)] + [TLObject(-791039645)] public class TLChannelParticipant : TLObject { - public override int Constructor + public override int Constructor => -791039645; + + public TLAbsChannelParticipant participant { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -791039645; - } } - public TLAbsChannelParticipant participant {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - participant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + participant = (TLAbsChannelParticipant) ObjectUtils.DeserializeObject(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(participant,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(participant, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs b/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs index 2e0e203..2f1483e 100644 --- a/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs +++ b/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-177282392)] + [TLObject(-177282392)] public class TLChannelParticipants : TLObject { - public override int Constructor + public override int Constructor => -177282392; + + public int count { get; set; } + public TLVector participants { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -177282392; - } } - public int count {get;set;} - public TLVector participants {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { count = br.ReadInt32(); -participants = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + participants = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(count); -ObjectUtils.SerializeObject(participants,bw); -ObjectUtils.SerializeObject(users,bw); - + ObjectUtils.SerializeObject(participants, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs b/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs index c5350b0..67893ea 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(283557164)] + [TLObject(283557164)] public class TLRequestCheckUsername : TLMethod { - public override int Constructor + public override int Constructor => 283557164; + + public TLAbsInputChannel channel { get; set; } + public string username { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 283557164; - } } - public TLAbsInputChannel channel {get;set;} - public string username {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -username = StringUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + username = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -StringUtil.Serialize(username,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + StringUtil.Serialize(username, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs index beba3e5..42d5910 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs @@ -1,64 +1,50 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-192332417)] + [TLObject(-192332417)] public class TLRequestCreateChannel : TLMethod { - public override int Constructor + public override int Constructor => -192332417; + + public int flags { get; set; } + public bool broadcast { get; set; } + public bool megagroup { get; set; } + public string title { get; set; } + public string about { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -192332417; - } + flags = 0; + flags = broadcast ? flags | 1 : flags & ~1; + flags = megagroup ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool broadcast {get;set;} - public bool megagroup {get;set;} - public string title {get;set;} - public string about {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = broadcast ? (flags | 1) : (flags & ~1); -flags = megagroup ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -broadcast = (flags & 1) != 0; -megagroup = (flags & 2) != 0; -title = StringUtil.Deserialize(br); -about = StringUtil.Deserialize(br); - + broadcast = (flags & 1) != 0; + megagroup = (flags & 2) != 0; + title = StringUtil.Deserialize(br); + about = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(about,bw); - + StringUtil.Serialize(title, bw); + StringUtil.Serialize(about, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs index 2176f54..35aa30c 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-1072619549)] + [TLObject(-1072619549)] public class TLRequestDeleteChannel : TLMethod { - public override int Constructor + public override int Constructor => -1072619549; + + public TLAbsInputChannel channel { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1072619549; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs b/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs index 6b71f67..8f2f63c 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs @@ -1,51 +1,38 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Messages; + namespace TeleSharp.TL.Channels { - [TLObject(-2067661490)] + [TLObject(-2067661490)] public class TLRequestDeleteMessages : TLMethod { - public override int Constructor + public override int Constructor => -2067661490; + + public TLAbsInputChannel channel { get; set; } + public TLVector id { get; set; } + public TLAffectedMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2067661490; - } } - public TLAbsInputChannel channel {get;set;} - public TLVector id {get;set;} - public Messages.TLAffectedMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -id = (TLVector)ObjectUtils.DeserializeVector(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAffectedMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs b/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs index 6c9ed68..5b44b99 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs @@ -1,51 +1,38 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Messages; + namespace TeleSharp.TL.Channels { - [TLObject(-787622117)] + [TLObject(-787622117)] public class TLRequestDeleteUserHistory : TLMethod { - public override int Constructor + public override int Constructor => -787622117; + + public TLAbsInputChannel channel { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLAffectedHistory Response { get; set; } + + + public void ComputeFlags() { - get - { - return -787622117; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsInputUser user_id {get;set;} - public Messages.TLAffectedHistory Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(user_id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(user_id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAffectedHistory)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAffectedHistory) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs b/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs index 73deacb..81e57b4 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(333610782)] + [TLObject(333610782)] public class TLRequestEditAbout : TLMethod { - public override int Constructor + public override int Constructor => 333610782; + + public TLAbsInputChannel channel { get; set; } + public string about { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 333610782; - } } - public TLAbsInputChannel channel {get;set;} - public string about {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -about = StringUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + about = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -StringUtil.Serialize(about,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + StringUtil.Serialize(about, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs b/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs index 8f622bb..e140f14 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-344583728)] + [TLObject(-344583728)] public class TLRequestEditAdmin : TLMethod { - public override int Constructor + public override int Constructor => -344583728; + + public TLAbsInputChannel channel { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLAbsChannelParticipantRole role { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -344583728; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsInputUser user_id {get;set;} - public TLAbsChannelParticipantRole role {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -role = (TLAbsChannelParticipantRole)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + role = (TLAbsChannelParticipantRole) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(user_id,bw); -ObjectUtils.SerializeObject(role,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(user_id, bw); + ObjectUtils.SerializeObject(role, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs b/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs index a368863..6bf4340 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-248621111)] + [TLObject(-248621111)] public class TLRequestEditPhoto : TLMethod { - public override int Constructor + public override int Constructor => -248621111; + + public TLAbsInputChannel channel { get; set; } + public TLAbsInputChatPhoto photo { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -248621111; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsInputChatPhoto photo {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -photo = (TLAbsInputChatPhoto)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + photo = (TLAbsInputChatPhoto) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(photo,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(photo, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs b/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs index a56cf8f..08bde98 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(1450044624)] + [TLObject(1450044624)] public class TLRequestEditTitle : TLMethod { - public override int Constructor + public override int Constructor => 1450044624; + + public TLAbsInputChannel channel { get; set; } + public string title { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1450044624; - } } - public TLAbsInputChannel channel {get;set;} - public string title {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -title = StringUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + title = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -StringUtil.Serialize(title,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + StringUtil.Serialize(title, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs b/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs index e0ba434..50a2344 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-950663035)] + [TLObject(-950663035)] public class TLRequestExportInvite : TLMethod { - public override int Constructor + public override int Constructor => -950663035; + + public TLAbsInputChannel channel { get; set; } + public TLAbsExportedChatInvite Response { get; set; } + + + public void ComputeFlags() { - get - { - return -950663035; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsExportedChatInvite Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsExportedChatInvite) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs b/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs index fec91eb..09f0ffd 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-934882771)] + [TLObject(-934882771)] public class TLRequestExportMessageLink : TLMethod { - public override int Constructor + public override int Constructor => -934882771; + + public TLAbsInputChannel channel { get; set; } + public int id { get; set; } + public TLExportedMessageLink Response { get; set; } + + + public void ComputeFlags() { - get - { - return -934882771; - } } - public TLAbsInputChannel channel {get;set;} - public int id {get;set;} - public TLExportedMessageLink Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -bw.Write(id); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + bw.Write(id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLExportedMessageLink)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLExportedMessageLink) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs b/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs index a419020..0a11e96 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs @@ -1,45 +1,32 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Messages; + namespace TeleSharp.TL.Channels { - [TLObject(-1920105769)] + [TLObject(-1920105769)] public class TLRequestGetAdminedPublicChannels : TLMethod { - public override int Constructor + public override int Constructor => -1920105769; + + public TLChats Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1920105769; - } } - public Messages.TLChats Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLChats)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLChats) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs b/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs index 8f74dc9..246e719 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs @@ -1,48 +1,35 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Messages; + namespace TeleSharp.TL.Channels { - [TLObject(176122811)] + [TLObject(176122811)] public class TLRequestGetChannels : TLMethod { - public override int Constructor + public override int Constructor => 176122811; + + public TLVector id { get; set; } + public TLChats Response { get; set; } + + + public void ComputeFlags() { - get - { - return 176122811; - } } - public TLVector id {get;set;} - public Messages.TLChats Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLChats)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLChats) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs index 9320d29..511bd22 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(141781513)] + [TLObject(141781513)] public class TLRequestGetFullChannel : TLMethod { - public override int Constructor + public override int Constructor => 141781513; + + public TLAbsInputChannel channel { get; set; } + public Messages.TLChatFull Response { get; set; } + + + public void ComputeFlags() { - get - { - return 141781513; - } } - public TLAbsInputChannel channel {get;set;} - public Messages.TLChatFull Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLChatFull)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (Messages.TLChatFull) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs b/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs index fafda4e..af65a96 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs @@ -1,51 +1,38 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Messages; + namespace TeleSharp.TL.Channels { - [TLObject(-1814580409)] + [TLObject(-1814580409)] public class TLRequestGetMessages : TLMethod { - public override int Constructor + public override int Constructor => -1814580409; + + public TLAbsInputChannel channel { get; set; } + public TLVector id { get; set; } + public TLAbsMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1814580409; - } } - public TLAbsInputChannel channel {get;set;} - public TLVector id {get;set;} - public Messages.TLAbsMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -id = (TLVector)ObjectUtils.DeserializeVector(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs b/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs index 762a058..da7eb87 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(1416484774)] + [TLObject(1416484774)] public class TLRequestGetParticipant : TLMethod { - public override int Constructor + public override int Constructor => 1416484774; + + public TLAbsInputChannel channel { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLChannelParticipant Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1416484774; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsInputUser user_id {get;set;} - public Channels.TLChannelParticipant Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(user_id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(user_id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Channels.TLChannelParticipant)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLChannelParticipant) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs b/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs index bff796d..4187ca3 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(618237842)] + [TLObject(618237842)] public class TLRequestGetParticipants : TLMethod { - public override int Constructor + public override int Constructor => 618237842; + + public TLAbsInputChannel channel { get; set; } + public TLAbsChannelParticipantsFilter filter { get; set; } + public int offset { get; set; } + public int limit { get; set; } + public TLChannelParticipants Response { get; set; } + + + public void ComputeFlags() { - get - { - return 618237842; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsChannelParticipantsFilter filter {get;set;} - public int offset {get;set;} - public int limit {get;set;} - public Channels.TLChannelParticipants Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -filter = (TLAbsChannelParticipantsFilter)ObjectUtils.DeserializeObject(br); -offset = br.ReadInt32(); -limit = br.ReadInt32(); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + filter = (TLAbsChannelParticipantsFilter) ObjectUtils.DeserializeObject(br); + offset = br.ReadInt32(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(filter,bw); -bw.Write(offset); -bw.Write(limit); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(filter, bw); + bw.Write(offset); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Channels.TLChannelParticipants)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLChannelParticipants) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs index c753f4a..9c9cef6 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(429865580)] + [TLObject(429865580)] public class TLRequestInviteToChannel : TLMethod { - public override int Constructor + public override int Constructor => 429865580; + + public TLAbsInputChannel channel { get; set; } + public TLVector users { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 429865580; - } } - public TLAbsInputChannel channel {get;set;} - public TLVector users {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(users, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs index 0192b98..65a68fa 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(615851205)] + [TLObject(615851205)] public class TLRequestJoinChannel : TLMethod { - public override int Constructor + public override int Constructor => 615851205; + + public TLAbsInputChannel channel { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 615851205; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs index 25830ac..90d7547 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-1502421484)] + [TLObject(-1502421484)] public class TLRequestKickFromChannel : TLMethod { - public override int Constructor + public override int Constructor => -1502421484; + + public TLAbsInputChannel channel { get; set; } + public TLAbsInputUser user_id { get; set; } + public bool kicked { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1502421484; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsInputUser user_id {get;set;} - public bool kicked {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -kicked = BoolUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + kicked = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(user_id,bw); -BoolUtil.Serialize(kicked,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(user_id, bw); + BoolUtil.Serialize(kicked, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs b/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs index 8a8964a..b23830f 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-130635115)] + [TLObject(-130635115)] public class TLRequestLeaveChannel : TLMethod { - public override int Constructor + public override int Constructor => -130635115; + + public TLAbsInputChannel channel { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -130635115; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs b/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs index 6f96159..225acbf 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-871347913)] + [TLObject(-871347913)] public class TLRequestReadHistory : TLMethod { - public override int Constructor + public override int Constructor => -871347913; + + public TLAbsInputChannel channel { get; set; } + public int max_id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -871347913; - } } - public TLAbsInputChannel channel {get;set;} - public int max_id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -max_id = br.ReadInt32(); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + max_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -bw.Write(max_id); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + bw.Write(max_id); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs b/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs index b383a08..6715857 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-32999408)] + [TLObject(-32999408)] public class TLRequestReportSpam : TLMethod { - public override int Constructor + public override int Constructor => -32999408; + + public TLAbsInputChannel channel { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLVector id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -32999408; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsInputUser user_id {get;set;} - public TLVector id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -id = (TLVector)ObjectUtils.DeserializeVector(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(user_id,bw); -ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(user_id, bw); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs b/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs index 38d757c..809f545 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(1231065863)] + [TLObject(1231065863)] public class TLRequestToggleInvites : TLMethod { - public override int Constructor + public override int Constructor => 1231065863; + + public TLAbsInputChannel channel { get; set; } + public bool enabled { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1231065863; - } } - public TLAbsInputChannel channel {get;set;} - public bool enabled {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -enabled = BoolUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + enabled = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -BoolUtil.Serialize(enabled,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + BoolUtil.Serialize(enabled, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs b/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs index 25c2540..186bdc1 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(527021574)] + [TLObject(527021574)] public class TLRequestToggleSignatures : TLMethod { - public override int Constructor + public override int Constructor => 527021574; + + public TLAbsInputChannel channel { get; set; } + public bool enabled { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 527021574; - } } - public TLAbsInputChannel channel {get;set;} - public bool enabled {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -enabled = BoolUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + enabled = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -BoolUtil.Serialize(enabled,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + BoolUtil.Serialize(enabled, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs b/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs index 195d6f5..eae624b 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(-1490162350)] + [TLObject(-1490162350)] public class TLRequestUpdatePinnedMessage : TLMethod { - public override int Constructor + public override int Constructor => -1490162350; + + public int flags { get; set; } + public bool silent { get; set; } + public TLAbsInputChannel channel { get; set; } + public int id { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1490162350; - } + flags = 0; + flags = silent ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool silent {get;set;} - public TLAbsInputChannel channel {get;set;} - public int id {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = silent ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -silent = (flags & 1) != 0; -channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); - + silent = (flags & 1) != 0; + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(channel,bw); -bw.Write(id); + bw.Write(flags); + ObjectUtils.SerializeObject(channel, bw); + bw.Write(id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs b/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs index 0942575..0152d2e 100644 --- a/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs +++ b/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Channels { - [TLObject(890549214)] + [TLObject(890549214)] public class TLRequestUpdateUsername : TLMethod { - public override int Constructor + public override int Constructor => 890549214; + + public TLAbsInputChannel channel { get; set; } + public string username { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 890549214; - } } - public TLAbsInputChannel channel {get;set;} - public string username {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -username = StringUtil.Deserialize(br); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + username = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -StringUtil.Serialize(username,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + StringUtil.Serialize(username, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs b/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs index 74381d8..ff30a9a 100644 --- a/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs +++ b/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Contacts { public abstract class TLAbsBlocked : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs b/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs index bb97ae3..6a27b7f 100644 --- a/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs +++ b/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Contacts { public abstract class TLAbsContacts : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs b/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs index f3df0c1..e4c1bc9 100644 --- a/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs +++ b/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Contacts { public abstract class TLAbsTopPeers : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLBlocked.cs b/TeleSharp.TL/TL/Contacts/TLBlocked.cs index 72971f8..cfe7334 100644 --- a/TeleSharp.TL/TL/Contacts/TLBlocked.cs +++ b/TeleSharp.TL/TL/Contacts/TLBlocked.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(471043349)] + [TLObject(471043349)] public class TLBlocked : TLAbsBlocked { - public override int Constructor + public override int Constructor => 471043349; + + public TLVector blocked { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 471043349; - } } - public TLVector blocked {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - blocked = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + blocked = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(blocked,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(blocked, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs b/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs index 98b197e..59dbf95 100644 --- a/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs +++ b/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-1878523231)] + [TLObject(-1878523231)] public class TLBlockedSlice : TLAbsBlocked { - public override int Constructor + public override int Constructor => -1878523231; + + public int count { get; set; } + public TLVector blocked { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1878523231; - } } - public int count {get;set;} - public TLVector blocked {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { count = br.ReadInt32(); -blocked = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + blocked = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(count); -ObjectUtils.SerializeObject(blocked,bw); -ObjectUtils.SerializeObject(users,bw); - + ObjectUtils.SerializeObject(blocked, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLContacts.cs b/TeleSharp.TL/TL/Contacts/TLContacts.cs index 7bd09df..27615c5 100644 --- a/TeleSharp.TL/TL/Contacts/TLContacts.cs +++ b/TeleSharp.TL/TL/Contacts/TLContacts.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(1871416498)] + [TLObject(1871416498)] public class TLContacts : TLAbsContacts { - public override int Constructor + public override int Constructor => 1871416498; + + public TLVector contacts { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1871416498; - } } - public TLVector contacts {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - contacts = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + contacts = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(contacts,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(contacts, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs b/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs index 338e001..f65c177 100644 --- a/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs +++ b/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-1219778094)] + [TLObject(-1219778094)] public class TLContactsNotModified : TLAbsContacts { - public override int Constructor + public override int Constructor => -1219778094; + + + public void ComputeFlags() { - get - { - return -1219778094; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLFound.cs b/TeleSharp.TL/TL/Contacts/TLFound.cs index e223945..6a76183 100644 --- a/TeleSharp.TL/TL/Contacts/TLFound.cs +++ b/TeleSharp.TL/TL/Contacts/TLFound.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(446822276)] + [TLObject(446822276)] public class TLFound : TLObject { - public override int Constructor + public override int Constructor => 446822276; + + public TLVector results { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 446822276; - } } - public TLVector results {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - results = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + results = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(results,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(results, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs b/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs index 7e23ad6..0a75f57 100644 --- a/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs +++ b/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-1387117803)] + [TLObject(-1387117803)] public class TLImportedContacts : TLObject { - public override int Constructor + public override int Constructor => -1387117803; + + public TLVector imported { get; set; } + public TLVector retry_contacts { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1387117803; - } } - public TLVector imported {get;set;} - public TLVector retry_contacts {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - imported = (TLVector)ObjectUtils.DeserializeVector(br); -retry_contacts = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + imported = ObjectUtils.DeserializeVector(br); + retry_contacts = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(imported,bw); -ObjectUtils.SerializeObject(retry_contacts,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(imported, bw); + ObjectUtils.SerializeObject(retry_contacts, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLLink.cs b/TeleSharp.TL/TL/Contacts/TLLink.cs index 34924ca..d53bc86 100644 --- a/TeleSharp.TL/TL/Contacts/TLLink.cs +++ b/TeleSharp.TL/TL/Contacts/TLLink.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(986597452)] + [TLObject(986597452)] public class TLLink : TLObject { - public override int Constructor + public override int Constructor => 986597452; + + public TLAbsContactLink my_link { get; set; } + public TLAbsContactLink foreign_link { get; set; } + public TLAbsUser user { get; set; } + + + public void ComputeFlags() { - get - { - return 986597452; - } } - public TLAbsContactLink my_link {get;set;} - public TLAbsContactLink foreign_link {get;set;} - public TLAbsUser user {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - my_link = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); -foreign_link = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); -user = (TLAbsUser)ObjectUtils.DeserializeObject(br); - + my_link = (TLAbsContactLink) ObjectUtils.DeserializeObject(br); + foreign_link = (TLAbsContactLink) ObjectUtils.DeserializeObject(br); + user = (TLAbsUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(my_link,bw); -ObjectUtils.SerializeObject(foreign_link,bw); -ObjectUtils.SerializeObject(user,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(my_link, bw); + ObjectUtils.SerializeObject(foreign_link, bw); + ObjectUtils.SerializeObject(user, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs b/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs index ae9ce8f..2de08bc 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(858475004)] + [TLObject(858475004)] public class TLRequestBlock : TLMethod { - public override int Constructor + public override int Constructor => 858475004; + + public TLAbsInputUser id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 858475004; - } } - public TLAbsInputUser id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs b/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs index a2c5406..49dc573 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-1902823612)] + [TLObject(-1902823612)] public class TLRequestDeleteContact : TLMethod { - public override int Constructor + public override int Constructor => -1902823612; + + public TLAbsInputUser id { get; set; } + public TLLink Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1902823612; - } } - public TLAbsInputUser id {get;set;} - public Contacts.TLLink Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLLink)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLLink) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs b/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs index 8eb56a1..0ff0cfd 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(1504393374)] + [TLObject(1504393374)] public class TLRequestDeleteContacts : TLMethod { - public override int Constructor + public override int Constructor => 1504393374; + + public TLVector id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1504393374; - } } - public TLVector id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs b/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs index 6b639ef..0e7d9df 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-2065352905)] + [TLObject(-2065352905)] public class TLRequestExportCard : TLMethod { - public override int Constructor + public override int Constructor => -2065352905; + + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2065352905; - } } - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs b/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs index e4babd3..6e6923d 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-176409329)] + [TLObject(-176409329)] public class TLRequestGetBlocked : TLMethod { - public override int Constructor + public override int Constructor => -176409329; + + public int offset { get; set; } + public int limit { get; set; } + public TLAbsBlocked Response { get; set; } + + + public void ComputeFlags() { - get - { - return -176409329; - } } - public int offset {get;set;} - public int limit {get;set;} - public Contacts.TLAbsBlocked Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -limit = br.ReadInt32(); - + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(limit); - + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLAbsBlocked)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsBlocked) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs b/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs index 924edc1..1b2bf70 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(583445000)] + [TLObject(583445000)] public class TLRequestGetContacts : TLMethod { - public override int Constructor + public override int Constructor => 583445000; + + public string hash { get; set; } + public TLAbsContacts Response { get; set; } + + + public void ComputeFlags() { - get - { - return 583445000; - } } - public string hash {get;set;} - public Contacts.TLAbsContacts Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(hash,bw); - + bw.Write(Constructor); + StringUtil.Serialize(hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLAbsContacts)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsContacts) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs b/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs index 6773589..6236bbb 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-995929106)] + [TLObject(-995929106)] public class TLRequestGetStatuses : TLMethod { - public override int Constructor + public override int Constructor => -995929106; + + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return -995929106; - } } - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs b/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs index d6ce936..5cbe367 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs @@ -1,79 +1,62 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-728224331)] + [TLObject(-728224331)] public class TLRequestGetTopPeers : TLMethod { - public override int Constructor + public override int Constructor => -728224331; + + public int flags { get; set; } + public bool correspondents { get; set; } + public bool bots_pm { get; set; } + public bool bots_inline { get; set; } + public bool groups { get; set; } + public bool channels { get; set; } + public int offset { get; set; } + public int limit { get; set; } + public int hash { get; set; } + public TLAbsTopPeers Response { get; set; } + + + public void ComputeFlags() { - get - { - return -728224331; - } + flags = 0; + flags = correspondents ? flags | 1 : flags & ~1; + flags = bots_pm ? flags | 2 : flags & ~2; + flags = bots_inline ? flags | 4 : flags & ~4; + flags = groups ? flags | 1024 : flags & ~1024; + flags = channels ? flags | 32768 : flags & ~32768; } - public int flags {get;set;} - public bool correspondents {get;set;} - public bool bots_pm {get;set;} - public bool bots_inline {get;set;} - public bool groups {get;set;} - public bool channels {get;set;} - public int offset {get;set;} - public int limit {get;set;} - public int hash {get;set;} - public Contacts.TLAbsTopPeers Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = correspondents ? (flags | 1) : (flags & ~1); -flags = bots_pm ? (flags | 2) : (flags & ~2); -flags = bots_inline ? (flags | 4) : (flags & ~4); -flags = groups ? (flags | 1024) : (flags & ~1024); -flags = channels ? (flags | 32768) : (flags & ~32768); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -correspondents = (flags & 1) != 0; -bots_pm = (flags & 2) != 0; -bots_inline = (flags & 4) != 0; -groups = (flags & 1024) != 0; -channels = (flags & 32768) != 0; -offset = br.ReadInt32(); -limit = br.ReadInt32(); -hash = br.ReadInt32(); - + correspondents = (flags & 1) != 0; + bots_pm = (flags & 2) != 0; + bots_inline = (flags & 4) != 0; + groups = (flags & 1024) != 0; + channels = (flags & 32768) != 0; + offset = br.ReadInt32(); + limit = br.ReadInt32(); + hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - - -bw.Write(offset); -bw.Write(limit); -bw.Write(hash); - + bw.Write(offset); + bw.Write(limit); + bw.Write(hash); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLAbsTopPeers)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsTopPeers) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs b/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs index f22efbf..b9419d1 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(1340184318)] + [TLObject(1340184318)] public class TLRequestImportCard : TLMethod { - public override int Constructor + public override int Constructor => 1340184318; + + public TLVector export_card { get; set; } + public TLAbsUser Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1340184318; - } } - public TLVector export_card {get;set;} - public TLAbsUser Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - export_card = (TLVector)ObjectUtils.DeserializeVector(br); - + export_card = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(export_card,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(export_card, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUser) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs b/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs index c42497d..f94af83 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-634342611)] + [TLObject(-634342611)] public class TLRequestImportContacts : TLMethod { - public override int Constructor + public override int Constructor => -634342611; + + public TLVector contacts { get; set; } + public bool replace { get; set; } + public TLImportedContacts Response { get; set; } + + + public void ComputeFlags() { - get - { - return -634342611; - } } - public TLVector contacts {get;set;} - public bool replace {get;set;} - public Contacts.TLImportedContacts Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - contacts = (TLVector)ObjectUtils.DeserializeVector(br); -replace = BoolUtil.Deserialize(br); - + contacts = ObjectUtils.DeserializeVector(br); + replace = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(contacts,bw); -BoolUtil.Serialize(replace,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(contacts, bw); + BoolUtil.Serialize(replace, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLImportedContacts)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLImportedContacts) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs b/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs index 45ffb0f..5aff380 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(451113900)] + [TLObject(451113900)] public class TLRequestResetTopPeerRating : TLMethod { - public override int Constructor + public override int Constructor => 451113900; + + public TLAbsTopPeerCategory category { get; set; } + public TLAbsInputPeer peer { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 451113900; - } } - public TLAbsTopPeerCategory category {get;set;} - public TLAbsInputPeer peer {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - category = (TLAbsTopPeerCategory)ObjectUtils.DeserializeObject(br); -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + category = (TLAbsTopPeerCategory) ObjectUtils.DeserializeObject(br); + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(category,bw); -ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(category, bw); + ObjectUtils.SerializeObject(peer, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs b/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs index 9a014f1..4e212c6 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-113456221)] + [TLObject(-113456221)] public class TLRequestResolveUsername : TLMethod { - public override int Constructor + public override int Constructor => -113456221; + + public string username { get; set; } + public TLResolvedPeer Response { get; set; } + + + public void ComputeFlags() { - get - { - return -113456221; - } } - public string username {get;set;} - public Contacts.TLResolvedPeer Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(username,bw); - + bw.Write(Constructor); + StringUtil.Serialize(username, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLResolvedPeer)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLResolvedPeer) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs b/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs index 4b74eb2..b6e16b3 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(301470424)] + [TLObject(301470424)] public class TLRequestSearch : TLMethod { - public override int Constructor + public override int Constructor => 301470424; + + public string q { get; set; } + public int limit { get; set; } + public TLFound Response { get; set; } + + + public void ComputeFlags() { - get - { - return 301470424; - } } - public string q {get;set;} - public int limit {get;set;} - public Contacts.TLFound Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { q = StringUtil.Deserialize(br); -limit = br.ReadInt32(); - + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(q,bw); -bw.Write(limit); - + bw.Write(Constructor); + StringUtil.Serialize(q, bw); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Contacts.TLFound)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLFound) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs b/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs index c9f23a7..8d4e7e6 100644 --- a/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs +++ b/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-448724803)] + [TLObject(-448724803)] public class TLRequestUnblock : TLMethod { - public override int Constructor + public override int Constructor => -448724803; + + public TLAbsInputUser id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -448724803; - } } - public TLAbsInputUser id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs b/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs index 8b7bf6a..a2a9724 100644 --- a/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs +++ b/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(2131196633)] + [TLObject(2131196633)] public class TLResolvedPeer : TLObject { - public override int Constructor + public override int Constructor => 2131196633; + + public TLAbsPeer peer { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 2131196633; - } } - public TLAbsPeer peer {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLTopPeers.cs b/TeleSharp.TL/TL/Contacts/TLTopPeers.cs index 56a37c3..bb77737 100644 --- a/TeleSharp.TL/TL/Contacts/TLTopPeers.cs +++ b/TeleSharp.TL/TL/Contacts/TLTopPeers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(1891070632)] + [TLObject(1891070632)] public class TLTopPeers : TLAbsTopPeers { - public override int Constructor + public override int Constructor => 1891070632; + + public TLVector categories { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1891070632; - } } - public TLVector categories {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - categories = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + categories = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(categories,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(categories, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs b/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs index b84f3f7..7319b6a 100644 --- a/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs +++ b/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Contacts { - [TLObject(-567906571)] + [TLObject(-567906571)] public class TLTopPeersNotModified : TLAbsTopPeers { - public override int Constructor + public override int Constructor => -567906571; + + + public void ComputeFlags() { - get - { - return -567906571; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLAbsAppChangelog.cs b/TeleSharp.TL/TL/Help/TLAbsAppChangelog.cs index ee86c4f..7a62f0f 100644 --- a/TeleSharp.TL/TL/Help/TLAbsAppChangelog.cs +++ b/TeleSharp.TL/TL/Help/TLAbsAppChangelog.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Help { public abstract class TLAbsAppChangelog : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs b/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs index 8f38d8d..8a137c7 100644 --- a/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs +++ b/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Help { public abstract class TLAbsAppUpdate : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLAppChangelog.cs b/TeleSharp.TL/TL/Help/TLAppChangelog.cs index 59ebc07..0a0f70d 100644 --- a/TeleSharp.TL/TL/Help/TLAppChangelog.cs +++ b/TeleSharp.TL/TL/Help/TLAppChangelog.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(1181279933)] + [TLObject(1181279933)] public class TLAppChangelog : TLAbsAppChangelog { - public override int Constructor + public override int Constructor => 1181279933; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return 1181279933; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLAppChangelogEmpty.cs b/TeleSharp.TL/TL/Help/TLAppChangelogEmpty.cs index 527e58e..657fcc7 100644 --- a/TeleSharp.TL/TL/Help/TLAppChangelogEmpty.cs +++ b/TeleSharp.TL/TL/Help/TLAppChangelogEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-1350696044)] + [TLObject(-1350696044)] public class TLAppChangelogEmpty : TLAbsAppChangelog { - public override int Constructor + public override int Constructor => -1350696044; + + + public void ComputeFlags() { - get - { - return -1350696044; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLAppUpdate.cs b/TeleSharp.TL/TL/Help/TLAppUpdate.cs index 3eb811a..def3ef2 100644 --- a/TeleSharp.TL/TL/Help/TLAppUpdate.cs +++ b/TeleSharp.TL/TL/Help/TLAppUpdate.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-1987579119)] + [TLObject(-1987579119)] public class TLAppUpdate : TLAbsAppUpdate { - public override int Constructor + public override int Constructor => -1987579119; + + public int id { get; set; } + public bool critical { get; set; } + public string url { get; set; } + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -1987579119; - } } - public int id {get;set;} - public bool critical {get;set;} - public string url {get;set;} - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -critical = BoolUtil.Deserialize(br); -url = StringUtil.Deserialize(br); -text = StringUtil.Deserialize(br); - + critical = BoolUtil.Deserialize(br); + url = StringUtil.Deserialize(br); + text = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -BoolUtil.Serialize(critical,bw); -StringUtil.Serialize(url,bw); -StringUtil.Serialize(text,bw); - + BoolUtil.Serialize(critical, bw); + StringUtil.Serialize(url, bw); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLInviteText.cs b/TeleSharp.TL/TL/Help/TLInviteText.cs index 178843b..2350c22 100644 --- a/TeleSharp.TL/TL/Help/TLInviteText.cs +++ b/TeleSharp.TL/TL/Help/TLInviteText.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(415997816)] + [TLObject(415997816)] public class TLInviteText : TLObject { - public override int Constructor + public override int Constructor => 415997816; + + public string message { get; set; } + + + public void ComputeFlags() { - get - { - return 415997816; - } } - public string message {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { message = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(message,bw); - + bw.Write(Constructor); + StringUtil.Serialize(message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs b/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs index b0302d3..f55863c 100644 --- a/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs +++ b/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-1000708810)] + [TLObject(-1000708810)] public class TLNoAppUpdate : TLAbsAppUpdate { - public override int Constructor + public override int Constructor => -1000708810; + + + public void ComputeFlags() { - get - { - return -1000708810; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs b/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs index 0e2016d..afeaa61 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-1189013126)] + [TLObject(-1189013126)] public class TLRequestGetAppChangelog : TLMethod { - public override int Constructor + public override int Constructor => -1189013126; + + public TLAbsAppChangelog Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1189013126; - } } - public Help.TLAbsAppChangelog Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Help.TLAbsAppChangelog)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsAppChangelog) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs b/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs index 5ef4294..3525f78 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-1372724842)] + [TLObject(-1372724842)] public class TLRequestGetAppUpdate : TLMethod { - public override int Constructor + public override int Constructor => -1372724842; + + public TLAbsAppUpdate Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1372724842; - } } - public Help.TLAbsAppUpdate Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Help.TLAbsAppUpdate)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsAppUpdate) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs b/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs index 287cc59..25962ec 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-990308245)] + [TLObject(-990308245)] public class TLRequestGetConfig : TLMethod { - public override int Constructor + public override int Constructor => -990308245; + + public TLConfig Response { get; set; } + + + public void ComputeFlags() { - get - { - return -990308245; - } } - public TLConfig Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLConfig)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLConfig) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs b/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs index 5265114..bc4da2d 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(1295590211)] + [TLObject(1295590211)] public class TLRequestGetInviteText : TLMethod { - public override int Constructor + public override int Constructor => 1295590211; + + public TLInviteText Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1295590211; - } } - public Help.TLInviteText Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Help.TLInviteText)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLInviteText) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs b/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs index 85122d4..34512c7 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(531836966)] + [TLObject(531836966)] public class TLRequestGetNearestDc : TLMethod { - public override int Constructor + public override int Constructor => 531836966; + + public TLNearestDc Response { get; set; } + + + public void ComputeFlags() { - get - { - return 531836966; - } } - public TLNearestDc Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLNearestDc)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLNearestDc) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs b/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs index c0861ec..efbc949 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-1663104819)] + [TLObject(-1663104819)] public class TLRequestGetSupport : TLMethod { - public override int Constructor + public override int Constructor => -1663104819; + + public TLSupport Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1663104819; - } } - public Help.TLSupport Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Help.TLSupport)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLSupport) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs b/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs index 01e46eb..2291de5 100644 --- a/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs +++ b/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(889286899)] + [TLObject(889286899)] public class TLRequestGetTermsOfService : TLMethod { - public override int Constructor + public override int Constructor => 889286899; + + public TLTermsOfService Response { get; set; } + + + public void ComputeFlags() { - get - { - return 889286899; - } } - public Help.TLTermsOfService Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Help.TLTermsOfService)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLTermsOfService) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs b/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs index 85739c5..29cfd28 100644 --- a/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs +++ b/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(1862465352)] + [TLObject(1862465352)] public class TLRequestSaveAppLog : TLMethod { - public override int Constructor + public override int Constructor => 1862465352; + + public TLVector events { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1862465352; - } } - public TLVector events {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - events = (TLVector)ObjectUtils.DeserializeVector(br); - + events = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(events,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(events, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLSupport.cs b/TeleSharp.TL/TL/Help/TLSupport.cs index 5c29fdd..4c04779 100644 --- a/TeleSharp.TL/TL/Help/TLSupport.cs +++ b/TeleSharp.TL/TL/Help/TLSupport.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(398898678)] + [TLObject(398898678)] public class TLSupport : TLObject { - public override int Constructor + public override int Constructor => 398898678; + + public string phone_number { get; set; } + public TLAbsUser user { get; set; } + + + public void ComputeFlags() { - get - { - return 398898678; - } } - public string phone_number {get;set;} - public TLAbsUser user {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -user = (TLAbsUser)ObjectUtils.DeserializeObject(br); - + user = (TLAbsUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -ObjectUtils.SerializeObject(user,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + ObjectUtils.SerializeObject(user, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Help/TLTermsOfService.cs b/TeleSharp.TL/TL/Help/TLTermsOfService.cs index bd476c3..50eb6d3 100644 --- a/TeleSharp.TL/TL/Help/TLTermsOfService.cs +++ b/TeleSharp.TL/TL/Help/TLTermsOfService.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Help { - [TLObject(-236044656)] + [TLObject(-236044656)] public class TLTermsOfService : TLObject { - public override int Constructor + public override int Constructor => -236044656; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -236044656; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs b/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs index 02c5d7f..1989f7b 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsAllStickers : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs b/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs index b57822b..697150c 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsDhConfig : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs b/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs index 0050795..c41df34 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsDialogs : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs b/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs index bc96191..1caa731 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsFeaturedStickers : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsMessages.cs b/TeleSharp.TL/TL/Messages/TLAbsMessages.cs index bdddf0a..6b133bb 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsMessages.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsMessages : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs b/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs index 1e763ff..dbf4302 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsRecentStickers : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs b/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs index ee01f4e..ddb7618 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsSavedGifs : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs b/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs index a6d12bc..dabb7f0 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsSentEncryptedMessage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs b/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs index bf4da05..301951f 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsStickerSetInstallResult : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAbsStickers.cs b/TeleSharp.TL/TL/Messages/TLAbsStickers.cs index c84da33..f7dd86e 100644 --- a/TeleSharp.TL/TL/Messages/TLAbsStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLAbsStickers.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Messages { public abstract class TLAbsStickers : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs b/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs index feab37e..0eedf22 100644 --- a/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs +++ b/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1269012015)] + [TLObject(-1269012015)] public class TLAffectedHistory : TLObject { - public override int Constructor + public override int Constructor => -1269012015; + + public int pts { get; set; } + public int pts_count { get; set; } + public int offset { get; set; } + + + public void ComputeFlags() { - get - { - return -1269012015; - } } - public int pts {get;set;} - public int pts_count {get;set;} - public int offset {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { pts = br.ReadInt32(); -pts_count = br.ReadInt32(); -offset = br.ReadInt32(); - + pts_count = br.ReadInt32(); + offset = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(pts); -bw.Write(pts_count); -bw.Write(offset); - + bw.Write(pts_count); + bw.Write(offset); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs b/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs index 3c14ba4..2f0cdfb 100644 --- a/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-2066640507)] + [TLObject(-2066640507)] public class TLAffectedMessages : TLObject { - public override int Constructor + public override int Constructor => -2066640507; + + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return -2066640507; - } } - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(pts); -bw.Write(pts_count); - + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAllStickers.cs b/TeleSharp.TL/TL/Messages/TLAllStickers.cs index 4538c7b..ac726fe 100644 --- a/TeleSharp.TL/TL/Messages/TLAllStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLAllStickers.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-302170017)] + [TLObject(-302170017)] public class TLAllStickers : TLAbsAllStickers { - public override int Constructor + public override int Constructor => -302170017; + + public int hash { get; set; } + public TLVector sets { get; set; } + + + public void ComputeFlags() { - get - { - return -302170017; - } } - public int hash {get;set;} - public TLVector sets {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); -sets = (TLVector)ObjectUtils.DeserializeVector(br); - + sets = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); -ObjectUtils.SerializeObject(sets,bw); - + ObjectUtils.SerializeObject(sets, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs b/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs index 465b0c1..48c88aa 100644 --- a/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs +++ b/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-395967805)] + [TLObject(-395967805)] public class TLAllStickersNotModified : TLAbsAllStickers { - public override int Constructor + public override int Constructor => -395967805; + + + public void ComputeFlags() { - get - { - return -395967805; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs b/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs index 3323a85..378806d 100644 --- a/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1338747336)] + [TLObject(1338747336)] public class TLArchivedStickers : TLObject { - public override int Constructor + public override int Constructor => 1338747336; + + public int count { get; set; } + public TLVector sets { get; set; } + + + public void ComputeFlags() { - get - { - return 1338747336; - } } - public int count {get;set;} - public TLVector sets {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { count = br.ReadInt32(); -sets = (TLVector)ObjectUtils.DeserializeVector(br); - + sets = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(count); -ObjectUtils.SerializeObject(sets,bw); - + ObjectUtils.SerializeObject(sets, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs b/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs index 36bc164..5eabdb0 100644 --- a/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs +++ b/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs @@ -1,70 +1,55 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1324486149)] + [TLObject(-1324486149)] public class TLBotCallbackAnswer : TLObject { - public override int Constructor + public override int Constructor => -1324486149; + + public int flags { get; set; } + public bool alert { get; set; } + public bool has_url { get; set; } + public string message { get; set; } + public string url { get; set; } + + + public void ComputeFlags() { - get - { - return -1324486149; - } + flags = 0; + flags = alert ? flags | 2 : flags & ~2; + flags = has_url ? flags | 8 : flags & ~8; + flags = message != null ? flags | 1 : flags & ~1; + flags = url != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool alert {get;set;} - public bool has_url {get;set;} - public string message {get;set;} - public string url {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = alert ? (flags | 2) : (flags & ~2); -flags = has_url ? (flags | 8) : (flags & ~8); -flags = message != null ? (flags | 1) : (flags & ~1); -flags = url != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -alert = (flags & 2) != 0; -has_url = (flags & 8) != 0; -if ((flags & 1) != 0) -message = StringUtil.Deserialize(br); -else -message = null; - -if ((flags & 4) != 0) -url = StringUtil.Deserialize(br); -else -url = null; - + alert = (flags & 2) != 0; + has_url = (flags & 8) != 0; + if ((flags & 1) != 0) + message = StringUtil.Deserialize(br); + else + message = null; + if ((flags & 4) != 0) + url = StringUtil.Deserialize(br); + else + url = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -if ((flags & 1) != 0) -StringUtil.Serialize(message,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(url,bw); - + if ((flags & 1) != 0) + StringUtil.Serialize(message, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(url, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLBotResults.cs b/TeleSharp.TL/TL/Messages/TLBotResults.cs index 47bbdd1..1ddb809 100644 --- a/TeleSharp.TL/TL/Messages/TLBotResults.cs +++ b/TeleSharp.TL/TL/Messages/TLBotResults.cs @@ -1,72 +1,58 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(627509670)] + [TLObject(627509670)] public class TLBotResults : TLObject { - public override int Constructor + public override int Constructor => 627509670; + + public int flags { get; set; } + public bool gallery { get; set; } + public long query_id { get; set; } + public string next_offset { get; set; } + public TLInlineBotSwitchPM switch_pm { get; set; } + public TLVector results { get; set; } + + + public void ComputeFlags() { - get - { - return 627509670; - } + flags = 0; + flags = gallery ? flags | 1 : flags & ~1; + flags = next_offset != null ? flags | 2 : flags & ~2; + flags = switch_pm != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool gallery {get;set;} - public long query_id {get;set;} - public string next_offset {get;set;} - public TLInlineBotSwitchPM switch_pm {get;set;} - public TLVector results {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = gallery ? (flags | 1) : (flags & ~1); -flags = next_offset != null ? (flags | 2) : (flags & ~2); -flags = switch_pm != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -gallery = (flags & 1) != 0; -query_id = br.ReadInt64(); -if ((flags & 2) != 0) -next_offset = StringUtil.Deserialize(br); -else -next_offset = null; + gallery = (flags & 1) != 0; + query_id = br.ReadInt64(); + if ((flags & 2) != 0) + next_offset = StringUtil.Deserialize(br); + else + next_offset = null; -if ((flags & 4) != 0) -switch_pm = (TLInlineBotSwitchPM)ObjectUtils.DeserializeObject(br); -else -switch_pm = null; - -results = (TLVector)ObjectUtils.DeserializeVector(br); + if ((flags & 4) != 0) + switch_pm = (TLInlineBotSwitchPM) ObjectUtils.DeserializeObject(br); + else + switch_pm = null; + results = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(query_id); -if ((flags & 2) != 0) -StringUtil.Serialize(next_offset,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(switch_pm,bw); -ObjectUtils.SerializeObject(results,bw); + bw.Write(flags); + bw.Write(query_id); + if ((flags & 2) != 0) + StringUtil.Serialize(next_offset, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(switch_pm, bw); + ObjectUtils.SerializeObject(results, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLChannelMessages.cs b/TeleSharp.TL/TL/Messages/TLChannelMessages.cs index 8245c35..43ee776 100644 --- a/TeleSharp.TL/TL/Messages/TLChannelMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLChannelMessages.cs @@ -1,59 +1,45 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1725551049)] + [TLObject(-1725551049)] public class TLChannelMessages : TLAbsMessages { - public override int Constructor + public override int Constructor => -1725551049; + + public int flags { get; set; } + public int pts { get; set; } + public int count { get; set; } + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1725551049; - } + flags = 0; } - public int flags {get;set;} - public int pts {get;set;} - public int count {get;set;} - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - flags = 0; - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -pts = br.ReadInt32(); -count = br.ReadInt32(); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + pts = br.ReadInt32(); + count = br.ReadInt32(); + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(pts); -bw.Write(count); -ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(flags); + bw.Write(pts); + bw.Write(count); + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLChatFull.cs b/TeleSharp.TL/TL/Messages/TLChatFull.cs index cc33086..af170b2 100644 --- a/TeleSharp.TL/TL/Messages/TLChatFull.cs +++ b/TeleSharp.TL/TL/Messages/TLChatFull.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-438840932)] + [TLObject(-438840932)] public class TLChatFull : TLObject { - public override int Constructor + public override int Constructor => -438840932; + + public TLAbsChatFull full_chat { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -438840932; - } } - public TLAbsChatFull full_chat {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - full_chat = (TLAbsChatFull)ObjectUtils.DeserializeObject(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + full_chat = (TLAbsChatFull) ObjectUtils.DeserializeObject(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(full_chat,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(full_chat, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLChats.cs b/TeleSharp.TL/TL/Messages/TLChats.cs index 5b9580e..c3426a2 100644 --- a/TeleSharp.TL/TL/Messages/TLChats.cs +++ b/TeleSharp.TL/TL/Messages/TLChats.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1694474197)] + [TLObject(1694474197)] public class TLChats : TLObject { - public override int Constructor + public override int Constructor => 1694474197; + + public TLVector chats { get; set; } + + + public void ComputeFlags() { - get - { - return 1694474197; - } } - public TLVector chats {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - chats = (TLVector)ObjectUtils.DeserializeVector(br); - + chats = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(chats,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(chats, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLDhConfig.cs b/TeleSharp.TL/TL/Messages/TLDhConfig.cs index 8eecfa3..9cac616 100644 --- a/TeleSharp.TL/TL/Messages/TLDhConfig.cs +++ b/TeleSharp.TL/TL/Messages/TLDhConfig.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(740433629)] + [TLObject(740433629)] public class TLDhConfig : TLAbsDhConfig { - public override int Constructor + public override int Constructor => 740433629; + + public int g { get; set; } + public byte[] p { get; set; } + public int version { get; set; } + public byte[] random { get; set; } + + + public void ComputeFlags() { - get - { - return 740433629; - } } - public int g {get;set;} - public byte[] p {get;set;} - public int version {get;set;} - public byte[] random {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { g = br.ReadInt32(); -p = BytesUtil.Deserialize(br); -version = br.ReadInt32(); -random = BytesUtil.Deserialize(br); - + p = BytesUtil.Deserialize(br); + version = br.ReadInt32(); + random = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(g); -BytesUtil.Serialize(p,bw); -bw.Write(version); -BytesUtil.Serialize(random,bw); - + BytesUtil.Serialize(p, bw); + bw.Write(version); + BytesUtil.Serialize(random, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs b/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs index e866617..f564a14 100644 --- a/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs +++ b/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1058912715)] + [TLObject(-1058912715)] public class TLDhConfigNotModified : TLAbsDhConfig { - public override int Constructor + public override int Constructor => -1058912715; + + public byte[] random { get; set; } + + + public void ComputeFlags() { - get - { - return -1058912715; - } } - public byte[] random {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { random = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(random,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(random, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLDialogs.cs b/TeleSharp.TL/TL/Messages/TLDialogs.cs index 03ba3dc..8f9073e 100644 --- a/TeleSharp.TL/TL/Messages/TLDialogs.cs +++ b/TeleSharp.TL/TL/Messages/TLDialogs.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(364538944)] + [TLObject(364538944)] public class TLDialogs : TLAbsDialogs { - public override int Constructor + public override int Constructor => 364538944; + + public TLVector dialogs { get; set; } + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 364538944; - } } - public TLVector dialogs {get;set;} - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - dialogs = (TLVector)ObjectUtils.DeserializeVector(br); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + dialogs = ObjectUtils.DeserializeVector(br); + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(dialogs,bw); -ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(dialogs, bw); + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs b/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs index a91aacc..53f8e74 100644 --- a/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs +++ b/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1910543603)] + [TLObject(1910543603)] public class TLDialogsSlice : TLAbsDialogs { - public override int Constructor + public override int Constructor => 1910543603; + + public int count { get; set; } + public TLVector dialogs { get; set; } + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1910543603; - } } - public int count {get;set;} - public TLVector dialogs {get;set;} - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { count = br.ReadInt32(); -dialogs = (TLVector)ObjectUtils.DeserializeVector(br); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + dialogs = ObjectUtils.DeserializeVector(br); + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(count); -ObjectUtils.SerializeObject(dialogs,bw); -ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + ObjectUtils.SerializeObject(dialogs, bw); + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs b/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs index de86954..5e5b438 100644 --- a/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-123893531)] + [TLObject(-123893531)] public class TLFeaturedStickers : TLAbsFeaturedStickers { - public override int Constructor + public override int Constructor => -123893531; + + public int hash { get; set; } + public TLVector sets { get; set; } + public TLVector unread { get; set; } + + + public void ComputeFlags() { - get - { - return -123893531; - } } - public int hash {get;set;} - public TLVector sets {get;set;} - public TLVector unread {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); -sets = (TLVector)ObjectUtils.DeserializeVector(br); -unread = (TLVector)ObjectUtils.DeserializeVector(br); - + sets = ObjectUtils.DeserializeVector(br); + unread = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); -ObjectUtils.SerializeObject(sets,bw); -ObjectUtils.SerializeObject(unread,bw); - + ObjectUtils.SerializeObject(sets, bw); + ObjectUtils.SerializeObject(unread, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs b/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs index 9d55e9e..8e7c31d 100644 --- a/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs +++ b/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(82699215)] + [TLObject(82699215)] public class TLFeaturedStickersNotModified : TLAbsFeaturedStickers { - public override int Constructor + public override int Constructor => 82699215; + + + public void ComputeFlags() { - get - { - return 82699215; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLFoundGifs.cs b/TeleSharp.TL/TL/Messages/TLFoundGifs.cs index 75dd79c..c7ba447 100644 --- a/TeleSharp.TL/TL/Messages/TLFoundGifs.cs +++ b/TeleSharp.TL/TL/Messages/TLFoundGifs.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1158290442)] + [TLObject(1158290442)] public class TLFoundGifs : TLObject { - public override int Constructor + public override int Constructor => 1158290442; + + public int next_offset { get; set; } + public TLVector results { get; set; } + + + public void ComputeFlags() { - get - { - return 1158290442; - } } - public int next_offset {get;set;} - public TLVector results {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { next_offset = br.ReadInt32(); -results = (TLVector)ObjectUtils.DeserializeVector(br); - + results = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(next_offset); -ObjectUtils.SerializeObject(results,bw); - + ObjectUtils.SerializeObject(results, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLHighScores.cs b/TeleSharp.TL/TL/Messages/TLHighScores.cs index c355734..33af162 100644 --- a/TeleSharp.TL/TL/Messages/TLHighScores.cs +++ b/TeleSharp.TL/TL/Messages/TLHighScores.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1707344487)] + [TLObject(-1707344487)] public class TLHighScores : TLObject { - public override int Constructor + public override int Constructor => -1707344487; + + public TLVector scores { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1707344487; - } } - public TLVector scores {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - scores = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + scores = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(scores,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(scores, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLMessageEditData.cs b/TeleSharp.TL/TL/Messages/TLMessageEditData.cs index fb31914..4791e2c 100644 --- a/TeleSharp.TL/TL/Messages/TLMessageEditData.cs +++ b/TeleSharp.TL/TL/Messages/TLMessageEditData.cs @@ -1,48 +1,33 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(649453030)] + [TLObject(649453030)] public class TLMessageEditData : TLObject { - public override int Constructor + public override int Constructor => 649453030; + + public int flags { get; set; } + public bool caption { get; set; } + + + public void ComputeFlags() { - get - { - return 649453030; - } + flags = 0; + flags = caption ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool caption {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = caption ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -caption = (flags & 1) != 0; - + caption = (flags & 1) != 0; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - - + bw.Write(flags); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLMessages.cs b/TeleSharp.TL/TL/Messages/TLMessages.cs index 3a24c7e..21e3c72 100644 --- a/TeleSharp.TL/TL/Messages/TLMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLMessages.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1938715001)] + [TLObject(-1938715001)] public class TLMessages : TLAbsMessages { - public override int Constructor + public override int Constructor => -1938715001; + + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1938715001; - } } - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs b/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs index 7f3bb07..64fba80 100644 --- a/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs +++ b/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(189033187)] + [TLObject(189033187)] public class TLMessagesSlice : TLAbsMessages { - public override int Constructor + public override int Constructor => 189033187; + + public int count { get; set; } + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 189033187; - } } - public int count {get;set;} - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { count = br.ReadInt32(); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(count); -ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); - + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs b/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs index 346ca83..f277225 100644 --- a/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs +++ b/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs @@ -1,54 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Updates; + namespace TeleSharp.TL.Messages { - [TLObject(863093588)] + [TLObject(863093588)] public class TLPeerDialogs : TLObject { - public override int Constructor + public override int Constructor => 863093588; + + public TLVector dialogs { get; set; } + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + public TLState state { get; set; } + + + public void ComputeFlags() { - get - { - return 863093588; - } } - public TLVector dialogs {get;set;} - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - public Updates.TLState state {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - dialogs = (TLVector)ObjectUtils.DeserializeVector(br); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); -state = (Updates.TLState)ObjectUtils.DeserializeObject(br); - + dialogs = ObjectUtils.DeserializeVector(br); + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); + state = (TLState) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(dialogs,bw); -ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); -ObjectUtils.SerializeObject(state,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(dialogs, bw); + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); + ObjectUtils.SerializeObject(state, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRecentStickers.cs b/TeleSharp.TL/TL/Messages/TLRecentStickers.cs index a380db5..a23b87f 100644 --- a/TeleSharp.TL/TL/Messages/TLRecentStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRecentStickers.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1558317424)] + [TLObject(1558317424)] public class TLRecentStickers : TLAbsRecentStickers { - public override int Constructor + public override int Constructor => 1558317424; + + public int hash { get; set; } + public TLVector stickers { get; set; } + + + public void ComputeFlags() { - get - { - return 1558317424; - } } - public int hash {get;set;} - public TLVector stickers {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); -stickers = (TLVector)ObjectUtils.DeserializeVector(br); - + stickers = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); -ObjectUtils.SerializeObject(stickers,bw); - + ObjectUtils.SerializeObject(stickers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs b/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs index 6cc8064..ccc9cda 100644 --- a/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs +++ b/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(186120336)] + [TLObject(186120336)] public class TLRecentStickersNotModified : TLAbsRecentStickers { - public override int Constructor + public override int Constructor => 186120336; + + + public void ComputeFlags() { - get - { - return 186120336; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs b/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs index c85fc89..a399744 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1035731989)] + [TLObject(1035731989)] public class TLRequestAcceptEncryption : TLMethod { - public override int Constructor + public override int Constructor => 1035731989; + + public TLInputEncryptedChat peer { get; set; } + public byte[] g_b { get; set; } + public long key_fingerprint { get; set; } + public TLAbsEncryptedChat Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1035731989; - } } - public TLInputEncryptedChat peer {get;set;} - public byte[] g_b {get;set;} - public long key_fingerprint {get;set;} - public TLAbsEncryptedChat Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); -g_b = BytesUtil.Deserialize(br); -key_fingerprint = br.ReadInt64(); - + peer = (TLInputEncryptedChat) ObjectUtils.DeserializeObject(br); + g_b = BytesUtil.Deserialize(br); + key_fingerprint = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -BytesUtil.Serialize(g_b,bw); -bw.Write(key_fingerprint); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + BytesUtil.Serialize(g_b, bw); + bw.Write(key_fingerprint); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsEncryptedChat)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsEncryptedChat) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs b/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs index 0611477..f4ca7b5 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-106911223)] + [TLObject(-106911223)] public class TLRequestAddChatUser : TLMethod { - public override int Constructor + public override int Constructor => -106911223; + + public int chat_id { get; set; } + public TLAbsInputUser user_id { get; set; } + public int fwd_limit { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -106911223; - } } - public int chat_id {get;set;} - public TLAbsInputUser user_id {get;set;} - public int fwd_limit {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -fwd_limit = br.ReadInt32(); - + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + fwd_limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -ObjectUtils.SerializeObject(user_id,bw); -bw.Write(fwd_limit); - + ObjectUtils.SerializeObject(user_id, bw); + bw.Write(fwd_limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs b/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs index 03322af..dc9ee23 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1051570619)] + [TLObject(1051570619)] public class TLRequestCheckChatInvite : TLMethod { - public override int Constructor + public override int Constructor => 1051570619; + + public string hash { get; set; } + public TLAbsChatInvite Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1051570619; - } } - public string hash {get;set;} - public TLAbsChatInvite Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(hash,bw); - + bw.Write(Constructor); + StringUtil.Serialize(hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsChatInvite)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsChatInvite) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs index d4feda9..dbf98bc 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs @@ -1,54 +1,39 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1986437075)] + [TLObject(-1986437075)] public class TLRequestClearRecentStickers : TLMethod { - public override int Constructor + public override int Constructor => -1986437075; + + public int flags { get; set; } + public bool attached { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1986437075; - } + flags = 0; + flags = attached ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool attached {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = attached ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -attached = (flags & 1) != 0; - + attached = (flags & 1) != 0; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - - + bw.Write(flags); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs b/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs index 0fa9aad..08b4c0b 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(164303470)] + [TLObject(164303470)] public class TLRequestCreateChat : TLMethod { - public override int Constructor + public override int Constructor => 164303470; + + public TLVector users { get; set; } + public string title { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 164303470; - } } - public TLVector users {get;set;} - public string title {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - users = (TLVector)ObjectUtils.DeserializeVector(br); -title = StringUtil.Deserialize(br); - + users = ObjectUtils.DeserializeVector(br); + title = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(users,bw); -StringUtil.Serialize(title,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(users, bw); + StringUtil.Serialize(title, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs b/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs index 4ee9960..3e32a48 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-530505962)] + [TLObject(-530505962)] public class TLRequestDeleteChatUser : TLMethod { - public override int Constructor + public override int Constructor => -530505962; + + public int chat_id { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -530505962; - } } - public int chat_id {get;set;} - public TLAbsInputUser user_id {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -ObjectUtils.SerializeObject(user_id,bw); - + ObjectUtils.SerializeObject(user_id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs b/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs index 8be7935..a522d8d 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(469850889)] + [TLObject(469850889)] public class TLRequestDeleteHistory : TLMethod { - public override int Constructor + public override int Constructor => 469850889; + + public int flags { get; set; } + public bool just_clear { get; set; } + public TLAbsInputPeer peer { get; set; } + public int max_id { get; set; } + public TLAffectedHistory Response { get; set; } + + + public void ComputeFlags() { - get - { - return 469850889; - } + flags = 0; + flags = just_clear ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool just_clear {get;set;} - public TLAbsInputPeer peer {get;set;} - public int max_id {get;set;} - public Messages.TLAffectedHistory Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = just_clear ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -just_clear = (flags & 1) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -max_id = br.ReadInt32(); - + just_clear = (flags & 1) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + max_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(peer,bw); -bw.Write(max_id); + bw.Write(flags); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(max_id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAffectedHistory)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAffectedHistory) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs b/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs index 26c11ed..0ff7d52 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1510897371)] + [TLObject(-1510897371)] public class TLRequestDeleteMessages : TLMethod { - public override int Constructor + public override int Constructor => -1510897371; + + public TLVector id { get; set; } + public TLAffectedMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1510897371; - } } - public TLVector id {get;set;} - public Messages.TLAffectedMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAffectedMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs b/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs index 49e9cdb..f99acf1 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-304536635)] + [TLObject(-304536635)] public class TLRequestDiscardEncryption : TLMethod { - public override int Constructor + public override int Constructor => -304536635; + + public int chat_id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -304536635; - } } - public int chat_id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs b/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs index f82faaf..e991e68 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1444503762)] + [TLObject(-1444503762)] public class TLRequestEditChatAdmin : TLMethod { - public override int Constructor + public override int Constructor => -1444503762; + + public int chat_id { get; set; } + public TLAbsInputUser user_id { get; set; } + public bool is_admin { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1444503762; - } } - public int chat_id {get;set;} - public TLAbsInputUser user_id {get;set;} - public bool is_admin {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -is_admin = BoolUtil.Deserialize(br); - + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + is_admin = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -ObjectUtils.SerializeObject(user_id,bw); -BoolUtil.Serialize(is_admin,bw); - + ObjectUtils.SerializeObject(user_id, bw); + BoolUtil.Serialize(is_admin, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs b/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs index bacaec9..6d0c937 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-900957736)] + [TLObject(-900957736)] public class TLRequestEditChatPhoto : TLMethod { - public override int Constructor + public override int Constructor => -900957736; + + public int chat_id { get; set; } + public TLAbsInputChatPhoto photo { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -900957736; - } } - public int chat_id {get;set;} - public TLAbsInputChatPhoto photo {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -photo = (TLAbsInputChatPhoto)ObjectUtils.DeserializeObject(br); - + photo = (TLAbsInputChatPhoto) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -ObjectUtils.SerializeObject(photo,bw); - + ObjectUtils.SerializeObject(photo, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs b/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs index 3acbed0..d7051db 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-599447467)] + [TLObject(-599447467)] public class TLRequestEditChatTitle : TLMethod { - public override int Constructor + public override int Constructor => -599447467; + + public int chat_id { get; set; } + public string title { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -599447467; - } } - public int chat_id {get;set;} - public string title {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -title = StringUtil.Deserialize(br); - + title = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -StringUtil.Serialize(title,bw); - + StringUtil.Serialize(title, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs b/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs index 415ca82..105f264 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs @@ -1,84 +1,69 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(319564933)] + [TLObject(319564933)] public class TLRequestEditInlineBotMessage : TLMethod { - public override int Constructor + public override int Constructor => 319564933; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public TLInputBotInlineMessageID id { get; set; } + public string message { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + public TLVector entities { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 319564933; - } + flags = 0; + flags = no_webpage ? flags | 2 : flags & ~2; + flags = message != null ? flags | 2048 : flags & ~2048; + flags = reply_markup != null ? flags | 4 : flags & ~4; + flags = entities != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public TLInputBotInlineMessageID id {get;set;} - public string message {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - public TLVector entities {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 2) : (flags & ~2); -flags = message != null ? (flags | 2048) : (flags & ~2048); -flags = reply_markup != null ? (flags | 4) : (flags & ~4); -flags = entities != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 2) != 0; -id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); -if ((flags & 2048) != 0) -message = StringUtil.Deserialize(br); -else -message = null; - -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - -if ((flags & 8) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; + no_webpage = (flags & 2) != 0; + id = (TLInputBotInlineMessageID) ObjectUtils.DeserializeObject(br); + if ((flags & 2048) != 0) + message = StringUtil.Deserialize(br); + else + message = null; + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; + if ((flags & 8) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(id,bw); -if ((flags & 2048) != 0) -StringUtil.Serialize(message,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(entities,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(id, bw); + if ((flags & 2048) != 0) + StringUtil.Serialize(message, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(entities, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs b/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs index 2ad157c..eea593c 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs @@ -1,87 +1,72 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-829299510)] + [TLObject(-829299510)] public class TLRequestEditMessage : TLMethod { - public override int Constructor + public override int Constructor => -829299510; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public TLAbsInputPeer peer { get; set; } + public int id { get; set; } + public string message { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + public TLVector entities { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -829299510; - } + flags = 0; + flags = no_webpage ? flags | 2 : flags & ~2; + flags = message != null ? flags | 2048 : flags & ~2048; + flags = reply_markup != null ? flags | 4 : flags & ~4; + flags = entities != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public TLAbsInputPeer peer {get;set;} - public int id {get;set;} - public string message {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - public TLVector entities {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 2) : (flags & ~2); -flags = message != null ? (flags | 2048) : (flags & ~2048); -flags = reply_markup != null ? (flags | 4) : (flags & ~4); -flags = entities != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 2) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); -if ((flags & 2048) != 0) -message = StringUtil.Deserialize(br); -else -message = null; - -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - -if ((flags & 8) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; + no_webpage = (flags & 2) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); + if ((flags & 2048) != 0) + message = StringUtil.Deserialize(br); + else + message = null; + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; + if ((flags & 8) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(peer,bw); -bw.Write(id); -if ((flags & 2048) != 0) -StringUtil.Serialize(message,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(entities,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(id); + if ((flags & 2048) != 0) + StringUtil.Serialize(message, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(entities, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs b/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs index 2eafe01..183b9c9 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(2106086025)] + [TLObject(2106086025)] public class TLRequestExportChatInvite : TLMethod { - public override int Constructor + public override int Constructor => 2106086025; + + public int chat_id { get; set; } + public TLAbsExportedChatInvite Response { get; set; } + + + public void ComputeFlags() { - get - { - return 2106086025; - } } - public int chat_id {get;set;} - public TLAbsExportedChatInvite Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsExportedChatInvite) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs b/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs index 7bb988d..ad3f666 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(865483769)] + [TLObject(865483769)] public class TLRequestForwardMessage : TLMethod { - public override int Constructor + public override int Constructor => 865483769; + + public TLAbsInputPeer peer { get; set; } + public int id { get; set; } + public long random_id { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 865483769; - } } - public TLAbsInputPeer peer {get;set;} - public int id {get;set;} - public long random_id {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); -random_id = br.ReadInt64(); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); + random_id = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(id); -bw.Write(random_id); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(id); + bw.Write(random_id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs b/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs index 06c469c..c06a8a1 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs @@ -1,74 +1,59 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1888354709)] + [TLObject(1888354709)] public class TLRequestForwardMessages : TLMethod { - public override int Constructor + public override int Constructor => 1888354709; + + public int flags { get; set; } + public bool silent { get; set; } + public bool background { get; set; } + public bool with_my_score { get; set; } + public TLAbsInputPeer from_peer { get; set; } + public TLVector id { get; set; } + public TLVector random_id { get; set; } + public TLAbsInputPeer to_peer { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1888354709; - } + flags = 0; + flags = silent ? flags | 32 : flags & ~32; + flags = background ? flags | 64 : flags & ~64; + flags = with_my_score ? flags | 256 : flags & ~256; } - public int flags {get;set;} - public bool silent {get;set;} - public bool background {get;set;} - public bool with_my_score {get;set;} - public TLAbsInputPeer from_peer {get;set;} - public TLVector id {get;set;} - public TLVector random_id {get;set;} - public TLAbsInputPeer to_peer {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = silent ? (flags | 32) : (flags & ~32); -flags = background ? (flags | 64) : (flags & ~64); -flags = with_my_score ? (flags | 256) : (flags & ~256); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -silent = (flags & 32) != 0; -background = (flags & 64) != 0; -with_my_score = (flags & 256) != 0; -from_peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = (TLVector)ObjectUtils.DeserializeVector(br); -random_id = (TLVector)ObjectUtils.DeserializeVector(br); -to_peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + silent = (flags & 32) != 0; + background = (flags & 64) != 0; + with_my_score = (flags & 256) != 0; + from_peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = ObjectUtils.DeserializeVector(br); + random_id = ObjectUtils.DeserializeVector(br); + to_peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - -ObjectUtils.SerializeObject(from_peer,bw); -ObjectUtils.SerializeObject(id,bw); -ObjectUtils.SerializeObject(random_id,bw); -ObjectUtils.SerializeObject(to_peer,bw); - + ObjectUtils.SerializeObject(from_peer, bw); + ObjectUtils.SerializeObject(id, bw); + ObjectUtils.SerializeObject(random_id, bw); + ObjectUtils.SerializeObject(to_peer, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs b/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs index 8d268c8..ac8e230 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1782549861)] + [TLObject(1782549861)] public class TLRequestGetAllDrafts : TLMethod { - public override int Constructor + public override int Constructor => 1782549861; + + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1782549861; - } } - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs index 68c31e0..28c2fa6 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(479598769)] + [TLObject(479598769)] public class TLRequestGetAllStickers : TLMethod { - public override int Constructor + public override int Constructor => 479598769; + + public int hash { get; set; } + public TLAbsAllStickers Response { get; set; } + + + public void ComputeFlags() { - get - { - return 479598769; - } } - public int hash {get;set;} - public Messages.TLAbsAllStickers Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsAllStickers)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsAllStickers) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs index 3b53dc0..6cc0fe1 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1475442322)] + [TLObject(1475442322)] public class TLRequestGetArchivedStickers : TLMethod { - public override int Constructor + public override int Constructor => 1475442322; + + public int flags { get; set; } + public bool masks { get; set; } + public long offset_id { get; set; } + public int limit { get; set; } + public TLArchivedStickers Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1475442322; - } + flags = 0; + flags = masks ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool masks {get;set;} - public long offset_id {get;set;} - public int limit {get;set;} - public Messages.TLArchivedStickers Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = masks ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -masks = (flags & 1) != 0; -offset_id = br.ReadInt64(); -limit = br.ReadInt32(); - + masks = (flags & 1) != 0; + offset_id = br.ReadInt64(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(offset_id); -bw.Write(limit); + bw.Write(flags); + bw.Write(offset_id); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLArchivedStickers)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLArchivedStickers) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs index 4af7e75..98643f6 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-866424884)] + [TLObject(-866424884)] public class TLRequestGetAttachedStickers : TLMethod { - public override int Constructor + public override int Constructor => -866424884; + + public TLAbsInputStickeredMedia media { get; set; } + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return -866424884; - } } - public TLAbsInputStickeredMedia media {get;set;} - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - media = (TLAbsInputStickeredMedia)ObjectUtils.DeserializeObject(br); - + media = (TLAbsInputStickeredMedia) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(media,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(media, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs b/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs index 2ebe083..d25ac19 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs @@ -1,69 +1,54 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-2130010132)] + [TLObject(-2130010132)] public class TLRequestGetBotCallbackAnswer : TLMethod { - public override int Constructor + public override int Constructor => -2130010132; + + public int flags { get; set; } + public bool game { get; set; } + public TLAbsInputPeer peer { get; set; } + public int msg_id { get; set; } + public byte[] data { get; set; } + public TLBotCallbackAnswer Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2130010132; - } + flags = 0; + flags = game ? flags | 2 : flags & ~2; + flags = data != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool game {get;set;} - public TLAbsInputPeer peer {get;set;} - public int msg_id {get;set;} - public byte[] data {get;set;} - public Messages.TLBotCallbackAnswer Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = game ? (flags | 2) : (flags & ~2); -flags = data != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -game = (flags & 2) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -msg_id = br.ReadInt32(); -if ((flags & 1) != 0) -data = BytesUtil.Deserialize(br); -else -data = null; - - + game = (flags & 2) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + msg_id = br.ReadInt32(); + if ((flags & 1) != 0) + data = BytesUtil.Deserialize(br); + else + data = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(peer,bw); -bw.Write(msg_id); -if ((flags & 1) != 0) -BytesUtil.Serialize(data,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(msg_id); + if ((flags & 1) != 0) + BytesUtil.Serialize(data, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLBotCallbackAnswer)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLBotCallbackAnswer) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs b/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs index b9635c4..65d5552 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1013621127)] + [TLObject(1013621127)] public class TLRequestGetChats : TLMethod { - public override int Constructor + public override int Constructor => 1013621127; + + public TLVector id { get; set; } + public TLChats Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1013621127; - } } - public TLVector id {get;set;} - public Messages.TLChats Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLChats)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLChats) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs b/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs index 9a5a71d..844b60e 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(651135312)] + [TLObject(651135312)] public class TLRequestGetDhConfig : TLMethod { - public override int Constructor + public override int Constructor => 651135312; + + public int version { get; set; } + public int random_length { get; set; } + public TLAbsDhConfig Response { get; set; } + + + public void ComputeFlags() { - get - { - return 651135312; - } } - public int version {get;set;} - public int random_length {get;set;} - public Messages.TLAbsDhConfig Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { version = br.ReadInt32(); -random_length = br.ReadInt32(); - + random_length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(version); -bw.Write(random_length); - + bw.Write(random_length); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsDhConfig)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsDhConfig) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs b/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs index 219e7ac..6b3149f 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1799878989)] + [TLObject(1799878989)] public class TLRequestGetDialogs : TLMethod { - public override int Constructor + public override int Constructor => 1799878989; + + public int offset_date { get; set; } + public int offset_id { get; set; } + public TLAbsInputPeer offset_peer { get; set; } + public int limit { get; set; } + public TLAbsDialogs Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1799878989; - } } - public int offset_date {get;set;} - public int offset_id {get;set;} - public TLAbsInputPeer offset_peer {get;set;} - public int limit {get;set;} - public Messages.TLAbsDialogs Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset_date = br.ReadInt32(); -offset_id = br.ReadInt32(); -offset_peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -limit = br.ReadInt32(); - + offset_id = br.ReadInt32(); + offset_peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset_date); -bw.Write(offset_id); -ObjectUtils.SerializeObject(offset_peer,bw); -bw.Write(limit); - + bw.Write(offset_id); + ObjectUtils.SerializeObject(offset_peer, bw); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsDialogs)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsDialogs) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs b/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs index ee2678b..74362e0 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(864953444)] + [TLObject(864953444)] public class TLRequestGetDocumentByHash : TLMethod { - public override int Constructor + public override int Constructor => 864953444; + + public byte[] sha256 { get; set; } + public int size { get; set; } + public string mime_type { get; set; } + public TLAbsDocument Response { get; set; } + + + public void ComputeFlags() { - get - { - return 864953444; - } } - public byte[] sha256 {get;set;} - public int size {get;set;} - public string mime_type {get;set;} - public TLAbsDocument Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { sha256 = BytesUtil.Deserialize(br); -size = br.ReadInt32(); -mime_type = StringUtil.Deserialize(br); - + size = br.ReadInt32(); + mime_type = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - BytesUtil.Serialize(sha256,bw); -bw.Write(size); -StringUtil.Serialize(mime_type,bw); - + bw.Write(Constructor); + BytesUtil.Serialize(sha256, bw); + bw.Write(size); + StringUtil.Serialize(mime_type, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsDocument) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs index 1b5c873..bfc80c5 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(766298703)] + [TLObject(766298703)] public class TLRequestGetFeaturedStickers : TLMethod { - public override int Constructor + public override int Constructor => 766298703; + + public int hash { get; set; } + public TLAbsFeaturedStickers Response { get; set; } + + + public void ComputeFlags() { - get - { - return 766298703; - } } - public int hash {get;set;} - public Messages.TLAbsFeaturedStickers Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsFeaturedStickers)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsFeaturedStickers) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs b/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs index 134254f..5d4426e 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(998448230)] + [TLObject(998448230)] public class TLRequestGetFullChat : TLMethod { - public override int Constructor + public override int Constructor => 998448230; + + public int chat_id { get; set; } + public TLChatFull Response { get; set; } + + + public void ComputeFlags() { - get - { - return 998448230; - } } - public int chat_id {get;set;} - public Messages.TLChatFull Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLChatFull)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLChatFull) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs b/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs index 90efa41..6983514 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-400399203)] + [TLObject(-400399203)] public class TLRequestGetGameHighScores : TLMethod { - public override int Constructor + public override int Constructor => -400399203; + + public TLAbsInputPeer peer { get; set; } + public int id { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLHighScores Response { get; set; } + + + public void ComputeFlags() { - get - { - return -400399203; - } } - public TLAbsInputPeer peer {get;set;} - public int id {get;set;} - public TLAbsInputUser user_id {get;set;} - public Messages.TLHighScores Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(id); -ObjectUtils.SerializeObject(user_id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(id); + ObjectUtils.SerializeObject(user_id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLHighScores)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLHighScores) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs b/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs index b0fddcd..0e862c4 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs @@ -1,66 +1,52 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1347868602)] + [TLObject(-1347868602)] public class TLRequestGetHistory : TLMethod { - public override int Constructor + public override int Constructor => -1347868602; + + public TLAbsInputPeer peer { get; set; } + public int offset_id { get; set; } + public int offset_date { get; set; } + public int add_offset { get; set; } + public int limit { get; set; } + public int max_id { get; set; } + public int min_id { get; set; } + public TLAbsMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1347868602; - } } - public TLAbsInputPeer peer {get;set;} - public int offset_id {get;set;} - public int offset_date {get;set;} - public int add_offset {get;set;} - public int limit {get;set;} - public int max_id {get;set;} - public int min_id {get;set;} - public Messages.TLAbsMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -offset_id = br.ReadInt32(); -offset_date = br.ReadInt32(); -add_offset = br.ReadInt32(); -limit = br.ReadInt32(); -max_id = br.ReadInt32(); -min_id = br.ReadInt32(); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + offset_id = br.ReadInt32(); + offset_date = br.ReadInt32(); + add_offset = br.ReadInt32(); + limit = br.ReadInt32(); + max_id = br.ReadInt32(); + min_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(offset_id); -bw.Write(offset_date); -bw.Write(add_offset); -bw.Write(limit); -bw.Write(max_id); -bw.Write(min_id); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(offset_id); + bw.Write(offset_date); + bw.Write(add_offset); + bw.Write(limit); + bw.Write(max_id); + bw.Write(min_id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs b/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs index e9e9dc5..54f1bde 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs @@ -1,71 +1,57 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1364105629)] + [TLObject(1364105629)] public class TLRequestGetInlineBotResults : TLMethod { - public override int Constructor + public override int Constructor => 1364105629; + + public int flags { get; set; } + public TLAbsInputUser bot { get; set; } + public TLAbsInputPeer peer { get; set; } + public TLAbsInputGeoPoint geo_point { get; set; } + public string query { get; set; } + public string offset { get; set; } + public TLBotResults Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1364105629; - } + flags = 0; + flags = geo_point != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public TLAbsInputUser bot {get;set;} - public TLAbsInputPeer peer {get;set;} - public TLAbsInputGeoPoint geo_point {get;set;} - public string query {get;set;} - public string offset {get;set;} - public Messages.TLBotResults Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = geo_point != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -bot = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -geo_point = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); -else -geo_point = null; - -query = StringUtil.Deserialize(br); -offset = StringUtil.Deserialize(br); + bot = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + geo_point = (TLAbsInputGeoPoint) ObjectUtils.DeserializeObject(br); + else + geo_point = null; + query = StringUtil.Deserialize(br); + offset = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(bot,bw); -ObjectUtils.SerializeObject(peer,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(geo_point,bw); -StringUtil.Serialize(query,bw); -StringUtil.Serialize(offset,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(bot, bw); + ObjectUtils.SerializeObject(peer, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(geo_point, bw); + StringUtil.Serialize(query, bw); + StringUtil.Serialize(offset, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLBotResults)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLBotResults) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs b/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs index 2762014..ccf7036 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(258170395)] + [TLObject(258170395)] public class TLRequestGetInlineGameHighScores : TLMethod { - public override int Constructor + public override int Constructor => 258170395; + + public TLInputBotInlineMessageID id { get; set; } + public TLAbsInputUser user_id { get; set; } + public TLHighScores Response { get; set; } + + + public void ComputeFlags() { - get - { - return 258170395; - } } - public TLInputBotInlineMessageID id {get;set;} - public TLAbsInputUser user_id {get;set;} - public Messages.TLHighScores Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + id = (TLInputBotInlineMessageID) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); -ObjectUtils.SerializeObject(user_id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); + ObjectUtils.SerializeObject(user_id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLHighScores)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLHighScores) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs index 0449515..2423575 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1706608543)] + [TLObject(1706608543)] public class TLRequestGetMaskStickers : TLMethod { - public override int Constructor + public override int Constructor => 1706608543; + + public int hash { get; set; } + public TLAbsAllStickers Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1706608543; - } } - public int hash {get;set;} - public Messages.TLAbsAllStickers Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsAllStickers)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsAllStickers) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs b/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs index 33c22cf..6a54bf3 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-39416522)] + [TLObject(-39416522)] public class TLRequestGetMessageEditData : TLMethod { - public override int Constructor + public override int Constructor => -39416522; + + public TLAbsInputPeer peer { get; set; } + public int id { get; set; } + public TLMessageEditData Response { get; set; } + + + public void ComputeFlags() { - get - { - return -39416522; - } } - public TLAbsInputPeer peer {get;set;} - public int id {get;set;} - public Messages.TLMessageEditData Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(id); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLMessageEditData)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLMessageEditData) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs b/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs index 62b8b78..d78f9c8 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1109588596)] + [TLObject(1109588596)] public class TLRequestGetMessages : TLMethod { - public override int Constructor + public override int Constructor => 1109588596; + + public TLVector id { get; set; } + public TLAbsMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1109588596; - } } - public TLVector id {get;set;} - public Messages.TLAbsMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs b/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs index 33cf44e..cf2a8f2 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-993483427)] + [TLObject(-993483427)] public class TLRequestGetMessagesViews : TLMethod { - public override int Constructor + public override int Constructor => -993483427; + + public TLAbsInputPeer peer { get; set; } + public TLVector id { get; set; } + public bool increment { get; set; } + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return -993483427; - } } - public TLAbsInputPeer peer {get;set;} - public TLVector id {get;set;} - public bool increment {get;set;} - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = (TLVector)ObjectUtils.DeserializeVector(br); -increment = BoolUtil.Deserialize(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = ObjectUtils.DeserializeVector(br); + increment = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(id,bw); -BoolUtil.Serialize(increment,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(id, bw); + BoolUtil.Serialize(increment, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs b/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs index 22cada7..11ea377 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(764901049)] + [TLObject(764901049)] public class TLRequestGetPeerDialogs : TLMethod { - public override int Constructor + public override int Constructor => 764901049; + + public TLVector peers { get; set; } + public TLPeerDialogs Response { get; set; } + + + public void ComputeFlags() { - get - { - return 764901049; - } } - public TLVector peers {get;set;} - public Messages.TLPeerDialogs Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peers = (TLVector)ObjectUtils.DeserializeVector(br); - + peers = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peers,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peers, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLPeerDialogs)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPeerDialogs) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs b/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs index 6425006..a63a3cf 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(913498268)] + [TLObject(913498268)] public class TLRequestGetPeerSettings : TLMethod { - public override int Constructor + public override int Constructor => 913498268; + + public TLAbsInputPeer peer { get; set; } + public TLPeerSettings Response { get; set; } + + + public void ComputeFlags() { - get - { - return 913498268; - } } - public TLAbsInputPeer peer {get;set;} - public TLPeerSettings Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLPeerSettings)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPeerSettings) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs index bb45759..97d7afb 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1587647177)] + [TLObject(1587647177)] public class TLRequestGetRecentStickers : TLMethod { - public override int Constructor + public override int Constructor => 1587647177; + + public int flags { get; set; } + public bool attached { get; set; } + public int hash { get; set; } + public TLAbsRecentStickers Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1587647177; - } + flags = 0; + flags = attached ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool attached {get;set;} - public int hash {get;set;} - public Messages.TLAbsRecentStickers Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = attached ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -attached = (flags & 1) != 0; -hash = br.ReadInt32(); - + attached = (flags & 1) != 0; + hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(hash); + bw.Write(flags); + bw.Write(hash); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsRecentStickers)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsRecentStickers) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs b/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs index e53008e..9c3bba2 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-2084618926)] + [TLObject(-2084618926)] public class TLRequestGetSavedGifs : TLMethod { - public override int Constructor + public override int Constructor => -2084618926; + + public int hash { get; set; } + public TLAbsSavedGifs Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2084618926; - } } - public int hash {get;set;} - public Messages.TLAbsSavedGifs Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsSavedGifs)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsSavedGifs) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs b/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs index 1de03bd..8f7e702 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(639215886)] + [TLObject(639215886)] public class TLRequestGetStickerSet : TLMethod { - public override int Constructor + public override int Constructor => 639215886; + + public TLAbsInputStickerSet stickerset { get; set; } + public TLStickerSet Response { get; set; } + + + public void ComputeFlags() { - get - { - return 639215886; - } } - public TLAbsInputStickerSet stickerset {get;set;} - public Messages.TLStickerSet Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); - + stickerset = (TLAbsInputStickerSet) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(stickerset,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(stickerset, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLStickerSet) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs b/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs index 67e486c..290df3c 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(623001124)] + [TLObject(623001124)] public class TLRequestGetWebPagePreview : TLMethod { - public override int Constructor + public override int Constructor => 623001124; + + public string message { get; set; } + public TLAbsMessageMedia Response { get; set; } + + + public void ComputeFlags() { - get - { - return 623001124; - } } - public string message {get;set;} - public TLAbsMessageMedia Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { message = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(message,bw); - + bw.Write(Constructor); + StringUtil.Serialize(message, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsMessageMedia) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs b/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs index 391d74a..331e33a 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1460572005)] + [TLObject(-1460572005)] public class TLRequestHideReportSpam : TLMethod { - public override int Constructor + public override int Constructor => -1460572005; + + public TLAbsInputPeer peer { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1460572005; - } } - public TLAbsInputPeer peer {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs b/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs index 4d4bea4..7ac1d1c 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1817183516)] + [TLObject(1817183516)] public class TLRequestImportChatInvite : TLMethod { - public override int Constructor + public override int Constructor => 1817183516; + + public string hash { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1817183516; - } } - public string hash {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(hash,bw); - + bw.Write(Constructor); + StringUtil.Serialize(hash, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs b/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs index 795c80b..f9e0abd 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-946871200)] + [TLObject(-946871200)] public class TLRequestInstallStickerSet : TLMethod { - public override int Constructor + public override int Constructor => -946871200; + + public TLAbsInputStickerSet stickerset { get; set; } + public bool archived { get; set; } + public TLAbsStickerSetInstallResult Response { get; set; } + + + public void ComputeFlags() { - get - { - return -946871200; - } } - public TLAbsInputStickerSet stickerset {get;set;} - public bool archived {get;set;} - public Messages.TLAbsStickerSetInstallResult Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); -archived = BoolUtil.Deserialize(br); - + stickerset = (TLAbsInputStickerSet) ObjectUtils.DeserializeObject(br); + archived = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(stickerset,bw); -BoolUtil.Serialize(archived,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(stickerset, bw); + BoolUtil.Serialize(archived, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsStickerSetInstallResult)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsStickerSetInstallResult) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs b/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs index c3d81ad..229a4d6 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(363051235)] + [TLObject(363051235)] public class TLRequestMigrateChat : TLMethod { - public override int Constructor + public override int Constructor => 363051235; + + public int chat_id { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return 363051235; - } } - public int chat_id {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs b/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs index 9a1c4c1..1a1cc23 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(2135648522)] + [TLObject(2135648522)] public class TLRequestReadEncryptedHistory : TLMethod { - public override int Constructor + public override int Constructor => 2135648522; + + public TLInputEncryptedChat peer { get; set; } + public int max_date { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 2135648522; - } } - public TLInputEncryptedChat peer {get;set;} - public int max_date {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); -max_date = br.ReadInt32(); - + peer = (TLInputEncryptedChat) ObjectUtils.DeserializeObject(br); + max_date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(max_date); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(max_date); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs b/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs index aee4675..e28f7f5 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1527873830)] + [TLObject(1527873830)] public class TLRequestReadFeaturedStickers : TLMethod { - public override int Constructor + public override int Constructor => 1527873830; + + public TLVector id { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1527873830; - } } - public TLVector id {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs b/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs index ff67d2f..b11f151 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(238054714)] + [TLObject(238054714)] public class TLRequestReadHistory : TLMethod { - public override int Constructor + public override int Constructor => 238054714; + + public TLAbsInputPeer peer { get; set; } + public int max_id { get; set; } + public TLAffectedMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return 238054714; - } } - public TLAbsInputPeer peer {get;set;} - public int max_id {get;set;} - public Messages.TLAffectedMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -max_id = br.ReadInt32(); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + max_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(max_id); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(max_id); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAffectedMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs b/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs index 920691a..a32e7b8 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(916930423)] + [TLObject(916930423)] public class TLRequestReadMessageContents : TLMethod { - public override int Constructor + public override int Constructor => 916930423; + + public TLVector id { get; set; } + public TLAffectedMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return 916930423; - } } - public TLVector id {get;set;} - public Messages.TLAffectedMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAffectedMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs b/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs index 1ea2056..e64462f 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(94983360)] + [TLObject(94983360)] public class TLRequestReceivedMessages : TLMethod { - public override int Constructor + public override int Constructor => 94983360; + + public int max_id { get; set; } + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return 94983360; - } } - public int max_id {get;set;} - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { max_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(max_id); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs b/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs index 24b4f64..6d67d32 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1436924774)] + [TLObject(1436924774)] public class TLRequestReceivedQueue : TLMethod { - public override int Constructor + public override int Constructor => 1436924774; + + public int max_qts { get; set; } + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1436924774; - } } - public int max_qts {get;set;} - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { max_qts = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(max_qts); - } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs b/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs index 1162560..07e830e 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(2016638777)] + [TLObject(2016638777)] public class TLRequestReorderStickerSets : TLMethod { - public override int Constructor + public override int Constructor => 2016638777; + + public int flags { get; set; } + public bool masks { get; set; } + public TLVector order { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 2016638777; - } + flags = 0; + flags = masks ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool masks {get;set;} - public TLVector order {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = masks ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -masks = (flags & 1) != 0; -order = (TLVector)ObjectUtils.DeserializeVector(br); - + masks = (flags & 1) != 0; + order = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(order,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(order, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs b/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs index 2543daf..43d4650 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-820669733)] + [TLObject(-820669733)] public class TLRequestReportSpam : TLMethod { - public override int Constructor + public override int Constructor => -820669733; + + public TLAbsInputPeer peer { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -820669733; - } } - public TLAbsInputPeer peer {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs b/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs index e5ff54a..37370b0 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-162681021)] + [TLObject(-162681021)] public class TLRequestRequestEncryption : TLMethod { - public override int Constructor + public override int Constructor => -162681021; + + public TLAbsInputUser user_id { get; set; } + public int random_id { get; set; } + public byte[] g_a { get; set; } + public TLAbsEncryptedChat Response { get; set; } + + + public void ComputeFlags() { - get - { - return -162681021; - } } - public TLAbsInputUser user_id {get;set;} - public int random_id {get;set;} - public byte[] g_a {get;set;} - public TLAbsEncryptedChat Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -random_id = br.ReadInt32(); -g_a = BytesUtil.Deserialize(br); - + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + random_id = br.ReadInt32(); + g_a = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(user_id,bw); -bw.Write(random_id); -BytesUtil.Serialize(g_a,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(user_id, bw); + bw.Write(random_id); + BytesUtil.Serialize(g_a, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsEncryptedChat)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsEncryptedChat) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs b/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs index 54a3fe1..65875f4 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs @@ -1,78 +1,63 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1137057461)] + [TLObject(-1137057461)] public class TLRequestSaveDraft : TLMethod { - public override int Constructor + public override int Constructor => -1137057461; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public int? reply_to_msg_id { get; set; } + public TLAbsInputPeer peer { get; set; } + public string message { get; set; } + public TLVector entities { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1137057461; - } + flags = 0; + flags = no_webpage ? flags | 2 : flags & ~2; + flags = reply_to_msg_id != null ? flags | 1 : flags & ~1; + flags = entities != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public int? reply_to_msg_id {get;set;} - public TLAbsInputPeer peer {get;set;} - public string message {get;set;} - public TLVector entities {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 2) : (flags & ~2); -flags = reply_to_msg_id != null ? (flags | 1) : (flags & ~1); -flags = entities != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 2) != 0; -if ((flags & 1) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -message = StringUtil.Deserialize(br); -if ((flags & 8) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; - + no_webpage = (flags & 2) != 0; + if ((flags & 1) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + message = StringUtil.Deserialize(br); + if ((flags & 8) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -if ((flags & 1) != 0) -bw.Write(reply_to_msg_id.Value); -ObjectUtils.SerializeObject(peer,bw); -StringUtil.Serialize(message,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(entities,bw); + bw.Write(flags); + if ((flags & 1) != 0) + bw.Write(reply_to_msg_id.Value); + ObjectUtils.SerializeObject(peer, bw); + StringUtil.Serialize(message, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(entities, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs b/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs index ae0bb17..b67b630 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(846868683)] + [TLObject(846868683)] public class TLRequestSaveGif : TLMethod { - public override int Constructor + public override int Constructor => 846868683; + + public TLAbsInputDocument id { get; set; } + public bool unsave { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 846868683; - } } - public TLAbsInputDocument id {get;set;} - public bool unsave {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); -unsave = BoolUtil.Deserialize(br); - + id = (TLAbsInputDocument) ObjectUtils.DeserializeObject(br); + unsave = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); -BoolUtil.Serialize(unsave,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); + BoolUtil.Serialize(unsave, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs b/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs index 189d49a..531b6bb 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(958863608)] + [TLObject(958863608)] public class TLRequestSaveRecentSticker : TLMethod { - public override int Constructor + public override int Constructor => 958863608; + + public int flags { get; set; } + public bool attached { get; set; } + public TLAbsInputDocument id { get; set; } + public bool unsave { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 958863608; - } + flags = 0; + flags = attached ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool attached {get;set;} - public TLAbsInputDocument id {get;set;} - public bool unsave {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = attached ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -attached = (flags & 1) != 0; -id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); -unsave = BoolUtil.Deserialize(br); - + attached = (flags & 1) != 0; + id = (TLAbsInputDocument) ObjectUtils.DeserializeObject(br); + unsave = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(id,bw); -BoolUtil.Serialize(unsave,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(id, bw); + BoolUtil.Serialize(unsave, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSearch.cs b/TeleSharp.TL/TL/Messages/TLRequestSearch.cs index 7e7aff1..fcef345 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSearch.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSearch.cs @@ -1,74 +1,60 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-732523960)] + [TLObject(-732523960)] public class TLRequestSearch : TLMethod { - public override int Constructor + public override int Constructor => -732523960; + + public int flags { get; set; } + public TLAbsInputPeer peer { get; set; } + public string q { get; set; } + public TLAbsMessagesFilter filter { get; set; } + public int min_date { get; set; } + public int max_date { get; set; } + public int offset { get; set; } + public int max_id { get; set; } + public int limit { get; set; } + public TLAbsMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return -732523960; - } + flags = 0; } - public int flags {get;set;} - public TLAbsInputPeer peer {get;set;} - public string q {get;set;} - public TLAbsMessagesFilter filter {get;set;} - public int min_date {get;set;} - public int max_date {get;set;} - public int offset {get;set;} - public int max_id {get;set;} - public int limit {get;set;} - public Messages.TLAbsMessages Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -q = StringUtil.Deserialize(br); -filter = (TLAbsMessagesFilter)ObjectUtils.DeserializeObject(br); -min_date = br.ReadInt32(); -max_date = br.ReadInt32(); -offset = br.ReadInt32(); -max_id = br.ReadInt32(); -limit = br.ReadInt32(); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + q = StringUtil.Deserialize(br); + filter = (TLAbsMessagesFilter) ObjectUtils.DeserializeObject(br); + min_date = br.ReadInt32(); + max_date = br.ReadInt32(); + offset = br.ReadInt32(); + max_id = br.ReadInt32(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(peer,bw); -StringUtil.Serialize(q,bw); -ObjectUtils.SerializeObject(filter,bw); -bw.Write(min_date); -bw.Write(max_date); -bw.Write(offset); -bw.Write(max_id); -bw.Write(limit); - + bw.Write(flags); + ObjectUtils.SerializeObject(peer, bw); + StringUtil.Serialize(q, bw); + ObjectUtils.SerializeObject(filter, bw); + bw.Write(min_date); + bw.Write(max_date); + bw.Write(offset); + bw.Write(max_id); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs b/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs index db8b15d..3cc16ef 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1080395925)] + [TLObject(-1080395925)] public class TLRequestSearchGifs : TLMethod { - public override int Constructor + public override int Constructor => -1080395925; + + public string q { get; set; } + public int offset { get; set; } + public TLFoundGifs Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1080395925; - } } - public string q {get;set;} - public int offset {get;set;} - public Messages.TLFoundGifs Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { q = StringUtil.Deserialize(br); -offset = br.ReadInt32(); - + offset = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(q,bw); -bw.Write(offset); - + bw.Write(Constructor); + StringUtil.Serialize(q, bw); + bw.Write(offset); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLFoundGifs)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLFoundGifs) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs b/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs index 99e85e1..8230f3e 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1640190800)] + [TLObject(-1640190800)] public class TLRequestSearchGlobal : TLMethod { - public override int Constructor + public override int Constructor => -1640190800; + + public string q { get; set; } + public int offset_date { get; set; } + public TLAbsInputPeer offset_peer { get; set; } + public int offset_id { get; set; } + public int limit { get; set; } + public TLAbsMessages Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1640190800; - } } - public string q {get;set;} - public int offset_date {get;set;} - public TLAbsInputPeer offset_peer {get;set;} - public int offset_id {get;set;} - public int limit {get;set;} - public Messages.TLAbsMessages Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { q = StringUtil.Deserialize(br); -offset_date = br.ReadInt32(); -offset_peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -offset_id = br.ReadInt32(); -limit = br.ReadInt32(); - + offset_date = br.ReadInt32(); + offset_peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + offset_id = br.ReadInt32(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(q,bw); -bw.Write(offset_date); -ObjectUtils.SerializeObject(offset_peer,bw); -bw.Write(offset_id); -bw.Write(limit); - + bw.Write(Constructor); + StringUtil.Serialize(q, bw); + bw.Write(offset_date); + ObjectUtils.SerializeObject(offset_peer, bw); + bw.Write(offset_id); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsMessages) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs b/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs index c8da3f0..b449759 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1451792525)] + [TLObject(-1451792525)] public class TLRequestSendEncrypted : TLMethod { - public override int Constructor + public override int Constructor => -1451792525; + + public TLInputEncryptedChat peer { get; set; } + public long random_id { get; set; } + public byte[] data { get; set; } + public TLAbsSentEncryptedMessage Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1451792525; - } } - public TLInputEncryptedChat peer {get;set;} - public long random_id {get;set;} - public byte[] data {get;set;} - public Messages.TLAbsSentEncryptedMessage Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); -random_id = br.ReadInt64(); -data = BytesUtil.Deserialize(br); - + peer = (TLInputEncryptedChat) ObjectUtils.DeserializeObject(br); + random_id = br.ReadInt64(); + data = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(random_id); -BytesUtil.Serialize(data,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(random_id); + BytesUtil.Serialize(data, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsSentEncryptedMessage)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsSentEncryptedMessage) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs b/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs index 626fa17..008f40f 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1701831834)] + [TLObject(-1701831834)] public class TLRequestSendEncryptedFile : TLMethod { - public override int Constructor + public override int Constructor => -1701831834; + + public TLInputEncryptedChat peer { get; set; } + public long random_id { get; set; } + public byte[] data { get; set; } + public TLAbsInputEncryptedFile file { get; set; } + public TLAbsSentEncryptedMessage Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1701831834; - } } - public TLInputEncryptedChat peer {get;set;} - public long random_id {get;set;} - public byte[] data {get;set;} - public TLAbsInputEncryptedFile file {get;set;} - public Messages.TLAbsSentEncryptedMessage Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); -random_id = br.ReadInt64(); -data = BytesUtil.Deserialize(br); -file = (TLAbsInputEncryptedFile)ObjectUtils.DeserializeObject(br); - + peer = (TLInputEncryptedChat) ObjectUtils.DeserializeObject(br); + random_id = br.ReadInt64(); + data = BytesUtil.Deserialize(br); + file = (TLAbsInputEncryptedFile) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(random_id); -BytesUtil.Serialize(data,bw); -ObjectUtils.SerializeObject(file,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(random_id); + BytesUtil.Serialize(data, bw); + ObjectUtils.SerializeObject(file, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsSentEncryptedMessage)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsSentEncryptedMessage) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs b/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs index da6cf18..e8e8a6f 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(852769188)] + [TLObject(852769188)] public class TLRequestSendEncryptedService : TLMethod { - public override int Constructor + public override int Constructor => 852769188; + + public TLInputEncryptedChat peer { get; set; } + public long random_id { get; set; } + public byte[] data { get; set; } + public TLAbsSentEncryptedMessage Response { get; set; } + + + public void ComputeFlags() { - get - { - return 852769188; - } } - public TLInputEncryptedChat peer {get;set;} - public long random_id {get;set;} - public byte[] data {get;set;} - public Messages.TLAbsSentEncryptedMessage Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); -random_id = br.ReadInt64(); -data = BytesUtil.Deserialize(br); - + peer = (TLInputEncryptedChat) ObjectUtils.DeserializeObject(br); + random_id = br.ReadInt64(); + data = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(random_id); -BytesUtil.Serialize(data,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(random_id); + BytesUtil.Serialize(data, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Messages.TLAbsSentEncryptedMessage)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsSentEncryptedMessage) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs b/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs index 2d928c3..d7409f9 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs @@ -1,83 +1,68 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1318189314)] + [TLObject(-1318189314)] public class TLRequestSendInlineBotResult : TLMethod { - public override int Constructor + public override int Constructor => -1318189314; + + public int flags { get; set; } + public bool silent { get; set; } + public bool background { get; set; } + public bool clear_draft { get; set; } + public TLAbsInputPeer peer { get; set; } + public int? reply_to_msg_id { get; set; } + public long random_id { get; set; } + public long query_id { get; set; } + public string id { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1318189314; - } + flags = 0; + flags = silent ? flags | 32 : flags & ~32; + flags = background ? flags | 64 : flags & ~64; + flags = clear_draft ? flags | 128 : flags & ~128; + flags = reply_to_msg_id != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool silent {get;set;} - public bool background {get;set;} - public bool clear_draft {get;set;} - public TLAbsInputPeer peer {get;set;} - public int? reply_to_msg_id {get;set;} - public long random_id {get;set;} - public long query_id {get;set;} - public string id {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = silent ? (flags | 32) : (flags & ~32); -flags = background ? (flags | 64) : (flags & ~64); -flags = clear_draft ? (flags | 128) : (flags & ~128); -flags = reply_to_msg_id != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -silent = (flags & 32) != 0; -background = (flags & 64) != 0; -clear_draft = (flags & 128) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -random_id = br.ReadInt64(); -query_id = br.ReadInt64(); -id = StringUtil.Deserialize(br); + silent = (flags & 32) != 0; + background = (flags & 64) != 0; + clear_draft = (flags & 128) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + random_id = br.ReadInt64(); + query_id = br.ReadInt64(); + id = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - -ObjectUtils.SerializeObject(peer,bw); -if ((flags & 1) != 0) -bw.Write(reply_to_msg_id.Value); -bw.Write(random_id); -bw.Write(query_id); -StringUtil.Serialize(id,bw); - + ObjectUtils.SerializeObject(peer, bw); + if ((flags & 1) != 0) + bw.Write(reply_to_msg_id.Value); + bw.Write(random_id); + bw.Write(query_id); + StringUtil.Serialize(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs b/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs index 1158c33..15eadea 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs @@ -1,89 +1,73 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-923703407)] + [TLObject(-923703407)] public class TLRequestSendMedia : TLMethod { - public override int Constructor + public override int Constructor => -923703407; + + public int flags { get; set; } + public bool silent { get; set; } + public bool background { get; set; } + public bool clear_draft { get; set; } + public TLAbsInputPeer peer { get; set; } + public int? reply_to_msg_id { get; set; } + public TLAbsInputMedia media { get; set; } + public long random_id { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -923703407; - } + flags = 0; + flags = silent ? flags | 32 : flags & ~32; + flags = background ? flags | 64 : flags & ~64; + flags = clear_draft ? flags | 128 : flags & ~128; + flags = reply_to_msg_id != null ? flags | 1 : flags & ~1; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool silent {get;set;} - public bool background {get;set;} - public bool clear_draft {get;set;} - public TLAbsInputPeer peer {get;set;} - public int? reply_to_msg_id {get;set;} - public TLAbsInputMedia media {get;set;} - public long random_id {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = silent ? (flags | 32) : (flags & ~32); -flags = background ? (flags | 64) : (flags & ~64); -flags = clear_draft ? (flags | 128) : (flags & ~128); -flags = reply_to_msg_id != null ? (flags | 1) : (flags & ~1); -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -silent = (flags & 32) != 0; -background = (flags & 64) != 0; -clear_draft = (flags & 128) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br); -random_id = br.ReadInt64(); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - + silent = (flags & 32) != 0; + background = (flags & 64) != 0; + clear_draft = (flags & 128) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + media = (TLAbsInputMedia) ObjectUtils.DeserializeObject(br); + random_id = br.ReadInt64(); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - -ObjectUtils.SerializeObject(peer,bw); -if ((flags & 1) != 0) -bw.Write(reply_to_msg_id.Value); -ObjectUtils.SerializeObject(media,bw); -bw.Write(random_id); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + ObjectUtils.SerializeObject(peer, bw); + if ((flags & 1) != 0) + bw.Write(reply_to_msg_id.Value); + ObjectUtils.SerializeObject(media, bw); + bw.Write(random_id); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs b/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs index d9188a5..63d1627 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs @@ -1,102 +1,85 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-91733382)] + [TLObject(-91733382)] public class TLRequestSendMessage : TLMethod { - public override int Constructor + public override int Constructor => -91733382; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public bool silent { get; set; } + public bool background { get; set; } + public bool clear_draft { get; set; } + public TLAbsInputPeer peer { get; set; } + public int? reply_to_msg_id { get; set; } + public string message { get; set; } + public long random_id { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + public TLVector entities { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -91733382; - } + flags = 0; + flags = no_webpage ? flags | 2 : flags & ~2; + flags = silent ? flags | 32 : flags & ~32; + flags = background ? flags | 64 : flags & ~64; + flags = clear_draft ? flags | 128 : flags & ~128; + flags = reply_to_msg_id != null ? flags | 1 : flags & ~1; + flags = reply_markup != null ? flags | 4 : flags & ~4; + flags = entities != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public bool silent {get;set;} - public bool background {get;set;} - public bool clear_draft {get;set;} - public TLAbsInputPeer peer {get;set;} - public int? reply_to_msg_id {get;set;} - public string message {get;set;} - public long random_id {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - public TLVector entities {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 2) : (flags & ~2); -flags = silent ? (flags | 32) : (flags & ~32); -flags = background ? (flags | 64) : (flags & ~64); -flags = clear_draft ? (flags | 128) : (flags & ~128); -flags = reply_to_msg_id != null ? (flags | 1) : (flags & ~1); -flags = reply_markup != null ? (flags | 4) : (flags & ~4); -flags = entities != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 2) != 0; -silent = (flags & 32) != 0; -background = (flags & 64) != 0; -clear_draft = (flags & 128) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -message = StringUtil.Deserialize(br); -random_id = br.ReadInt64(); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - -if ((flags & 8) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; + no_webpage = (flags & 2) != 0; + silent = (flags & 32) != 0; + background = (flags & 64) != 0; + clear_draft = (flags & 128) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + message = StringUtil.Deserialize(br); + random_id = br.ReadInt64(); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; + if ((flags & 8) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - -ObjectUtils.SerializeObject(peer,bw); -if ((flags & 1) != 0) -bw.Write(reply_to_msg_id.Value); -StringUtil.Serialize(message,bw); -bw.Write(random_id); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(entities,bw); - + ObjectUtils.SerializeObject(peer, bw); + if ((flags & 1) != 0) + bw.Write(reply_to_msg_id.Value); + StringUtil.Serialize(message, bw); + bw.Write(random_id); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(entities, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs b/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs index 71b8e6b..8b0cbc2 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs @@ -1,75 +1,60 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-920136629)] + [TLObject(-920136629)] public class TLRequestSetBotCallbackAnswer : TLMethod { - public override int Constructor + public override int Constructor => -920136629; + + public int flags { get; set; } + public bool alert { get; set; } + public long query_id { get; set; } + public string message { get; set; } + public string url { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -920136629; - } + flags = 0; + flags = alert ? flags | 2 : flags & ~2; + flags = message != null ? flags | 1 : flags & ~1; + flags = url != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool alert {get;set;} - public long query_id {get;set;} - public string message {get;set;} - public string url {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = alert ? (flags | 2) : (flags & ~2); -flags = message != null ? (flags | 1) : (flags & ~1); -flags = url != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -alert = (flags & 2) != 0; -query_id = br.ReadInt64(); -if ((flags & 1) != 0) -message = StringUtil.Deserialize(br); -else -message = null; - -if ((flags & 4) != 0) -url = StringUtil.Deserialize(br); -else -url = null; - + alert = (flags & 2) != 0; + query_id = br.ReadInt64(); + if ((flags & 1) != 0) + message = StringUtil.Deserialize(br); + else + message = null; + if ((flags & 4) != 0) + url = StringUtil.Deserialize(br); + else + url = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(query_id); -if ((flags & 1) != 0) -StringUtil.Serialize(message,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(url,bw); + bw.Write(flags); + bw.Write(query_id); + if ((flags & 1) != 0) + StringUtil.Serialize(message, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(url, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs b/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs index 0904104..3e6f6b2 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(2031374829)] + [TLObject(2031374829)] public class TLRequestSetEncryptedTyping : TLMethod { - public override int Constructor + public override int Constructor => 2031374829; + + public TLInputEncryptedChat peer { get; set; } + public bool typing { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 2031374829; - } } - public TLInputEncryptedChat peer {get;set;} - public bool typing {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); -typing = BoolUtil.Deserialize(br); - + peer = (TLInputEncryptedChat) ObjectUtils.DeserializeObject(br); + typing = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -BoolUtil.Serialize(typing,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + BoolUtil.Serialize(typing, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs b/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs index 423efdd..c921ecd 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs @@ -1,66 +1,52 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1896289088)] + [TLObject(-1896289088)] public class TLRequestSetGameScore : TLMethod { - public override int Constructor + public override int Constructor => -1896289088; + + public int flags { get; set; } + public bool edit_message { get; set; } + public TLAbsInputPeer peer { get; set; } + public int id { get; set; } + public TLAbsInputUser user_id { get; set; } + public int score { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1896289088; - } + flags = 0; + flags = edit_message ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool edit_message {get;set;} - public TLAbsInputPeer peer {get;set;} - public int id {get;set;} - public TLAbsInputUser user_id {get;set;} - public int score {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = edit_message ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -edit_message = (flags & 1) != 0; -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -id = br.ReadInt32(); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -score = br.ReadInt32(); - + edit_message = (flags & 1) != 0; + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + id = br.ReadInt32(); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + score = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(peer,bw); -bw.Write(id); -ObjectUtils.SerializeObject(user_id,bw); -bw.Write(score); + bw.Write(flags); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(id); + ObjectUtils.SerializeObject(user_id, bw); + bw.Write(score); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs b/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs index 8f835b9..8f56e29 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs @@ -1,85 +1,70 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-346119674)] + [TLObject(-346119674)] public class TLRequestSetInlineBotResults : TLMethod { - public override int Constructor + public override int Constructor => -346119674; + + public int flags { get; set; } + public bool gallery { get; set; } + public bool @private { get; set; } + public long query_id { get; set; } + public TLVector results { get; set; } + public int cache_time { get; set; } + public string next_offset { get; set; } + public TLInlineBotSwitchPM switch_pm { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -346119674; - } + flags = 0; + flags = gallery ? flags | 1 : flags & ~1; + flags = @private ? flags | 2 : flags & ~2; + flags = next_offset != null ? flags | 4 : flags & ~4; + flags = switch_pm != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool gallery {get;set;} - public bool @private {get;set;} - public long query_id {get;set;} - public TLVector results {get;set;} - public int cache_time {get;set;} - public string next_offset {get;set;} - public TLInlineBotSwitchPM switch_pm {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = gallery ? (flags | 1) : (flags & ~1); -flags = @private ? (flags | 2) : (flags & ~2); -flags = next_offset != null ? (flags | 4) : (flags & ~4); -flags = switch_pm != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -gallery = (flags & 1) != 0; -@private = (flags & 2) != 0; -query_id = br.ReadInt64(); -results = (TLVector)ObjectUtils.DeserializeVector(br); -cache_time = br.ReadInt32(); -if ((flags & 4) != 0) -next_offset = StringUtil.Deserialize(br); -else -next_offset = null; - -if ((flags & 8) != 0) -switch_pm = (TLInlineBotSwitchPM)ObjectUtils.DeserializeObject(br); -else -switch_pm = null; - + gallery = (flags & 1) != 0; + @private = (flags & 2) != 0; + query_id = br.ReadInt64(); + results = ObjectUtils.DeserializeVector(br); + cache_time = br.ReadInt32(); + if ((flags & 4) != 0) + next_offset = StringUtil.Deserialize(br); + else + next_offset = null; + if ((flags & 8) != 0) + switch_pm = (TLInlineBotSwitchPM) ObjectUtils.DeserializeObject(br); + else + switch_pm = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -bw.Write(query_id); -ObjectUtils.SerializeObject(results,bw); -bw.Write(cache_time); -if ((flags & 4) != 0) -StringUtil.Serialize(next_offset,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(switch_pm,bw); - + bw.Write(query_id); + ObjectUtils.SerializeObject(results, bw); + bw.Write(cache_time); + if ((flags & 4) != 0) + StringUtil.Serialize(next_offset, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(switch_pm, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs b/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs index d3efa0b..f935596 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs @@ -1,63 +1,49 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(363700068)] + [TLObject(363700068)] public class TLRequestSetInlineGameScore : TLMethod { - public override int Constructor + public override int Constructor => 363700068; + + public int flags { get; set; } + public bool edit_message { get; set; } + public TLInputBotInlineMessageID id { get; set; } + public TLAbsInputUser user_id { get; set; } + public int score { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return 363700068; - } + flags = 0; + flags = edit_message ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool edit_message {get;set;} - public TLInputBotInlineMessageID id {get;set;} - public TLAbsInputUser user_id {get;set;} - public int score {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - flags = 0; -flags = edit_message ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -edit_message = (flags & 1) != 0; -id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -score = br.ReadInt32(); - + edit_message = (flags & 1) != 0; + id = (TLInputBotInlineMessageID) ObjectUtils.DeserializeObject(br); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + score = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(id,bw); -ObjectUtils.SerializeObject(user_id,bw); -bw.Write(score); + bw.Write(flags); + ObjectUtils.SerializeObject(id, bw); + ObjectUtils.SerializeObject(user_id, bw); + bw.Write(score); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs b/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs index c8a09bc..babe622 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1551737264)] + [TLObject(-1551737264)] public class TLRequestSetTyping : TLMethod { - public override int Constructor + public override int Constructor => -1551737264; + + public TLAbsInputPeer peer { get; set; } + public TLAbsSendMessageAction action { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1551737264; - } } - public TLAbsInputPeer peer {get;set;} - public TLAbsSendMessageAction action {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -action = (TLAbsSendMessageAction)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + action = (TLAbsSendMessageAction) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(action,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(action, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs b/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs index ef96a70..34d4d7f 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-421563528)] + [TLObject(-421563528)] public class TLRequestStartBot : TLMethod { - public override int Constructor + public override int Constructor => -421563528; + + public TLAbsInputUser bot { get; set; } + public TLAbsInputPeer peer { get; set; } + public long random_id { get; set; } + public string start_param { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -421563528; - } } - public TLAbsInputUser bot {get;set;} - public TLAbsInputPeer peer {get;set;} - public long random_id {get;set;} - public string start_param {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - bot = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); -random_id = br.ReadInt64(); -start_param = StringUtil.Deserialize(br); - + bot = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); + random_id = br.ReadInt64(); + start_param = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(bot,bw); -ObjectUtils.SerializeObject(peer,bw); -bw.Write(random_id); -StringUtil.Serialize(start_param,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(bot, bw); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(random_id); + StringUtil.Serialize(start_param, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs b/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs index 53ac0a2..a6e8516 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-326379039)] + [TLObject(-326379039)] public class TLRequestToggleChatAdmins : TLMethod { - public override int Constructor + public override int Constructor => -326379039; + + public int chat_id { get; set; } + public bool enabled { get; set; } + public TLAbsUpdates Response { get; set; } + + + public void ComputeFlags() { - get - { - return -326379039; - } } - public int chat_id {get;set;} - public bool enabled {get;set;} - public TLAbsUpdates Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -enabled = BoolUtil.Deserialize(br); - + enabled = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -BoolUtil.Serialize(enabled,bw); - + BoolUtil.Serialize(enabled, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs b/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs index db4a7ab..98f6273 100644 --- a/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs +++ b/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-110209570)] + [TLObject(-110209570)] public class TLRequestUninstallStickerSet : TLMethod { - public override int Constructor + public override int Constructor => -110209570; + + public TLAbsInputStickerSet stickerset { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -110209570; - } } - public TLAbsInputStickerSet stickerset {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); - + stickerset = (TLAbsInputStickerSet) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(stickerset,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(stickerset, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLSavedGifs.cs b/TeleSharp.TL/TL/Messages/TLSavedGifs.cs index db34e4b..fb8c1f6 100644 --- a/TeleSharp.TL/TL/Messages/TLSavedGifs.cs +++ b/TeleSharp.TL/TL/Messages/TLSavedGifs.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(772213157)] + [TLObject(772213157)] public class TLSavedGifs : TLAbsSavedGifs { - public override int Constructor + public override int Constructor => 772213157; + + public int hash { get; set; } + public TLVector gifs { get; set; } + + + public void ComputeFlags() { - get - { - return 772213157; - } } - public int hash {get;set;} - public TLVector gifs {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt32(); -gifs = (TLVector)ObjectUtils.DeserializeVector(br); - + gifs = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(hash); -ObjectUtils.SerializeObject(gifs,bw); - + ObjectUtils.SerializeObject(gifs, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs b/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs index 538d1e9..483ae07 100644 --- a/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs +++ b/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-402498398)] + [TLObject(-402498398)] public class TLSavedGifsNotModified : TLAbsSavedGifs { - public override int Constructor + public override int Constructor => -402498398; + + + public void ComputeFlags() { - get - { - return -402498398; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs b/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs index 911c4d2..e14d3c4 100644 --- a/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs +++ b/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1802240206)] + [TLObject(-1802240206)] public class TLSentEncryptedFile : TLAbsSentEncryptedMessage { - public override int Constructor + public override int Constructor => -1802240206; + + public int date { get; set; } + public TLAbsEncryptedFile file { get; set; } + + + public void ComputeFlags() { - get - { - return -1802240206; - } } - public int date {get;set;} - public TLAbsEncryptedFile file {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { date = br.ReadInt32(); -file = (TLAbsEncryptedFile)ObjectUtils.DeserializeObject(br); - + file = (TLAbsEncryptedFile) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(date); -ObjectUtils.SerializeObject(file,bw); - + ObjectUtils.SerializeObject(file, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs b/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs index 351d7b1..b0a4cd6 100644 --- a/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs +++ b/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(1443858741)] + [TLObject(1443858741)] public class TLSentEncryptedMessage : TLAbsSentEncryptedMessage { - public override int Constructor + public override int Constructor => 1443858741; + + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return 1443858741; - } } - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(date); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLStickerSet.cs b/TeleSharp.TL/TL/Messages/TLStickerSet.cs index 8bbb9ba..d2be771 100644 --- a/TeleSharp.TL/TL/Messages/TLStickerSet.cs +++ b/TeleSharp.TL/TL/Messages/TLStickerSet.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1240849242)] + [TLObject(-1240849242)] public class TLStickerSet : TLObject { - public override int Constructor + public override int Constructor => -1240849242; + + public TLStickerSet set { get; set; } + public TLVector packs { get; set; } + public TLVector documents { get; set; } + + + public void ComputeFlags() { - get - { - return -1240849242; - } } - public TLStickerSet @set {get;set;} - public TLVector packs {get;set;} - public TLVector documents {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - @set = (TLStickerSet)ObjectUtils.DeserializeObject(br); -packs = (TLVector)ObjectUtils.DeserializeVector(br); -documents = (TLVector)ObjectUtils.DeserializeVector(br); - + set = (TLStickerSet) ObjectUtils.DeserializeObject(br); + packs = ObjectUtils.DeserializeVector(br); + documents = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(@set,bw); -ObjectUtils.SerializeObject(packs,bw); -ObjectUtils.SerializeObject(documents,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(set, bw); + ObjectUtils.SerializeObject(packs, bw); + ObjectUtils.SerializeObject(documents, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs b/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs index 509f830..8706ac4 100644 --- a/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs +++ b/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(904138920)] + [TLObject(904138920)] public class TLStickerSetInstallResultArchive : TLAbsStickerSetInstallResult { - public override int Constructor + public override int Constructor => 904138920; + + public TLVector sets { get; set; } + + + public void ComputeFlags() { - get - { - return 904138920; - } } - public TLVector sets {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - sets = (TLVector)ObjectUtils.DeserializeVector(br); - + sets = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(sets,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(sets, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs b/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs index 667bfdd..16c882d 100644 --- a/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs +++ b/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(946083368)] + [TLObject(946083368)] public class TLStickerSetInstallResultSuccess : TLAbsStickerSetInstallResult { - public override int Constructor + public override int Constructor => 946083368; + + + public void ComputeFlags() { - get - { - return 946083368; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLStickers.cs b/TeleSharp.TL/TL/Messages/TLStickers.cs index 258db29..97e2f4b 100644 --- a/TeleSharp.TL/TL/Messages/TLStickers.cs +++ b/TeleSharp.TL/TL/Messages/TLStickers.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-1970352846)] + [TLObject(-1970352846)] public class TLStickers : TLAbsStickers { - public override int Constructor + public override int Constructor => -1970352846; + + public string hash { get; set; } + public TLVector stickers { get; set; } + + + public void ComputeFlags() { - get - { - return -1970352846; - } } - public string hash {get;set;} - public TLVector stickers {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { hash = StringUtil.Deserialize(br); -stickers = (TLVector)ObjectUtils.DeserializeVector(br); - + stickers = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(hash,bw); -ObjectUtils.SerializeObject(stickers,bw); - + bw.Write(Constructor); + StringUtil.Serialize(hash, bw); + ObjectUtils.SerializeObject(stickers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs b/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs index 31471f1..7fdad83 100644 --- a/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs +++ b/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Messages { - [TLObject(-244016606)] + [TLObject(-244016606)] public class TLStickersNotModified : TLAbsStickers { - public override int Constructor + public override int Constructor => -244016606; + + + public void ComputeFlags() { - get - { - return -244016606; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs b/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs index ca753a6..e1b8b0a 100644 --- a/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs +++ b/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Photos { public abstract class TLAbsPhotos : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLPhoto.cs b/TeleSharp.TL/TL/Photos/TLPhoto.cs index 4a76a07..9b1d6e6 100644 --- a/TeleSharp.TL/TL/Photos/TLPhoto.cs +++ b/TeleSharp.TL/TL/Photos/TLPhoto.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(539045032)] + [TLObject(539045032)] public class TLPhoto : TLObject { - public override int Constructor + public override int Constructor => 539045032; + + public TLAbsPhoto photo { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 539045032; - } } - public TLAbsPhoto photo {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(photo,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(photo, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLPhotos.cs b/TeleSharp.TL/TL/Photos/TLPhotos.cs index a3374db..edc0557 100644 --- a/TeleSharp.TL/TL/Photos/TLPhotos.cs +++ b/TeleSharp.TL/TL/Photos/TLPhotos.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(-1916114267)] + [TLObject(-1916114267)] public class TLPhotos : TLAbsPhotos { - public override int Constructor + public override int Constructor => -1916114267; + + public TLVector photos { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1916114267; - } } - public TLVector photos {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - photos = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + photos = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(photos,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(photos, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs b/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs index 4587848..9993c2b 100644 --- a/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs +++ b/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(352657236)] + [TLObject(352657236)] public class TLPhotosSlice : TLAbsPhotos { - public override int Constructor + public override int Constructor => 352657236; + + public int count { get; set; } + public TLVector photos { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 352657236; - } } - public int count {get;set;} - public TLVector photos {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { count = br.ReadInt32(); -photos = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + photos = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(count); -ObjectUtils.SerializeObject(photos,bw); -ObjectUtils.SerializeObject(users,bw); - + ObjectUtils.SerializeObject(photos, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs b/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs index 08420e0..4aac279 100644 --- a/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs +++ b/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(-2016444625)] + [TLObject(-2016444625)] public class TLRequestDeletePhotos : TLMethod { - public override int Constructor + public override int Constructor => -2016444625; + + public TLVector id { get; set; } + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return -2016444625; - } } - public TLVector id {get;set;} - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs b/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs index af8f46d..cd57d2f 100644 --- a/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs +++ b/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(-1848823128)] + [TLObject(-1848823128)] public class TLRequestGetUserPhotos : TLMethod { - public override int Constructor + public override int Constructor => -1848823128; + + public TLAbsInputUser user_id { get; set; } + public int offset { get; set; } + public long max_id { get; set; } + public int limit { get; set; } + public TLAbsPhotos Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1848823128; - } } - public TLAbsInputUser user_id {get;set;} - public int offset {get;set;} - public long max_id {get;set;} - public int limit {get;set;} - public Photos.TLAbsPhotos Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -offset = br.ReadInt32(); -max_id = br.ReadInt64(); -limit = br.ReadInt32(); - + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + offset = br.ReadInt32(); + max_id = br.ReadInt64(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(user_id,bw); -bw.Write(offset); -bw.Write(max_id); -bw.Write(limit); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(user_id, bw); + bw.Write(offset); + bw.Write(max_id); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Photos.TLAbsPhotos)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsPhotos) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs b/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs index 521d4e7..f70c51d 100644 --- a/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs +++ b/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(-256159406)] + [TLObject(-256159406)] public class TLRequestUpdateProfilePhoto : TLMethod { - public override int Constructor + public override int Constructor => -256159406; + + public TLAbsInputPhoto id { get; set; } + public TLAbsUserProfilePhoto Response { get; set; } + + + public void ComputeFlags() { - get - { - return -256159406; - } } - public TLAbsInputPhoto id {get;set;} - public TLAbsUserProfilePhoto Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputPhoto) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsUserProfilePhoto) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs b/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs index 4693789..31a6a7d 100644 --- a/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs +++ b/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Photos { - [TLObject(1328726168)] + [TLObject(1328726168)] public class TLRequestUploadProfilePhoto : TLMethod { - public override int Constructor + public override int Constructor => 1328726168; + + public TLAbsInputFile file { get; set; } + public TLPhoto Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1328726168; - } } - public TLAbsInputFile file {get;set;} - public Photos.TLPhoto Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - file = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); - + file = (TLAbsInputFile) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(file,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(file, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Photos.TLPhoto)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLPhoto) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLAbsFileType.cs b/TeleSharp.TL/TL/Storage/TLAbsFileType.cs index 958a25e..8d15156 100644 --- a/TeleSharp.TL/TL/Storage/TLAbsFileType.cs +++ b/TeleSharp.TL/TL/Storage/TLAbsFileType.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Storage { public abstract class TLAbsFileType : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileGif.cs b/TeleSharp.TL/TL/Storage/TLFileGif.cs index fdb3ca0..2a8f764 100644 --- a/TeleSharp.TL/TL/Storage/TLFileGif.cs +++ b/TeleSharp.TL/TL/Storage/TLFileGif.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(-891180321)] + [TLObject(-891180321)] public class TLFileGif : TLAbsFileType { - public override int Constructor + public override int Constructor => -891180321; + + + public void ComputeFlags() { - get - { - return -891180321; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileJpeg.cs b/TeleSharp.TL/TL/Storage/TLFileJpeg.cs index 8823b85..b2cb3ad 100644 --- a/TeleSharp.TL/TL/Storage/TLFileJpeg.cs +++ b/TeleSharp.TL/TL/Storage/TLFileJpeg.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(8322574)] + [TLObject(8322574)] public class TLFileJpeg : TLAbsFileType { - public override int Constructor + public override int Constructor => 8322574; + + + public void ComputeFlags() { - get - { - return 8322574; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileMov.cs b/TeleSharp.TL/TL/Storage/TLFileMov.cs index 6a161ee..66e78b4 100644 --- a/TeleSharp.TL/TL/Storage/TLFileMov.cs +++ b/TeleSharp.TL/TL/Storage/TLFileMov.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(1258941372)] + [TLObject(1258941372)] public class TLFileMov : TLAbsFileType { - public override int Constructor + public override int Constructor => 1258941372; + + + public void ComputeFlags() { - get - { - return 1258941372; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileMp3.cs b/TeleSharp.TL/TL/Storage/TLFileMp3.cs index 8e735dd..3c60317 100644 --- a/TeleSharp.TL/TL/Storage/TLFileMp3.cs +++ b/TeleSharp.TL/TL/Storage/TLFileMp3.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(1384777335)] + [TLObject(1384777335)] public class TLFileMp3 : TLAbsFileType { - public override int Constructor + public override int Constructor => 1384777335; + + + public void ComputeFlags() { - get - { - return 1384777335; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileMp4.cs b/TeleSharp.TL/TL/Storage/TLFileMp4.cs index d556556..25e285c 100644 --- a/TeleSharp.TL/TL/Storage/TLFileMp4.cs +++ b/TeleSharp.TL/TL/Storage/TLFileMp4.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(-1278304028)] + [TLObject(-1278304028)] public class TLFileMp4 : TLAbsFileType { - public override int Constructor + public override int Constructor => -1278304028; + + + public void ComputeFlags() { - get - { - return -1278304028; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFilePartial.cs b/TeleSharp.TL/TL/Storage/TLFilePartial.cs index 96a47b9..aae6e3a 100644 --- a/TeleSharp.TL/TL/Storage/TLFilePartial.cs +++ b/TeleSharp.TL/TL/Storage/TLFilePartial.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(1086091090)] + [TLObject(1086091090)] public class TLFilePartial : TLAbsFileType { - public override int Constructor + public override int Constructor => 1086091090; + + + public void ComputeFlags() { - get - { - return 1086091090; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFilePdf.cs b/TeleSharp.TL/TL/Storage/TLFilePdf.cs index 64af009..a3fd849 100644 --- a/TeleSharp.TL/TL/Storage/TLFilePdf.cs +++ b/TeleSharp.TL/TL/Storage/TLFilePdf.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(-1373745011)] + [TLObject(-1373745011)] public class TLFilePdf : TLAbsFileType { - public override int Constructor + public override int Constructor => -1373745011; + + + public void ComputeFlags() { - get - { - return -1373745011; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFilePng.cs b/TeleSharp.TL/TL/Storage/TLFilePng.cs index 9a1a57c..47bc9f3 100644 --- a/TeleSharp.TL/TL/Storage/TLFilePng.cs +++ b/TeleSharp.TL/TL/Storage/TLFilePng.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(172975040)] + [TLObject(172975040)] public class TLFilePng : TLAbsFileType { - public override int Constructor + public override int Constructor => 172975040; + + + public void ComputeFlags() { - get - { - return 172975040; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileUnknown.cs b/TeleSharp.TL/TL/Storage/TLFileUnknown.cs index 3cdf279..d6036ca 100644 --- a/TeleSharp.TL/TL/Storage/TLFileUnknown.cs +++ b/TeleSharp.TL/TL/Storage/TLFileUnknown.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(-1432995067)] + [TLObject(-1432995067)] public class TLFileUnknown : TLAbsFileType { - public override int Constructor + public override int Constructor => -1432995067; + + + public void ComputeFlags() { - get - { - return -1432995067; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Storage/TLFileWebp.cs b/TeleSharp.TL/TL/Storage/TLFileWebp.cs index df81b09..c5f8ee5 100644 --- a/TeleSharp.TL/TL/Storage/TLFileWebp.cs +++ b/TeleSharp.TL/TL/Storage/TLFileWebp.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Storage { - [TLObject(276907596)] + [TLObject(276907596)] public class TLFileWebp : TLAbsFileType { - public override int Constructor + public override int Constructor => 276907596; + + + public void ComputeFlags() { - get - { - return 276907596; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsBool.cs b/TeleSharp.TL/TL/TLAbsBool.cs index afa7d6c..26b9311 100644 --- a/TeleSharp.TL/TL/TLAbsBool.cs +++ b/TeleSharp.TL/TL/TLAbsBool.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsBool : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs b/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs index 8b54131..b7e5de0 100644 --- a/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs +++ b/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsBotInlineMessage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsBotInlineResult.cs b/TeleSharp.TL/TL/TLAbsBotInlineResult.cs index 841a0fa..fff1265 100644 --- a/TeleSharp.TL/TL/TLAbsBotInlineResult.cs +++ b/TeleSharp.TL/TL/TLAbsBotInlineResult.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsBotInlineResult : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs b/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs index e754290..b3aa190 100644 --- a/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs +++ b/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChannelMessagesFilter : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChannelParticipant.cs b/TeleSharp.TL/TL/TLAbsChannelParticipant.cs index 552ef91..1896c68 100644 --- a/TeleSharp.TL/TL/TLAbsChannelParticipant.cs +++ b/TeleSharp.TL/TL/TLAbsChannelParticipant.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChannelParticipant : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs b/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs index c162b88..1fe1e5b 100644 --- a/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs +++ b/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChannelParticipantRole : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs b/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs index afee66d..d2aa540 100644 --- a/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs +++ b/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChannelParticipantsFilter : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChat.cs b/TeleSharp.TL/TL/TLAbsChat.cs index aa92fc0..ce7ba30 100644 --- a/TeleSharp.TL/TL/TLAbsChat.cs +++ b/TeleSharp.TL/TL/TLAbsChat.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChat : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChatFull.cs b/TeleSharp.TL/TL/TLAbsChatFull.cs index ef596c7..4add016 100644 --- a/TeleSharp.TL/TL/TLAbsChatFull.cs +++ b/TeleSharp.TL/TL/TLAbsChatFull.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChatFull : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChatInvite.cs b/TeleSharp.TL/TL/TLAbsChatInvite.cs index 64ff7dd..970efb3 100644 --- a/TeleSharp.TL/TL/TLAbsChatInvite.cs +++ b/TeleSharp.TL/TL/TLAbsChatInvite.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChatInvite : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChatParticipant.cs b/TeleSharp.TL/TL/TLAbsChatParticipant.cs index 598365a..958f7aa 100644 --- a/TeleSharp.TL/TL/TLAbsChatParticipant.cs +++ b/TeleSharp.TL/TL/TLAbsChatParticipant.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChatParticipant : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChatParticipants.cs b/TeleSharp.TL/TL/TLAbsChatParticipants.cs index 246eea2..b7807af 100644 --- a/TeleSharp.TL/TL/TLAbsChatParticipants.cs +++ b/TeleSharp.TL/TL/TLAbsChatParticipants.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChatParticipants : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsChatPhoto.cs b/TeleSharp.TL/TL/TLAbsChatPhoto.cs index b210308..5239de0 100644 --- a/TeleSharp.TL/TL/TLAbsChatPhoto.cs +++ b/TeleSharp.TL/TL/TLAbsChatPhoto.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsChatPhoto : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsContactLink.cs b/TeleSharp.TL/TL/TLAbsContactLink.cs index 096f1cf..ef83ea1 100644 --- a/TeleSharp.TL/TL/TLAbsContactLink.cs +++ b/TeleSharp.TL/TL/TLAbsContactLink.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsContactLink : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsDocument.cs b/TeleSharp.TL/TL/TLAbsDocument.cs index d60b4a8..fd5a7dc 100644 --- a/TeleSharp.TL/TL/TLAbsDocument.cs +++ b/TeleSharp.TL/TL/TLAbsDocument.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsDocument : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs b/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs index 8fd333d..5f0b1e8 100644 --- a/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs +++ b/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsDocumentAttribute : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsDraftMessage.cs b/TeleSharp.TL/TL/TLAbsDraftMessage.cs index 1f73bba..efcdffe 100644 --- a/TeleSharp.TL/TL/TLAbsDraftMessage.cs +++ b/TeleSharp.TL/TL/TLAbsDraftMessage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsDraftMessage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsEncryptedChat.cs b/TeleSharp.TL/TL/TLAbsEncryptedChat.cs index e64f973..5cad366 100644 --- a/TeleSharp.TL/TL/TLAbsEncryptedChat.cs +++ b/TeleSharp.TL/TL/TLAbsEncryptedChat.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsEncryptedChat : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsEncryptedFile.cs b/TeleSharp.TL/TL/TLAbsEncryptedFile.cs index 5ada68d..03e698e 100644 --- a/TeleSharp.TL/TL/TLAbsEncryptedFile.cs +++ b/TeleSharp.TL/TL/TLAbsEncryptedFile.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsEncryptedFile : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs b/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs index bd37fe4..f67ca7b 100644 --- a/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs +++ b/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsEncryptedMessage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs b/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs index 572ee11..05c2109 100644 --- a/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs +++ b/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsExportedChatInvite : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsFileLocation.cs b/TeleSharp.TL/TL/TLAbsFileLocation.cs index c813e5e..0b9f105 100644 --- a/TeleSharp.TL/TL/TLAbsFileLocation.cs +++ b/TeleSharp.TL/TL/TLAbsFileLocation.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsFileLocation : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsFoundGif.cs b/TeleSharp.TL/TL/TLAbsFoundGif.cs index 7fc1df8..e5d1a87 100644 --- a/TeleSharp.TL/TL/TLAbsFoundGif.cs +++ b/TeleSharp.TL/TL/TLAbsFoundGif.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsFoundGif : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsGeoPoint.cs b/TeleSharp.TL/TL/TLAbsGeoPoint.cs index 935339f..4960f50 100644 --- a/TeleSharp.TL/TL/TLAbsGeoPoint.cs +++ b/TeleSharp.TL/TL/TLAbsGeoPoint.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsGeoPoint : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs b/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs index 015e1a0..b08b9ca 100644 --- a/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs +++ b/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputBotInlineMessage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs b/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs index 9e4fb99..8d41f3c 100644 --- a/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs +++ b/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputBotInlineResult : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputChannel.cs b/TeleSharp.TL/TL/TLAbsInputChannel.cs index e84f4f7..3335fb2 100644 --- a/TeleSharp.TL/TL/TLAbsInputChannel.cs +++ b/TeleSharp.TL/TL/TLAbsInputChannel.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputChannel : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs b/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs index bf8800a..c7abff6 100644 --- a/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs +++ b/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputChatPhoto : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputDocument.cs b/TeleSharp.TL/TL/TLAbsInputDocument.cs index e49097e..55ceae0 100644 --- a/TeleSharp.TL/TL/TLAbsInputDocument.cs +++ b/TeleSharp.TL/TL/TLAbsInputDocument.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputDocument : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs b/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs index 2567011..d23015e 100644 --- a/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs +++ b/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputEncryptedFile : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputFile.cs b/TeleSharp.TL/TL/TLAbsInputFile.cs index 0f8adc3..b0489f1 100644 --- a/TeleSharp.TL/TL/TLAbsInputFile.cs +++ b/TeleSharp.TL/TL/TLAbsInputFile.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputFile : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputFileLocation.cs b/TeleSharp.TL/TL/TLAbsInputFileLocation.cs index b67f3e8..02f6906 100644 --- a/TeleSharp.TL/TL/TLAbsInputFileLocation.cs +++ b/TeleSharp.TL/TL/TLAbsInputFileLocation.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputFileLocation : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputGame.cs b/TeleSharp.TL/TL/TLAbsInputGame.cs index 16334de..746f67d 100644 --- a/TeleSharp.TL/TL/TLAbsInputGame.cs +++ b/TeleSharp.TL/TL/TLAbsInputGame.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputGame : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs b/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs index 2e3d1f5..7052b63 100644 --- a/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs +++ b/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputGeoPoint : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputMedia.cs b/TeleSharp.TL/TL/TLAbsInputMedia.cs index 34ed3a7..914076c 100644 --- a/TeleSharp.TL/TL/TLAbsInputMedia.cs +++ b/TeleSharp.TL/TL/TLAbsInputMedia.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputMedia : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs b/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs index 23dd812..7776ba3 100644 --- a/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs +++ b/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputNotifyPeer : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputPeer.cs b/TeleSharp.TL/TL/TLAbsInputPeer.cs index 24845d2..2c339d5 100644 --- a/TeleSharp.TL/TL/TLAbsInputPeer.cs +++ b/TeleSharp.TL/TL/TLAbsInputPeer.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputPeer : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs b/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs index 7266e4f..e19cfc8 100644 --- a/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs +++ b/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputPeerNotifyEvents : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputPhoto.cs b/TeleSharp.TL/TL/TLAbsInputPhoto.cs index dbeaed0..760970e 100644 --- a/TeleSharp.TL/TL/TLAbsInputPhoto.cs +++ b/TeleSharp.TL/TL/TLAbsInputPhoto.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputPhoto : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs b/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs index 21b7943..b6d434b 100644 --- a/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs +++ b/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputPrivacyKey : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs b/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs index bc89964..32b62db 100644 --- a/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs +++ b/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputPrivacyRule : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputStickerSet.cs b/TeleSharp.TL/TL/TLAbsInputStickerSet.cs index 7578ef1..3da4053 100644 --- a/TeleSharp.TL/TL/TLAbsInputStickerSet.cs +++ b/TeleSharp.TL/TL/TLAbsInputStickerSet.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputStickerSet : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs b/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs index 23d182d..608a4b6 100644 --- a/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs +++ b/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputStickeredMedia : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsInputUser.cs b/TeleSharp.TL/TL/TLAbsInputUser.cs index 70ec16b..1a0dee5 100644 --- a/TeleSharp.TL/TL/TLAbsInputUser.cs +++ b/TeleSharp.TL/TL/TLAbsInputUser.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsInputUser : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsKeyboardButton.cs b/TeleSharp.TL/TL/TLAbsKeyboardButton.cs index 4760b4f..cdc89ab 100644 --- a/TeleSharp.TL/TL/TLAbsKeyboardButton.cs +++ b/TeleSharp.TL/TL/TLAbsKeyboardButton.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsKeyboardButton : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsMessage.cs b/TeleSharp.TL/TL/TLAbsMessage.cs index 8f0ed6e..46d3210 100644 --- a/TeleSharp.TL/TL/TLAbsMessage.cs +++ b/TeleSharp.TL/TL/TLAbsMessage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsMessage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsMessageAction.cs b/TeleSharp.TL/TL/TLAbsMessageAction.cs index d231272..5e99299 100644 --- a/TeleSharp.TL/TL/TLAbsMessageAction.cs +++ b/TeleSharp.TL/TL/TLAbsMessageAction.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsMessageAction : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsMessageEntity.cs b/TeleSharp.TL/TL/TLAbsMessageEntity.cs index d892621..2ae0503 100644 --- a/TeleSharp.TL/TL/TLAbsMessageEntity.cs +++ b/TeleSharp.TL/TL/TLAbsMessageEntity.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsMessageEntity : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsMessageMedia.cs b/TeleSharp.TL/TL/TLAbsMessageMedia.cs index 7b8bebc..7cbe1d5 100644 --- a/TeleSharp.TL/TL/TLAbsMessageMedia.cs +++ b/TeleSharp.TL/TL/TLAbsMessageMedia.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsMessageMedia : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsMessagesFilter.cs b/TeleSharp.TL/TL/TLAbsMessagesFilter.cs index f89e670..a74c628 100644 --- a/TeleSharp.TL/TL/TLAbsMessagesFilter.cs +++ b/TeleSharp.TL/TL/TLAbsMessagesFilter.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsMessagesFilter : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsNotifyPeer.cs b/TeleSharp.TL/TL/TLAbsNotifyPeer.cs index 76e3bc4..5003ff4 100644 --- a/TeleSharp.TL/TL/TLAbsNotifyPeer.cs +++ b/TeleSharp.TL/TL/TLAbsNotifyPeer.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsNotifyPeer : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPeer.cs b/TeleSharp.TL/TL/TLAbsPeer.cs index 914dc83..a6bc5eb 100644 --- a/TeleSharp.TL/TL/TLAbsPeer.cs +++ b/TeleSharp.TL/TL/TLAbsPeer.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPeer : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs b/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs index b0df9f6..04268e8 100644 --- a/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs +++ b/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPeerNotifyEvents : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs b/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs index 57c5087..5499b97 100644 --- a/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs +++ b/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPeerNotifySettings : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPhoto.cs b/TeleSharp.TL/TL/TLAbsPhoto.cs index 4dd7e31..e4d3821 100644 --- a/TeleSharp.TL/TL/TLAbsPhoto.cs +++ b/TeleSharp.TL/TL/TLAbsPhoto.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPhoto : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPhotoSize.cs b/TeleSharp.TL/TL/TLAbsPhotoSize.cs index 7038129..6bd572a 100644 --- a/TeleSharp.TL/TL/TLAbsPhotoSize.cs +++ b/TeleSharp.TL/TL/TLAbsPhotoSize.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPhotoSize : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPrivacyKey.cs b/TeleSharp.TL/TL/TLAbsPrivacyKey.cs index 1885650..e223ad8 100644 --- a/TeleSharp.TL/TL/TLAbsPrivacyKey.cs +++ b/TeleSharp.TL/TL/TLAbsPrivacyKey.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPrivacyKey : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsPrivacyRule.cs b/TeleSharp.TL/TL/TLAbsPrivacyRule.cs index f015088..72bf716 100644 --- a/TeleSharp.TL/TL/TLAbsPrivacyRule.cs +++ b/TeleSharp.TL/TL/TLAbsPrivacyRule.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsPrivacyRule : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsReplyMarkup.cs b/TeleSharp.TL/TL/TLAbsReplyMarkup.cs index f7c3be0..552abb1 100644 --- a/TeleSharp.TL/TL/TLAbsReplyMarkup.cs +++ b/TeleSharp.TL/TL/TLAbsReplyMarkup.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsReplyMarkup : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsReportReason.cs b/TeleSharp.TL/TL/TLAbsReportReason.cs index 87add4b..a845952 100644 --- a/TeleSharp.TL/TL/TLAbsReportReason.cs +++ b/TeleSharp.TL/TL/TLAbsReportReason.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsReportReason : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsSendMessageAction.cs b/TeleSharp.TL/TL/TLAbsSendMessageAction.cs index edcc8ed..56fefc1 100644 --- a/TeleSharp.TL/TL/TLAbsSendMessageAction.cs +++ b/TeleSharp.TL/TL/TLAbsSendMessageAction.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsSendMessageAction : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs b/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs index 2a558fb..c79345a 100644 --- a/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs +++ b/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsStickerSetCovered : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs b/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs index 0bf8f11..766b2da 100644 --- a/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs +++ b/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsTopPeerCategory : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsUpdate.cs b/TeleSharp.TL/TL/TLAbsUpdate.cs index 6f71cc3..270ef0f 100644 --- a/TeleSharp.TL/TL/TLAbsUpdate.cs +++ b/TeleSharp.TL/TL/TLAbsUpdate.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsUpdate : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsUpdates.cs b/TeleSharp.TL/TL/TLAbsUpdates.cs index 9653aa9..2f0657d 100644 --- a/TeleSharp.TL/TL/TLAbsUpdates.cs +++ b/TeleSharp.TL/TL/TLAbsUpdates.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsUpdates : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsUser.cs b/TeleSharp.TL/TL/TLAbsUser.cs index b9dcb61..ae1aded 100644 --- a/TeleSharp.TL/TL/TLAbsUser.cs +++ b/TeleSharp.TL/TL/TLAbsUser.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsUser : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs b/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs index c3c9e05..0728f72 100644 --- a/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs +++ b/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsUserProfilePhoto : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsUserStatus.cs b/TeleSharp.TL/TL/TLAbsUserStatus.cs index 21ef437..93795de 100644 --- a/TeleSharp.TL/TL/TLAbsUserStatus.cs +++ b/TeleSharp.TL/TL/TLAbsUserStatus.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsUserStatus : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsWallPaper.cs b/TeleSharp.TL/TL/TLAbsWallPaper.cs index a67e4e0..3d0b9a5 100644 --- a/TeleSharp.TL/TL/TLAbsWallPaper.cs +++ b/TeleSharp.TL/TL/TLAbsWallPaper.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsWallPaper : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAbsWebPage.cs b/TeleSharp.TL/TL/TLAbsWebPage.cs index 1433c52..972d36a 100644 --- a/TeleSharp.TL/TL/TLAbsWebPage.cs +++ b/TeleSharp.TL/TL/TLAbsWebPage.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLAbsWebPage : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAccountDaysTTL.cs b/TeleSharp.TL/TL/TLAccountDaysTTL.cs index 8ffd827..1f79b26 100644 --- a/TeleSharp.TL/TL/TLAccountDaysTTL.cs +++ b/TeleSharp.TL/TL/TLAccountDaysTTL.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1194283041)] + [TLObject(-1194283041)] public class TLAccountDaysTTL : TLObject { - public override int Constructor + public override int Constructor => -1194283041; + + public int days { get; set; } + + + public void ComputeFlags() { - get - { - return -1194283041; - } } - public int days {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { days = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(days); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLAuthorization.cs b/TeleSharp.TL/TL/TLAuthorization.cs index 2d47508..8cfa25e 100644 --- a/TeleSharp.TL/TL/TLAuthorization.cs +++ b/TeleSharp.TL/TL/TLAuthorization.cs @@ -1,80 +1,66 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2079516406)] + [TLObject(2079516406)] public class TLAuthorization : TLObject { - public override int Constructor + public override int Constructor => 2079516406; + + public long hash { get; set; } + public int flags { get; set; } + public string device_model { get; set; } + public string platform { get; set; } + public string system_version { get; set; } + public int api_id { get; set; } + public string app_name { get; set; } + public string app_version { get; set; } + public int date_created { get; set; } + public int date_active { get; set; } + public string ip { get; set; } + public string country { get; set; } + public string region { get; set; } + + + public void ComputeFlags() { - get - { - return 2079516406; - } + flags = 0; } - public long hash {get;set;} - public int flags {get;set;} - public string device_model {get;set;} - public string platform {get;set;} - public string system_version {get;set;} - public int api_id {get;set;} - public string app_name {get;set;} - public string app_version {get;set;} - public int date_created {get;set;} - public int date_active {get;set;} - public string ip {get;set;} - public string country {get;set;} - public string region {get;set;} - - - public void ComputeFlags() - { - flags = 0; - - } - public override void DeserializeBody(BinaryReader br) { hash = br.ReadInt64(); -flags = br.ReadInt32(); -device_model = StringUtil.Deserialize(br); -platform = StringUtil.Deserialize(br); -system_version = StringUtil.Deserialize(br); -api_id = br.ReadInt32(); -app_name = StringUtil.Deserialize(br); -app_version = StringUtil.Deserialize(br); -date_created = br.ReadInt32(); -date_active = br.ReadInt32(); -ip = StringUtil.Deserialize(br); -country = StringUtil.Deserialize(br); -region = StringUtil.Deserialize(br); - + flags = br.ReadInt32(); + device_model = StringUtil.Deserialize(br); + platform = StringUtil.Deserialize(br); + system_version = StringUtil.Deserialize(br); + api_id = br.ReadInt32(); + app_name = StringUtil.Deserialize(br); + app_version = StringUtil.Deserialize(br); + date_created = br.ReadInt32(); + date_active = br.ReadInt32(); + ip = StringUtil.Deserialize(br); + country = StringUtil.Deserialize(br); + region = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(hash); -StringUtil.Serialize(device_model,bw); -StringUtil.Serialize(platform,bw); -StringUtil.Serialize(system_version,bw); -bw.Write(api_id); -StringUtil.Serialize(app_name,bw); -StringUtil.Serialize(app_version,bw); -bw.Write(date_created); -bw.Write(date_active); -StringUtil.Serialize(ip,bw); -StringUtil.Serialize(country,bw); -StringUtil.Serialize(region,bw); - + bw.Write(flags); + bw.Write(hash); + StringUtil.Serialize(device_model, bw); + StringUtil.Serialize(platform, bw); + StringUtil.Serialize(system_version, bw); + bw.Write(api_id); + StringUtil.Serialize(app_name, bw); + StringUtil.Serialize(app_version, bw); + bw.Write(date_created); + bw.Write(date_active); + StringUtil.Serialize(ip, bw); + StringUtil.Serialize(country, bw); + StringUtil.Serialize(region, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBoolFalse.cs b/TeleSharp.TL/TL/TLBoolFalse.cs index 2799fea..3f694b9 100644 --- a/TeleSharp.TL/TL/TLBoolFalse.cs +++ b/TeleSharp.TL/TL/TLBoolFalse.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1132882121)] + [TLObject(-1132882121)] public class TLBoolFalse : TLAbsBool { - public override int Constructor + public override int Constructor => -1132882121; + + + public void ComputeFlags() { - get - { - return -1132882121; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBoolTrue.cs b/TeleSharp.TL/TL/TLBoolTrue.cs index 221d3ef..50f542d 100644 --- a/TeleSharp.TL/TL/TLBoolTrue.cs +++ b/TeleSharp.TL/TL/TLBoolTrue.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1720552011)] + [TLObject(-1720552011)] public class TLBoolTrue : TLAbsBool { - public override int Constructor + public override int Constructor => -1720552011; + + + public void ComputeFlags() { - get - { - return -1720552011; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotCommand.cs b/TeleSharp.TL/TL/TLBotCommand.cs index b68d75e..a5f548d 100644 --- a/TeleSharp.TL/TL/TLBotCommand.cs +++ b/TeleSharp.TL/TL/TLBotCommand.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1032140601)] + [TLObject(-1032140601)] public class TLBotCommand : TLObject { - public override int Constructor + public override int Constructor => -1032140601; + + public string command { get; set; } + public string description { get; set; } + + + public void ComputeFlags() { - get - { - return -1032140601; - } } - public string command {get;set;} - public string description {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { command = StringUtil.Deserialize(br); -description = StringUtil.Deserialize(br); - + description = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(command,bw); -StringUtil.Serialize(description,bw); - + bw.Write(Constructor); + StringUtil.Serialize(command, bw); + StringUtil.Serialize(description, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInfo.cs b/TeleSharp.TL/TL/TLBotInfo.cs index 4b0836e..8eca2a4 100644 --- a/TeleSharp.TL/TL/TLBotInfo.cs +++ b/TeleSharp.TL/TL/TLBotInfo.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1729618630)] + [TLObject(-1729618630)] public class TLBotInfo : TLObject { - public override int Constructor + public override int Constructor => -1729618630; + + public int user_id { get; set; } + public string description { get; set; } + public TLVector commands { get; set; } + + + public void ComputeFlags() { - get - { - return -1729618630; - } } - public int user_id {get;set;} - public string description {get;set;} - public TLVector commands {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -description = StringUtil.Deserialize(br); -commands = (TLVector)ObjectUtils.DeserializeVector(br); - + description = StringUtil.Deserialize(br); + commands = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -StringUtil.Serialize(description,bw); -ObjectUtils.SerializeObject(commands,bw); - + StringUtil.Serialize(description, bw); + ObjectUtils.SerializeObject(commands, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineMediaResult.cs b/TeleSharp.TL/TL/TLBotInlineMediaResult.cs index 530fd04..1d7caa0 100644 --- a/TeleSharp.TL/TL/TLBotInlineMediaResult.cs +++ b/TeleSharp.TL/TL/TLBotInlineMediaResult.cs @@ -1,89 +1,75 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(400266251)] + [TLObject(400266251)] public class TLBotInlineMediaResult : TLAbsBotInlineResult { - public override int Constructor + public override int Constructor => 400266251; + + public int flags { get; set; } + public string id { get; set; } + public string type { get; set; } + public TLAbsPhoto photo { get; set; } + public TLAbsDocument document { get; set; } + public string title { get; set; } + public string description { get; set; } + public TLAbsBotInlineMessage send_message { get; set; } + + + public void ComputeFlags() { - get - { - return 400266251; - } + flags = 0; + flags = photo != null ? flags | 1 : flags & ~1; + flags = document != null ? flags | 2 : flags & ~2; + flags = title != null ? flags | 4 : flags & ~4; + flags = description != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public string id {get;set;} - public string type {get;set;} - public TLAbsPhoto photo {get;set;} - public TLAbsDocument document {get;set;} - public string title {get;set;} - public string description {get;set;} - public TLAbsBotInlineMessage send_message {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = photo != null ? (flags | 1) : (flags & ~1); -flags = document != null ? (flags | 2) : (flags & ~2); -flags = title != null ? (flags | 4) : (flags & ~4); -flags = description != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -id = StringUtil.Deserialize(br); -type = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -else -photo = null; + id = StringUtil.Deserialize(br); + type = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + else + photo = null; -if ((flags & 2) != 0) -document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); -else -document = null; + if ((flags & 2) != 0) + document = (TLAbsDocument) ObjectUtils.DeserializeObject(br); + else + document = null; -if ((flags & 4) != 0) -title = StringUtil.Deserialize(br); -else -title = null; + if ((flags & 4) != 0) + title = StringUtil.Deserialize(br); + else + title = null; -if ((flags & 8) != 0) -description = StringUtil.Deserialize(br); -else -description = null; - -send_message = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br); + if ((flags & 8) != 0) + description = StringUtil.Deserialize(br); + else + description = null; + send_message = (TLAbsBotInlineMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(id,bw); -StringUtil.Serialize(type,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(photo,bw); -if ((flags & 2) != 0) -ObjectUtils.SerializeObject(document,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(title,bw); -if ((flags & 8) != 0) -StringUtil.Serialize(description,bw); -ObjectUtils.SerializeObject(send_message,bw); - + bw.Write(flags); + StringUtil.Serialize(id, bw); + StringUtil.Serialize(type, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(photo, bw); + if ((flags & 2) != 0) + ObjectUtils.SerializeObject(document, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(title, bw); + if ((flags & 8) != 0) + StringUtil.Serialize(description, bw); + ObjectUtils.SerializeObject(send_message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs b/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs index fbf782e..5afdb79 100644 --- a/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs +++ b/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs @@ -1,56 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(175419739)] + [TLObject(175419739)] public class TLBotInlineMessageMediaAuto : TLAbsBotInlineMessage { - public override int Constructor + public override int Constructor => 175419739; + + public int flags { get; set; } + public string caption { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 175419739; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public string caption {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -caption = StringUtil.Deserialize(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + caption = StringUtil.Deserialize(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(caption,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + StringUtil.Serialize(caption, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs b/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs index b7a8fcd..d6e6bb5 100644 --- a/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs +++ b/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs @@ -1,62 +1,47 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(904770772)] + [TLObject(904770772)] public class TLBotInlineMessageMediaContact : TLAbsBotInlineMessage { - public override int Constructor + public override int Constructor => 904770772; + + public int flags { get; set; } + public string phone_number { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 904770772; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public string phone_number {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -phone_number = StringUtil.Deserialize(br); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + phone_number = StringUtil.Deserialize(br); + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs b/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs index f8408ca..4a1aee0 100644 --- a/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs +++ b/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs @@ -1,56 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(982505656)] + [TLObject(982505656)] public class TLBotInlineMessageMediaGeo : TLAbsBotInlineMessage { - public override int Constructor + public override int Constructor => 982505656; + + public int flags { get; set; } + public TLAbsGeoPoint geo { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 982505656; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public TLAbsGeoPoint geo {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + geo = (TLAbsGeoPoint) ObjectUtils.DeserializeObject(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(geo,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(geo, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs b/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs index 413efae..f01b318 100644 --- a/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs +++ b/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs @@ -1,68 +1,53 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1130767150)] + [TLObject(1130767150)] public class TLBotInlineMessageMediaVenue : TLAbsBotInlineMessage { - public override int Constructor + public override int Constructor => 1130767150; + + public int flags { get; set; } + public TLAbsGeoPoint geo { get; set; } + public string title { get; set; } + public string address { get; set; } + public string provider { get; set; } + public string venue_id { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 1130767150; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public TLAbsGeoPoint geo {get;set;} - public string title {get;set;} - public string address {get;set;} - public string provider {get;set;} - public string venue_id {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); -title = StringUtil.Deserialize(br); -address = StringUtil.Deserialize(br); -provider = StringUtil.Deserialize(br); -venue_id = StringUtil.Deserialize(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + geo = (TLAbsGeoPoint) ObjectUtils.DeserializeObject(br); + title = StringUtil.Deserialize(br); + address = StringUtil.Deserialize(br); + provider = StringUtil.Deserialize(br); + venue_id = StringUtil.Deserialize(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(geo,bw); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(address,bw); -StringUtil.Serialize(provider,bw); -StringUtil.Serialize(venue_id,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(geo, bw); + StringUtil.Serialize(title, bw); + StringUtil.Serialize(address, bw); + StringUtil.Serialize(provider, bw); + StringUtil.Serialize(venue_id, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineMessageText.cs b/TeleSharp.TL/TL/TLBotInlineMessageText.cs index c9ba8ca..96beb22 100644 --- a/TeleSharp.TL/TL/TLBotInlineMessageText.cs +++ b/TeleSharp.TL/TL/TLBotInlineMessageText.cs @@ -1,69 +1,54 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1937807902)] + [TLObject(-1937807902)] public class TLBotInlineMessageText : TLAbsBotInlineMessage { - public override int Constructor + public override int Constructor => -1937807902; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public string message { get; set; } + public TLVector entities { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return -1937807902; - } + flags = 0; + flags = no_webpage ? flags | 1 : flags & ~1; + flags = entities != null ? flags | 2 : flags & ~2; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public string message {get;set;} - public TLVector entities {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 1) : (flags & ~1); -flags = entities != null ? (flags | 2) : (flags & ~2); -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 1) != 0; -message = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; - -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - + no_webpage = (flags & 1) != 0; + message = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(message,bw); -if ((flags & 2) != 0) -ObjectUtils.SerializeObject(entities,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); + bw.Write(flags); + StringUtil.Serialize(message, bw); + if ((flags & 2) != 0) + ObjectUtils.SerializeObject(entities, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLBotInlineResult.cs b/TeleSharp.TL/TL/TLBotInlineResult.cs index 5634f1a..da20737 100644 --- a/TeleSharp.TL/TL/TLBotInlineResult.cs +++ b/TeleSharp.TL/TL/TLBotInlineResult.cs @@ -1,134 +1,120 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1679053127)] + [TLObject(-1679053127)] public class TLBotInlineResult : TLAbsBotInlineResult { - public override int Constructor + public override int Constructor => -1679053127; + + public int flags { get; set; } + public string id { get; set; } + public string type { get; set; } + public string title { get; set; } + public string description { get; set; } + public string url { get; set; } + public string thumb_url { get; set; } + public string content_url { get; set; } + public string content_type { get; set; } + public int? w { get; set; } + public int? h { get; set; } + public int? duration { get; set; } + public TLAbsBotInlineMessage send_message { get; set; } + + + public void ComputeFlags() { - get - { - return -1679053127; - } + flags = 0; + flags = title != null ? flags | 2 : flags & ~2; + flags = description != null ? flags | 4 : flags & ~4; + flags = url != null ? flags | 8 : flags & ~8; + flags = thumb_url != null ? flags | 16 : flags & ~16; + flags = content_url != null ? flags | 32 : flags & ~32; + flags = content_type != null ? flags | 32 : flags & ~32; + flags = w != null ? flags | 64 : flags & ~64; + flags = h != null ? flags | 64 : flags & ~64; + flags = duration != null ? flags | 128 : flags & ~128; } - public int flags {get;set;} - public string id {get;set;} - public string type {get;set;} - public string title {get;set;} - public string description {get;set;} - public string url {get;set;} - public string thumb_url {get;set;} - public string content_url {get;set;} - public string content_type {get;set;} - public int? w {get;set;} - public int? h {get;set;} - public int? duration {get;set;} - public TLAbsBotInlineMessage send_message {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = title != null ? (flags | 2) : (flags & ~2); -flags = description != null ? (flags | 4) : (flags & ~4); -flags = url != null ? (flags | 8) : (flags & ~8); -flags = thumb_url != null ? (flags | 16) : (flags & ~16); -flags = content_url != null ? (flags | 32) : (flags & ~32); -flags = content_type != null ? (flags | 32) : (flags & ~32); -flags = w != null ? (flags | 64) : (flags & ~64); -flags = h != null ? (flags | 64) : (flags & ~64); -flags = duration != null ? (flags | 128) : (flags & ~128); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -id = StringUtil.Deserialize(br); -type = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -title = StringUtil.Deserialize(br); -else -title = null; + id = StringUtil.Deserialize(br); + type = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + title = StringUtil.Deserialize(br); + else + title = null; -if ((flags & 4) != 0) -description = StringUtil.Deserialize(br); -else -description = null; + if ((flags & 4) != 0) + description = StringUtil.Deserialize(br); + else + description = null; -if ((flags & 8) != 0) -url = StringUtil.Deserialize(br); -else -url = null; + if ((flags & 8) != 0) + url = StringUtil.Deserialize(br); + else + url = null; -if ((flags & 16) != 0) -thumb_url = StringUtil.Deserialize(br); -else -thumb_url = null; + if ((flags & 16) != 0) + thumb_url = StringUtil.Deserialize(br); + else + thumb_url = null; -if ((flags & 32) != 0) -content_url = StringUtil.Deserialize(br); -else -content_url = null; + if ((flags & 32) != 0) + content_url = StringUtil.Deserialize(br); + else + content_url = null; -if ((flags & 32) != 0) -content_type = StringUtil.Deserialize(br); -else -content_type = null; + if ((flags & 32) != 0) + content_type = StringUtil.Deserialize(br); + else + content_type = null; -if ((flags & 64) != 0) -w = br.ReadInt32(); -else -w = null; + if ((flags & 64) != 0) + w = br.ReadInt32(); + else + w = null; -if ((flags & 64) != 0) -h = br.ReadInt32(); -else -h = null; + if ((flags & 64) != 0) + h = br.ReadInt32(); + else + h = null; -if ((flags & 128) != 0) -duration = br.ReadInt32(); -else -duration = null; - -send_message = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br); + if ((flags & 128) != 0) + duration = br.ReadInt32(); + else + duration = null; + send_message = (TLAbsBotInlineMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(id,bw); -StringUtil.Serialize(type,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(title,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(description,bw); -if ((flags & 8) != 0) -StringUtil.Serialize(url,bw); -if ((flags & 16) != 0) -StringUtil.Serialize(thumb_url,bw); -if ((flags & 32) != 0) -StringUtil.Serialize(content_url,bw); -if ((flags & 32) != 0) -StringUtil.Serialize(content_type,bw); -if ((flags & 64) != 0) -bw.Write(w.Value); -if ((flags & 64) != 0) -bw.Write(h.Value); -if ((flags & 128) != 0) -bw.Write(duration.Value); -ObjectUtils.SerializeObject(send_message,bw); - + bw.Write(flags); + StringUtil.Serialize(id, bw); + StringUtil.Serialize(type, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(title, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(description, bw); + if ((flags & 8) != 0) + StringUtil.Serialize(url, bw); + if ((flags & 16) != 0) + StringUtil.Serialize(thumb_url, bw); + if ((flags & 32) != 0) + StringUtil.Serialize(content_url, bw); + if ((flags & 32) != 0) + StringUtil.Serialize(content_type, bw); + if ((flags & 64) != 0) + bw.Write(w.Value); + if ((flags & 64) != 0) + bw.Write(h.Value); + if ((flags & 128) != 0) + bw.Write(duration.Value); + ObjectUtils.SerializeObject(send_message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannel.cs b/TeleSharp.TL/TL/TLChannel.cs index 63774d4..2e75bcd 100644 --- a/TeleSharp.TL/TL/TLChannel.cs +++ b/TeleSharp.TL/TL/TLChannel.cs @@ -1,134 +1,109 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1588737454)] + [TLObject(-1588737454)] public class TLChannel : TLAbsChat { - public override int Constructor + public override int Constructor => -1588737454; + + public int flags { get; set; } + public bool creator { get; set; } + public bool kicked { get; set; } + public bool left { get; set; } + public bool editor { get; set; } + public bool moderator { get; set; } + public bool broadcast { get; set; } + public bool verified { get; set; } + public bool megagroup { get; set; } + public bool restricted { get; set; } + public bool democracy { get; set; } + public bool signatures { get; set; } + public bool min { get; set; } + public int id { get; set; } + public long? access_hash { get; set; } + public string title { get; set; } + public string username { get; set; } + public TLAbsChatPhoto photo { get; set; } + public int date { get; set; } + public int version { get; set; } + public string restriction_reason { get; set; } + + + public void ComputeFlags() { - get - { - return -1588737454; - } + flags = 0; + flags = creator ? flags | 1 : flags & ~1; + flags = kicked ? flags | 2 : flags & ~2; + flags = left ? flags | 4 : flags & ~4; + flags = editor ? flags | 8 : flags & ~8; + flags = moderator ? flags | 16 : flags & ~16; + flags = broadcast ? flags | 32 : flags & ~32; + flags = verified ? flags | 128 : flags & ~128; + flags = megagroup ? flags | 256 : flags & ~256; + flags = restricted ? flags | 512 : flags & ~512; + flags = democracy ? flags | 1024 : flags & ~1024; + flags = signatures ? flags | 2048 : flags & ~2048; + flags = min ? flags | 4096 : flags & ~4096; + flags = access_hash != null ? flags | 8192 : flags & ~8192; + flags = username != null ? flags | 64 : flags & ~64; + flags = restriction_reason != null ? flags | 512 : flags & ~512; } - public int flags {get;set;} - public bool creator {get;set;} - public bool kicked {get;set;} - public bool left {get;set;} - public bool editor {get;set;} - public bool moderator {get;set;} - public bool broadcast {get;set;} - public bool verified {get;set;} - public bool megagroup {get;set;} - public bool restricted {get;set;} - public bool democracy {get;set;} - public bool signatures {get;set;} - public bool min {get;set;} - public int id {get;set;} - public long? access_hash {get;set;} - public string title {get;set;} - public string username {get;set;} - public TLAbsChatPhoto photo {get;set;} - public int date {get;set;} - public int version {get;set;} - public string restriction_reason {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = creator ? (flags | 1) : (flags & ~1); -flags = kicked ? (flags | 2) : (flags & ~2); -flags = left ? (flags | 4) : (flags & ~4); -flags = editor ? (flags | 8) : (flags & ~8); -flags = moderator ? (flags | 16) : (flags & ~16); -flags = broadcast ? (flags | 32) : (flags & ~32); -flags = verified ? (flags | 128) : (flags & ~128); -flags = megagroup ? (flags | 256) : (flags & ~256); -flags = restricted ? (flags | 512) : (flags & ~512); -flags = democracy ? (flags | 1024) : (flags & ~1024); -flags = signatures ? (flags | 2048) : (flags & ~2048); -flags = min ? (flags | 4096) : (flags & ~4096); -flags = access_hash != null ? (flags | 8192) : (flags & ~8192); -flags = username != null ? (flags | 64) : (flags & ~64); -flags = restriction_reason != null ? (flags | 512) : (flags & ~512); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -creator = (flags & 1) != 0; -kicked = (flags & 2) != 0; -left = (flags & 4) != 0; -editor = (flags & 8) != 0; -moderator = (flags & 16) != 0; -broadcast = (flags & 32) != 0; -verified = (flags & 128) != 0; -megagroup = (flags & 256) != 0; -restricted = (flags & 512) != 0; -democracy = (flags & 1024) != 0; -signatures = (flags & 2048) != 0; -min = (flags & 4096) != 0; -id = br.ReadInt32(); -if ((flags & 8192) != 0) -access_hash = br.ReadInt64(); -else -access_hash = null; - -title = StringUtil.Deserialize(br); -if ((flags & 64) != 0) -username = StringUtil.Deserialize(br); -else -username = null; - -photo = (TLAbsChatPhoto)ObjectUtils.DeserializeObject(br); -date = br.ReadInt32(); -version = br.ReadInt32(); -if ((flags & 512) != 0) -restriction_reason = StringUtil.Deserialize(br); -else -restriction_reason = null; + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + editor = (flags & 8) != 0; + moderator = (flags & 16) != 0; + broadcast = (flags & 32) != 0; + verified = (flags & 128) != 0; + megagroup = (flags & 256) != 0; + restricted = (flags & 512) != 0; + democracy = (flags & 1024) != 0; + signatures = (flags & 2048) != 0; + min = (flags & 4096) != 0; + id = br.ReadInt32(); + if ((flags & 8192) != 0) + access_hash = br.ReadInt64(); + else + access_hash = null; + title = StringUtil.Deserialize(br); + if ((flags & 64) != 0) + username = StringUtil.Deserialize(br); + else + username = null; + photo = (TLAbsChatPhoto) ObjectUtils.DeserializeObject(br); + date = br.ReadInt32(); + version = br.ReadInt32(); + if ((flags & 512) != 0) + restriction_reason = StringUtil.Deserialize(br); + else + restriction_reason = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - - - - - - - - - -bw.Write(id); -if ((flags & 8192) != 0) -bw.Write(access_hash.Value); -StringUtil.Serialize(title,bw); -if ((flags & 64) != 0) -StringUtil.Serialize(username,bw); -ObjectUtils.SerializeObject(photo,bw); -bw.Write(date); -bw.Write(version); -if ((flags & 512) != 0) -StringUtil.Serialize(restriction_reason,bw); - + bw.Write(id); + if ((flags & 8192) != 0) + bw.Write(access_hash.Value); + StringUtil.Serialize(title, bw); + if ((flags & 64) != 0) + StringUtil.Serialize(username, bw); + ObjectUtils.SerializeObject(photo, bw); + bw.Write(date); + bw.Write(version); + if ((flags & 512) != 0) + StringUtil.Serialize(restriction_reason, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelForbidden.cs b/TeleSharp.TL/TL/TLChannelForbidden.cs index 471a7f6..a363b3e 100644 --- a/TeleSharp.TL/TL/TLChannelForbidden.cs +++ b/TeleSharp.TL/TL/TLChannelForbidden.cs @@ -1,61 +1,47 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2059962289)] + [TLObject(-2059962289)] public class TLChannelForbidden : TLAbsChat { - public override int Constructor + public override int Constructor => -2059962289; + + public int flags { get; set; } + public bool broadcast { get; set; } + public bool megagroup { get; set; } + public int id { get; set; } + public long access_hash { get; set; } + public string title { get; set; } + + + public void ComputeFlags() { - get - { - return -2059962289; - } + flags = 0; + flags = broadcast ? flags | 32 : flags & ~32; + flags = megagroup ? flags | 256 : flags & ~256; } - public int flags {get;set;} - public bool broadcast {get;set;} - public bool megagroup {get;set;} - public int id {get;set;} - public long access_hash {get;set;} - public string title {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = broadcast ? (flags | 32) : (flags & ~32); -flags = megagroup ? (flags | 256) : (flags & ~256); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -broadcast = (flags & 32) != 0; -megagroup = (flags & 256) != 0; -id = br.ReadInt32(); -access_hash = br.ReadInt64(); -title = StringUtil.Deserialize(br); - + broadcast = (flags & 32) != 0; + megagroup = (flags & 256) != 0; + id = br.ReadInt32(); + access_hash = br.ReadInt64(); + title = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -bw.Write(id); -bw.Write(access_hash); -StringUtil.Serialize(title,bw); - + bw.Write(id); + bw.Write(access_hash); + StringUtil.Serialize(title, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelFull.cs b/TeleSharp.TL/TL/TLChannelFull.cs index 6559bea..1d8e08e 100644 --- a/TeleSharp.TL/TL/TLChannelFull.cs +++ b/TeleSharp.TL/TL/TLChannelFull.cs @@ -1,133 +1,118 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1009430225)] + [TLObject(-1009430225)] public class TLChannelFull : TLAbsChatFull { - public override int Constructor + public override int Constructor => -1009430225; + + public int flags { get; set; } + public bool can_view_participants { get; set; } + public bool can_set_username { get; set; } + public int id { get; set; } + public string about { get; set; } + public int? participants_count { get; set; } + public int? admins_count { get; set; } + public int? kicked_count { get; set; } + public int read_inbox_max_id { get; set; } + public int read_outbox_max_id { get; set; } + public int unread_count { get; set; } + public TLAbsPhoto chat_photo { get; set; } + public TLAbsPeerNotifySettings notify_settings { get; set; } + public TLAbsExportedChatInvite exported_invite { get; set; } + public TLVector bot_info { get; set; } + public int? migrated_from_chat_id { get; set; } + public int? migrated_from_max_id { get; set; } + public int? pinned_msg_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1009430225; - } + flags = 0; + flags = can_view_participants ? flags | 8 : flags & ~8; + flags = can_set_username ? flags | 64 : flags & ~64; + flags = participants_count != null ? flags | 1 : flags & ~1; + flags = admins_count != null ? flags | 2 : flags & ~2; + flags = kicked_count != null ? flags | 4 : flags & ~4; + flags = migrated_from_chat_id != null ? flags | 16 : flags & ~16; + flags = migrated_from_max_id != null ? flags | 16 : flags & ~16; + flags = pinned_msg_id != null ? flags | 32 : flags & ~32; } - public int flags {get;set;} - public bool can_view_participants {get;set;} - public bool can_set_username {get;set;} - public int id {get;set;} - public string about {get;set;} - public int? participants_count {get;set;} - public int? admins_count {get;set;} - public int? kicked_count {get;set;} - public int read_inbox_max_id {get;set;} - public int read_outbox_max_id {get;set;} - public int unread_count {get;set;} - public TLAbsPhoto chat_photo {get;set;} - public TLAbsPeerNotifySettings notify_settings {get;set;} - public TLAbsExportedChatInvite exported_invite {get;set;} - public TLVector bot_info {get;set;} - public int? migrated_from_chat_id {get;set;} - public int? migrated_from_max_id {get;set;} - public int? pinned_msg_id {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = can_view_participants ? (flags | 8) : (flags & ~8); -flags = can_set_username ? (flags | 64) : (flags & ~64); -flags = participants_count != null ? (flags | 1) : (flags & ~1); -flags = admins_count != null ? (flags | 2) : (flags & ~2); -flags = kicked_count != null ? (flags | 4) : (flags & ~4); -flags = migrated_from_chat_id != null ? (flags | 16) : (flags & ~16); -flags = migrated_from_max_id != null ? (flags | 16) : (flags & ~16); -flags = pinned_msg_id != null ? (flags | 32) : (flags & ~32); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -can_view_participants = (flags & 8) != 0; -can_set_username = (flags & 64) != 0; -id = br.ReadInt32(); -about = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -participants_count = br.ReadInt32(); -else -participants_count = null; + can_view_participants = (flags & 8) != 0; + can_set_username = (flags & 64) != 0; + id = br.ReadInt32(); + about = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + participants_count = br.ReadInt32(); + else + participants_count = null; -if ((flags & 2) != 0) -admins_count = br.ReadInt32(); -else -admins_count = null; + if ((flags & 2) != 0) + admins_count = br.ReadInt32(); + else + admins_count = null; -if ((flags & 4) != 0) -kicked_count = br.ReadInt32(); -else -kicked_count = null; + if ((flags & 4) != 0) + kicked_count = br.ReadInt32(); + else + kicked_count = null; -read_inbox_max_id = br.ReadInt32(); -read_outbox_max_id = br.ReadInt32(); -unread_count = br.ReadInt32(); -chat_photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -notify_settings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); -exported_invite = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); -bot_info = (TLVector)ObjectUtils.DeserializeVector(br); -if ((flags & 16) != 0) -migrated_from_chat_id = br.ReadInt32(); -else -migrated_from_chat_id = null; - -if ((flags & 16) != 0) -migrated_from_max_id = br.ReadInt32(); -else -migrated_from_max_id = null; - -if ((flags & 32) != 0) -pinned_msg_id = br.ReadInt32(); -else -pinned_msg_id = null; + read_inbox_max_id = br.ReadInt32(); + read_outbox_max_id = br.ReadInt32(); + unread_count = br.ReadInt32(); + chat_photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + notify_settings = (TLAbsPeerNotifySettings) ObjectUtils.DeserializeObject(br); + exported_invite = (TLAbsExportedChatInvite) ObjectUtils.DeserializeObject(br); + bot_info = ObjectUtils.DeserializeVector(br); + if ((flags & 16) != 0) + migrated_from_chat_id = br.ReadInt32(); + else + migrated_from_chat_id = null; + if ((flags & 16) != 0) + migrated_from_max_id = br.ReadInt32(); + else + migrated_from_max_id = null; + if ((flags & 32) != 0) + pinned_msg_id = br.ReadInt32(); + else + pinned_msg_id = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -bw.Write(id); -StringUtil.Serialize(about,bw); -if ((flags & 1) != 0) -bw.Write(participants_count.Value); -if ((flags & 2) != 0) -bw.Write(admins_count.Value); -if ((flags & 4) != 0) -bw.Write(kicked_count.Value); -bw.Write(read_inbox_max_id); -bw.Write(read_outbox_max_id); -bw.Write(unread_count); -ObjectUtils.SerializeObject(chat_photo,bw); -ObjectUtils.SerializeObject(notify_settings,bw); -ObjectUtils.SerializeObject(exported_invite,bw); -ObjectUtils.SerializeObject(bot_info,bw); -if ((flags & 16) != 0) -bw.Write(migrated_from_chat_id.Value); -if ((flags & 16) != 0) -bw.Write(migrated_from_max_id.Value); -if ((flags & 32) != 0) -bw.Write(pinned_msg_id.Value); - + bw.Write(id); + StringUtil.Serialize(about, bw); + if ((flags & 1) != 0) + bw.Write(participants_count.Value); + if ((flags & 2) != 0) + bw.Write(admins_count.Value); + if ((flags & 4) != 0) + bw.Write(kicked_count.Value); + bw.Write(read_inbox_max_id); + bw.Write(read_outbox_max_id); + bw.Write(unread_count); + ObjectUtils.SerializeObject(chat_photo, bw); + ObjectUtils.SerializeObject(notify_settings, bw); + ObjectUtils.SerializeObject(exported_invite, bw); + ObjectUtils.SerializeObject(bot_info, bw); + if ((flags & 16) != 0) + bw.Write(migrated_from_chat_id.Value); + if ((flags & 16) != 0) + bw.Write(migrated_from_max_id.Value); + if ((flags & 32) != 0) + bw.Write(pinned_msg_id.Value); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelMessagesFilter.cs b/TeleSharp.TL/TL/TLChannelMessagesFilter.cs index 7460690..743db89 100644 --- a/TeleSharp.TL/TL/TLChannelMessagesFilter.cs +++ b/TeleSharp.TL/TL/TLChannelMessagesFilter.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-847783593)] + [TLObject(-847783593)] public class TLChannelMessagesFilter : TLAbsChannelMessagesFilter { - public override int Constructor + public override int Constructor => -847783593; + + public int flags { get; set; } + public bool exclude_new_messages { get; set; } + public TLVector ranges { get; set; } + + + public void ComputeFlags() { - get - { - return -847783593; - } + flags = 0; + flags = exclude_new_messages ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool exclude_new_messages {get;set;} - public TLVector ranges {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = exclude_new_messages ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -exclude_new_messages = (flags & 2) != 0; -ranges = (TLVector)ObjectUtils.DeserializeVector(br); - + exclude_new_messages = (flags & 2) != 0; + ranges = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(ranges,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(ranges, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs b/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs index 7e3aeb7..cc12efa 100644 --- a/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs +++ b/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1798033689)] + [TLObject(-1798033689)] public class TLChannelMessagesFilterEmpty : TLAbsChannelMessagesFilter { - public override int Constructor + public override int Constructor => -1798033689; + + + public void ComputeFlags() { - get - { - return -1798033689; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipant.cs b/TeleSharp.TL/TL/TLChannelParticipant.cs index 1954404..8f90097 100644 --- a/TeleSharp.TL/TL/TLChannelParticipant.cs +++ b/TeleSharp.TL/TL/TLChannelParticipant.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(367766557)] + [TLObject(367766557)] public class TLChannelParticipant : TLAbsChannelParticipant { - public override int Constructor + public override int Constructor => 367766557; + + public int user_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return 367766557; - } } - public int user_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -date = br.ReadInt32(); - + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(date); - + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantCreator.cs b/TeleSharp.TL/TL/TLChannelParticipantCreator.cs index 0fd031b..4234f4f 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantCreator.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantCreator.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-471670279)] + [TLObject(-471670279)] public class TLChannelParticipantCreator : TLAbsChannelParticipant { - public override int Constructor + public override int Constructor => -471670279; + + public int user_id { get; set; } + + + public void ComputeFlags() { - get - { - return -471670279; - } } - public int user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantEditor.cs b/TeleSharp.TL/TL/TLChannelParticipantEditor.cs index 589ba4d..a804cf4 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantEditor.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantEditor.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1743180447)] + [TLObject(-1743180447)] public class TLChannelParticipantEditor : TLAbsChannelParticipant { - public override int Constructor + public override int Constructor => -1743180447; + + public int user_id { get; set; } + public int inviter_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -1743180447; - } } - public int user_id {get;set;} - public int inviter_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -inviter_id = br.ReadInt32(); -date = br.ReadInt32(); - + inviter_id = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(inviter_id); -bw.Write(date); - + bw.Write(inviter_id); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantKicked.cs b/TeleSharp.TL/TL/TLChannelParticipantKicked.cs index f45f891..70c1bcf 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantKicked.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantKicked.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1933187430)] + [TLObject(-1933187430)] public class TLChannelParticipantKicked : TLAbsChannelParticipant { - public override int Constructor + public override int Constructor => -1933187430; + + public int user_id { get; set; } + public int kicked_by { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -1933187430; - } } - public int user_id {get;set;} - public int kicked_by {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -kicked_by = br.ReadInt32(); -date = br.ReadInt32(); - + kicked_by = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(kicked_by); -bw.Write(date); - + bw.Write(kicked_by); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantModerator.cs b/TeleSharp.TL/TL/TLChannelParticipantModerator.cs index dd993e4..e5801ba 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantModerator.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantModerator.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1861910545)] + [TLObject(-1861910545)] public class TLChannelParticipantModerator : TLAbsChannelParticipant { - public override int Constructor + public override int Constructor => -1861910545; + + public int user_id { get; set; } + public int inviter_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -1861910545; - } } - public int user_id {get;set;} - public int inviter_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -inviter_id = br.ReadInt32(); -date = br.ReadInt32(); - + inviter_id = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(inviter_id); -bw.Write(date); - + bw.Write(inviter_id); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantSelf.cs b/TeleSharp.TL/TL/TLChannelParticipantSelf.cs index 29be1e5..8f5e429 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantSelf.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantSelf.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1557620115)] + [TLObject(-1557620115)] public class TLChannelParticipantSelf : TLAbsChannelParticipant { - public override int Constructor + public override int Constructor => -1557620115; + + public int user_id { get; set; } + public int inviter_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -1557620115; - } } - public int user_id {get;set;} - public int inviter_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -inviter_id = br.ReadInt32(); -date = br.ReadInt32(); - + inviter_id = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(inviter_id); -bw.Write(date); - + bw.Write(inviter_id); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs b/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs index 7e40364..92111e4 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1268741783)] + [TLObject(-1268741783)] public class TLChannelParticipantsAdmins : TLAbsChannelParticipantsFilter { - public override int Constructor + public override int Constructor => -1268741783; + + + public void ComputeFlags() { - get - { - return -1268741783; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantsBots.cs b/TeleSharp.TL/TL/TLChannelParticipantsBots.cs index a874bd9..cacf2cf 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantsBots.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantsBots.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1328445861)] + [TLObject(-1328445861)] public class TLChannelParticipantsBots : TLAbsChannelParticipantsFilter { - public override int Constructor + public override int Constructor => -1328445861; + + + public void ComputeFlags() { - get - { - return -1328445861; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs b/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs index e036ab6..c37b082 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1010285434)] + [TLObject(1010285434)] public class TLChannelParticipantsKicked : TLAbsChannelParticipantsFilter { - public override int Constructor + public override int Constructor => 1010285434; + + + public void ComputeFlags() { - get - { - return 1010285434; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs b/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs index a37c841..4940036 100644 --- a/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs +++ b/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-566281095)] + [TLObject(-566281095)] public class TLChannelParticipantsRecent : TLAbsChannelParticipantsFilter { - public override int Constructor + public override int Constructor => -566281095; + + + public void ComputeFlags() { - get - { - return -566281095; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelRoleEditor.cs b/TeleSharp.TL/TL/TLChannelRoleEditor.cs index ff75913..266e207 100644 --- a/TeleSharp.TL/TL/TLChannelRoleEditor.cs +++ b/TeleSharp.TL/TL/TLChannelRoleEditor.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2113143156)] + [TLObject(-2113143156)] public class TLChannelRoleEditor : TLAbsChannelParticipantRole { - public override int Constructor + public override int Constructor => -2113143156; + + + public void ComputeFlags() { - get - { - return -2113143156; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelRoleEmpty.cs b/TeleSharp.TL/TL/TLChannelRoleEmpty.cs index 4bc07ee..f6f294e 100644 --- a/TeleSharp.TL/TL/TLChannelRoleEmpty.cs +++ b/TeleSharp.TL/TL/TLChannelRoleEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1299865402)] + [TLObject(-1299865402)] public class TLChannelRoleEmpty : TLAbsChannelParticipantRole { - public override int Constructor + public override int Constructor => -1299865402; + + + public void ComputeFlags() { - get - { - return -1299865402; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChannelRoleModerator.cs b/TeleSharp.TL/TL/TLChannelRoleModerator.cs index 94c4f47..48d503d 100644 --- a/TeleSharp.TL/TL/TLChannelRoleModerator.cs +++ b/TeleSharp.TL/TL/TLChannelRoleModerator.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1776756363)] + [TLObject(-1776756363)] public class TLChannelRoleModerator : TLAbsChannelParticipantRole { - public override int Constructor + public override int Constructor => -1776756363; + + + public void ComputeFlags() { - get - { - return -1776756363; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChat.cs b/TeleSharp.TL/TL/TLChat.cs index bf63f50..7de84b3 100644 --- a/TeleSharp.TL/TL/TLChat.cs +++ b/TeleSharp.TL/TL/TLChat.cs @@ -1,95 +1,76 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-652419756)] + [TLObject(-652419756)] public class TLChat : TLAbsChat { - public override int Constructor + public override int Constructor => -652419756; + + public int flags { get; set; } + public bool creator { get; set; } + public bool kicked { get; set; } + public bool left { get; set; } + public bool admins_enabled { get; set; } + public bool admin { get; set; } + public bool deactivated { get; set; } + public int id { get; set; } + public string title { get; set; } + public TLAbsChatPhoto photo { get; set; } + public int participants_count { get; set; } + public int date { get; set; } + public int version { get; set; } + public TLAbsInputChannel migrated_to { get; set; } + + + public void ComputeFlags() { - get - { - return -652419756; - } + flags = 0; + flags = creator ? flags | 1 : flags & ~1; + flags = kicked ? flags | 2 : flags & ~2; + flags = left ? flags | 4 : flags & ~4; + flags = admins_enabled ? flags | 8 : flags & ~8; + flags = admin ? flags | 16 : flags & ~16; + flags = deactivated ? flags | 32 : flags & ~32; + flags = migrated_to != null ? flags | 64 : flags & ~64; } - public int flags {get;set;} - public bool creator {get;set;} - public bool kicked {get;set;} - public bool left {get;set;} - public bool admins_enabled {get;set;} - public bool admin {get;set;} - public bool deactivated {get;set;} - public int id {get;set;} - public string title {get;set;} - public TLAbsChatPhoto photo {get;set;} - public int participants_count {get;set;} - public int date {get;set;} - public int version {get;set;} - public TLAbsInputChannel migrated_to {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = creator ? (flags | 1) : (flags & ~1); -flags = kicked ? (flags | 2) : (flags & ~2); -flags = left ? (flags | 4) : (flags & ~4); -flags = admins_enabled ? (flags | 8) : (flags & ~8); -flags = admin ? (flags | 16) : (flags & ~16); -flags = deactivated ? (flags | 32) : (flags & ~32); -flags = migrated_to != null ? (flags | 64) : (flags & ~64); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -creator = (flags & 1) != 0; -kicked = (flags & 2) != 0; -left = (flags & 4) != 0; -admins_enabled = (flags & 8) != 0; -admin = (flags & 16) != 0; -deactivated = (flags & 32) != 0; -id = br.ReadInt32(); -title = StringUtil.Deserialize(br); -photo = (TLAbsChatPhoto)ObjectUtils.DeserializeObject(br); -participants_count = br.ReadInt32(); -date = br.ReadInt32(); -version = br.ReadInt32(); -if ((flags & 64) != 0) -migrated_to = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -else -migrated_to = null; - - + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + admins_enabled = (flags & 8) != 0; + admin = (flags & 16) != 0; + deactivated = (flags & 32) != 0; + id = br.ReadInt32(); + title = StringUtil.Deserialize(br); + photo = (TLAbsChatPhoto) ObjectUtils.DeserializeObject(br); + participants_count = br.ReadInt32(); + date = br.ReadInt32(); + version = br.ReadInt32(); + if ((flags & 64) != 0) + migrated_to = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + else + migrated_to = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - - - -bw.Write(id); -StringUtil.Serialize(title,bw); -ObjectUtils.SerializeObject(photo,bw); -bw.Write(participants_count); -bw.Write(date); -bw.Write(version); -if ((flags & 64) != 0) -ObjectUtils.SerializeObject(migrated_to,bw); - + bw.Write(id); + StringUtil.Serialize(title, bw); + ObjectUtils.SerializeObject(photo, bw); + bw.Write(participants_count); + bw.Write(date); + bw.Write(version); + if ((flags & 64) != 0) + ObjectUtils.SerializeObject(migrated_to, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatEmpty.cs b/TeleSharp.TL/TL/TLChatEmpty.cs index 0efc4a3..c334c52 100644 --- a/TeleSharp.TL/TL/TLChatEmpty.cs +++ b/TeleSharp.TL/TL/TLChatEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1683826688)] + [TLObject(-1683826688)] public class TLChatEmpty : TLAbsChat { - public override int Constructor + public override int Constructor => -1683826688; + + public int id { get; set; } + + + public void ComputeFlags() { - get - { - return -1683826688; - } } - public int id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatForbidden.cs b/TeleSharp.TL/TL/TLChatForbidden.cs index e2576b1..527dee2 100644 --- a/TeleSharp.TL/TL/TLChatForbidden.cs +++ b/TeleSharp.TL/TL/TLChatForbidden.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(120753115)] + [TLObject(120753115)] public class TLChatForbidden : TLAbsChat { - public override int Constructor + public override int Constructor => 120753115; + + public int id { get; set; } + public string title { get; set; } + + + public void ComputeFlags() { - get - { - return 120753115; - } } - public int id {get;set;} - public string title {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -title = StringUtil.Deserialize(br); - + title = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -StringUtil.Serialize(title,bw); - + StringUtil.Serialize(title, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatFull.cs b/TeleSharp.TL/TL/TLChatFull.cs index 74809c8..ba25478 100644 --- a/TeleSharp.TL/TL/TLChatFull.cs +++ b/TeleSharp.TL/TL/TLChatFull.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(771925524)] + [TLObject(771925524)] public class TLChatFull : TLAbsChatFull { - public override int Constructor + public override int Constructor => 771925524; + + public int id { get; set; } + public TLAbsChatParticipants participants { get; set; } + public TLAbsPhoto chat_photo { get; set; } + public TLAbsPeerNotifySettings notify_settings { get; set; } + public TLAbsExportedChatInvite exported_invite { get; set; } + public TLVector bot_info { get; set; } + + + public void ComputeFlags() { - get - { - return 771925524; - } } - public int id {get;set;} - public TLAbsChatParticipants participants {get;set;} - public TLAbsPhoto chat_photo {get;set;} - public TLAbsPeerNotifySettings notify_settings {get;set;} - public TLAbsExportedChatInvite exported_invite {get;set;} - public TLVector bot_info {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -participants = (TLAbsChatParticipants)ObjectUtils.DeserializeObject(br); -chat_photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -notify_settings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); -exported_invite = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); -bot_info = (TLVector)ObjectUtils.DeserializeVector(br); - + participants = (TLAbsChatParticipants) ObjectUtils.DeserializeObject(br); + chat_photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + notify_settings = (TLAbsPeerNotifySettings) ObjectUtils.DeserializeObject(br); + exported_invite = (TLAbsExportedChatInvite) ObjectUtils.DeserializeObject(br); + bot_info = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -ObjectUtils.SerializeObject(participants,bw); -ObjectUtils.SerializeObject(chat_photo,bw); -ObjectUtils.SerializeObject(notify_settings,bw); -ObjectUtils.SerializeObject(exported_invite,bw); -ObjectUtils.SerializeObject(bot_info,bw); - + ObjectUtils.SerializeObject(participants, bw); + ObjectUtils.SerializeObject(chat_photo, bw); + ObjectUtils.SerializeObject(notify_settings, bw); + ObjectUtils.SerializeObject(exported_invite, bw); + ObjectUtils.SerializeObject(bot_info, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatInvite.cs b/TeleSharp.TL/TL/TLChatInvite.cs index 9798a25..4fba146 100644 --- a/TeleSharp.TL/TL/TLChatInvite.cs +++ b/TeleSharp.TL/TL/TLChatInvite.cs @@ -1,78 +1,61 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-613092008)] + [TLObject(-613092008)] public class TLChatInvite : TLAbsChatInvite { - public override int Constructor + public override int Constructor => -613092008; + + public int flags { get; set; } + public bool channel { get; set; } + public bool broadcast { get; set; } + public bool @public { get; set; } + public bool megagroup { get; set; } + public string title { get; set; } + public TLAbsChatPhoto photo { get; set; } + public int participants_count { get; set; } + public TLVector participants { get; set; } + + + public void ComputeFlags() { - get - { - return -613092008; - } + flags = 0; + flags = channel ? flags | 1 : flags & ~1; + flags = broadcast ? flags | 2 : flags & ~2; + flags = @public ? flags | 4 : flags & ~4; + flags = megagroup ? flags | 8 : flags & ~8; + flags = participants != null ? flags | 16 : flags & ~16; } - public int flags {get;set;} - public bool channel {get;set;} - public bool broadcast {get;set;} - public bool @public {get;set;} - public bool megagroup {get;set;} - public string title {get;set;} - public TLAbsChatPhoto photo {get;set;} - public int participants_count {get;set;} - public TLVector participants {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = channel ? (flags | 1) : (flags & ~1); -flags = broadcast ? (flags | 2) : (flags & ~2); -flags = @public ? (flags | 4) : (flags & ~4); -flags = megagroup ? (flags | 8) : (flags & ~8); -flags = participants != null ? (flags | 16) : (flags & ~16); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -channel = (flags & 1) != 0; -broadcast = (flags & 2) != 0; -@public = (flags & 4) != 0; -megagroup = (flags & 8) != 0; -title = StringUtil.Deserialize(br); -photo = (TLAbsChatPhoto)ObjectUtils.DeserializeObject(br); -participants_count = br.ReadInt32(); -if ((flags & 16) != 0) -participants = (TLVector)ObjectUtils.DeserializeVector(br); -else -participants = null; - - + channel = (flags & 1) != 0; + broadcast = (flags & 2) != 0; + @public = (flags & 4) != 0; + megagroup = (flags & 8) != 0; + title = StringUtil.Deserialize(br); + photo = (TLAbsChatPhoto) ObjectUtils.DeserializeObject(br); + participants_count = br.ReadInt32(); + if ((flags & 16) != 0) + participants = ObjectUtils.DeserializeVector(br); + else + participants = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - -StringUtil.Serialize(title,bw); -ObjectUtils.SerializeObject(photo,bw); -bw.Write(participants_count); -if ((flags & 16) != 0) -ObjectUtils.SerializeObject(participants,bw); - + StringUtil.Serialize(title, bw); + ObjectUtils.SerializeObject(photo, bw); + bw.Write(participants_count); + if ((flags & 16) != 0) + ObjectUtils.SerializeObject(participants, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatInviteAlready.cs b/TeleSharp.TL/TL/TLChatInviteAlready.cs index e78bca3..5c2cbb1 100644 --- a/TeleSharp.TL/TL/TLChatInviteAlready.cs +++ b/TeleSharp.TL/TL/TLChatInviteAlready.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1516793212)] + [TLObject(1516793212)] public class TLChatInviteAlready : TLAbsChatInvite { - public override int Constructor + public override int Constructor => 1516793212; + + public TLAbsChat chat { get; set; } + + + public void ComputeFlags() { - get - { - return 1516793212; - } } - public TLAbsChat chat {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - chat = (TLAbsChat)ObjectUtils.DeserializeObject(br); - + chat = (TLAbsChat) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(chat,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(chat, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatInviteEmpty.cs b/TeleSharp.TL/TL/TLChatInviteEmpty.cs index 59896d2..b04bc7a 100644 --- a/TeleSharp.TL/TL/TLChatInviteEmpty.cs +++ b/TeleSharp.TL/TL/TLChatInviteEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1776236393)] + [TLObject(1776236393)] public class TLChatInviteEmpty : TLAbsExportedChatInvite { - public override int Constructor + public override int Constructor => 1776236393; + + + public void ComputeFlags() { - get - { - return 1776236393; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatInviteExported.cs b/TeleSharp.TL/TL/TLChatInviteExported.cs index b8a9b61..5223e39 100644 --- a/TeleSharp.TL/TL/TLChatInviteExported.cs +++ b/TeleSharp.TL/TL/TLChatInviteExported.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-64092740)] + [TLObject(-64092740)] public class TLChatInviteExported : TLAbsExportedChatInvite { - public override int Constructor + public override int Constructor => -64092740; + + public string link { get; set; } + + + public void ComputeFlags() { - get - { - return -64092740; - } } - public string link {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { link = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(link,bw); - + bw.Write(Constructor); + StringUtil.Serialize(link, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatParticipant.cs b/TeleSharp.TL/TL/TLChatParticipant.cs index ea8df15..2875775 100644 --- a/TeleSharp.TL/TL/TLChatParticipant.cs +++ b/TeleSharp.TL/TL/TLChatParticipant.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-925415106)] + [TLObject(-925415106)] public class TLChatParticipant : TLAbsChatParticipant { - public override int Constructor + public override int Constructor => -925415106; + + public int user_id { get; set; } + public int inviter_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -925415106; - } } - public int user_id {get;set;} - public int inviter_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -inviter_id = br.ReadInt32(); -date = br.ReadInt32(); - + inviter_id = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(inviter_id); -bw.Write(date); - + bw.Write(inviter_id); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatParticipantAdmin.cs b/TeleSharp.TL/TL/TLChatParticipantAdmin.cs index d964e28..288cdd4 100644 --- a/TeleSharp.TL/TL/TLChatParticipantAdmin.cs +++ b/TeleSharp.TL/TL/TLChatParticipantAdmin.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-489233354)] + [TLObject(-489233354)] public class TLChatParticipantAdmin : TLAbsChatParticipant { - public override int Constructor + public override int Constructor => -489233354; + + public int user_id { get; set; } + public int inviter_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -489233354; - } } - public int user_id {get;set;} - public int inviter_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -inviter_id = br.ReadInt32(); -date = br.ReadInt32(); - + inviter_id = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(inviter_id); -bw.Write(date); - + bw.Write(inviter_id); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatParticipantCreator.cs b/TeleSharp.TL/TL/TLChatParticipantCreator.cs index c1fabf7..d9dd928 100644 --- a/TeleSharp.TL/TL/TLChatParticipantCreator.cs +++ b/TeleSharp.TL/TL/TLChatParticipantCreator.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-636267638)] + [TLObject(-636267638)] public class TLChatParticipantCreator : TLAbsChatParticipant { - public override int Constructor + public override int Constructor => -636267638; + + public int user_id { get; set; } + + + public void ComputeFlags() { - get - { - return -636267638; - } } - public int user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatParticipants.cs b/TeleSharp.TL/TL/TLChatParticipants.cs index 6700490..9d00f3c 100644 --- a/TeleSharp.TL/TL/TLChatParticipants.cs +++ b/TeleSharp.TL/TL/TLChatParticipants.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1061556205)] + [TLObject(1061556205)] public class TLChatParticipants : TLAbsChatParticipants { - public override int Constructor + public override int Constructor => 1061556205; + + public int chat_id { get; set; } + public TLVector participants { get; set; } + public int version { get; set; } + + + public void ComputeFlags() { - get - { - return 1061556205; - } } - public int chat_id {get;set;} - public TLVector participants {get;set;} - public int version {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -participants = (TLVector)ObjectUtils.DeserializeVector(br); -version = br.ReadInt32(); - + participants = ObjectUtils.DeserializeVector(br); + version = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -ObjectUtils.SerializeObject(participants,bw); -bw.Write(version); - + ObjectUtils.SerializeObject(participants, bw); + bw.Write(version); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs b/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs index 7036c6e..59ed998 100644 --- a/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs +++ b/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs @@ -1,56 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-57668565)] + [TLObject(-57668565)] public class TLChatParticipantsForbidden : TLAbsChatParticipants { - public override int Constructor + public override int Constructor => -57668565; + + public int flags { get; set; } + public int chat_id { get; set; } + public TLAbsChatParticipant self_participant { get; set; } + + + public void ComputeFlags() { - get - { - return -57668565; - } + flags = 0; + flags = self_participant != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public int chat_id {get;set;} - public TLAbsChatParticipant self_participant {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = self_participant != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -chat_id = br.ReadInt32(); -if ((flags & 1) != 0) -self_participant = (TLAbsChatParticipant)ObjectUtils.DeserializeObject(br); -else -self_participant = null; - - + chat_id = br.ReadInt32(); + if ((flags & 1) != 0) + self_participant = (TLAbsChatParticipant) ObjectUtils.DeserializeObject(br); + else + self_participant = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(chat_id); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(self_participant,bw); - + bw.Write(flags); + bw.Write(chat_id); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(self_participant, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatPhoto.cs b/TeleSharp.TL/TL/TLChatPhoto.cs index 93664fb..a695d22 100644 --- a/TeleSharp.TL/TL/TLChatPhoto.cs +++ b/TeleSharp.TL/TL/TLChatPhoto.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1632839530)] + [TLObject(1632839530)] public class TLChatPhoto : TLAbsChatPhoto { - public override int Constructor + public override int Constructor => 1632839530; + + public TLAbsFileLocation photo_small { get; set; } + public TLAbsFileLocation photo_big { get; set; } + + + public void ComputeFlags() { - get - { - return 1632839530; - } } - public TLAbsFileLocation photo_small {get;set;} - public TLAbsFileLocation photo_big {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - photo_small = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); -photo_big = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); - + photo_small = (TLAbsFileLocation) ObjectUtils.DeserializeObject(br); + photo_big = (TLAbsFileLocation) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(photo_small,bw); -ObjectUtils.SerializeObject(photo_big,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(photo_small, bw); + ObjectUtils.SerializeObject(photo_big, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLChatPhotoEmpty.cs b/TeleSharp.TL/TL/TLChatPhotoEmpty.cs index d8601e5..2d6f00a 100644 --- a/TeleSharp.TL/TL/TLChatPhotoEmpty.cs +++ b/TeleSharp.TL/TL/TLChatPhotoEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(935395612)] + [TLObject(935395612)] public class TLChatPhotoEmpty : TLAbsChatPhoto { - public override int Constructor + public override int Constructor => 935395612; + + + public void ComputeFlags() { - get - { - return 935395612; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLConfig.cs b/TeleSharp.TL/TL/TLConfig.cs index 92b8ee3..1b861af 100644 --- a/TeleSharp.TL/TL/TLConfig.cs +++ b/TeleSharp.TL/TL/TLConfig.cs @@ -1,119 +1,105 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1704251862)] + [TLObject(-1704251862)] public class TLConfig : TLObject { - public override int Constructor + public override int Constructor => -1704251862; + + public int flags { get; set; } + public int date { get; set; } + public int expires { get; set; } + public bool test_mode { get; set; } + public int this_dc { get; set; } + public TLVector dc_options { get; set; } + public int chat_size_max { get; set; } + public int megagroup_size_max { get; set; } + public int forwarded_count_max { get; set; } + public int online_update_period_ms { get; set; } + public int offline_blur_timeout_ms { get; set; } + public int offline_idle_timeout_ms { get; set; } + public int online_cloud_timeout_ms { get; set; } + public int notify_cloud_delay_ms { get; set; } + public int notify_default_delay_ms { get; set; } + public int chat_big_size { get; set; } + public int push_chat_period_ms { get; set; } + public int push_chat_limit { get; set; } + public int saved_gifs_limit { get; set; } + public int edit_time_limit { get; set; } + public int rating_e_decay { get; set; } + public int stickers_recent_limit { get; set; } + public int? tmp_sessions { get; set; } + public TLVector disabled_features { get; set; } + + + public void ComputeFlags() { - get - { - return -1704251862; - } + flags = 0; + flags = tmp_sessions != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public int date {get;set;} - public int expires {get;set;} - public bool test_mode {get;set;} - public int this_dc {get;set;} - public TLVector dc_options {get;set;} - public int chat_size_max {get;set;} - public int megagroup_size_max {get;set;} - public int forwarded_count_max {get;set;} - public int online_update_period_ms {get;set;} - public int offline_blur_timeout_ms {get;set;} - public int offline_idle_timeout_ms {get;set;} - public int online_cloud_timeout_ms {get;set;} - public int notify_cloud_delay_ms {get;set;} - public int notify_default_delay_ms {get;set;} - public int chat_big_size {get;set;} - public int push_chat_period_ms {get;set;} - public int push_chat_limit {get;set;} - public int saved_gifs_limit {get;set;} - public int edit_time_limit {get;set;} - public int rating_e_decay {get;set;} - public int stickers_recent_limit {get;set;} - public int? tmp_sessions {get;set;} - public TLVector disabled_features {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = tmp_sessions != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -date = br.ReadInt32(); -expires = br.ReadInt32(); -test_mode = BoolUtil.Deserialize(br); -this_dc = br.ReadInt32(); -dc_options = (TLVector)ObjectUtils.DeserializeVector(br); -chat_size_max = br.ReadInt32(); -megagroup_size_max = br.ReadInt32(); -forwarded_count_max = br.ReadInt32(); -online_update_period_ms = br.ReadInt32(); -offline_blur_timeout_ms = br.ReadInt32(); -offline_idle_timeout_ms = br.ReadInt32(); -online_cloud_timeout_ms = br.ReadInt32(); -notify_cloud_delay_ms = br.ReadInt32(); -notify_default_delay_ms = br.ReadInt32(); -chat_big_size = br.ReadInt32(); -push_chat_period_ms = br.ReadInt32(); -push_chat_limit = br.ReadInt32(); -saved_gifs_limit = br.ReadInt32(); -edit_time_limit = br.ReadInt32(); -rating_e_decay = br.ReadInt32(); -stickers_recent_limit = br.ReadInt32(); -if ((flags & 1) != 0) -tmp_sessions = br.ReadInt32(); -else -tmp_sessions = null; - -disabled_features = (TLVector)ObjectUtils.DeserializeVector(br); + date = br.ReadInt32(); + expires = br.ReadInt32(); + test_mode = BoolUtil.Deserialize(br); + this_dc = br.ReadInt32(); + dc_options = ObjectUtils.DeserializeVector(br); + chat_size_max = br.ReadInt32(); + megagroup_size_max = br.ReadInt32(); + forwarded_count_max = br.ReadInt32(); + online_update_period_ms = br.ReadInt32(); + offline_blur_timeout_ms = br.ReadInt32(); + offline_idle_timeout_ms = br.ReadInt32(); + online_cloud_timeout_ms = br.ReadInt32(); + notify_cloud_delay_ms = br.ReadInt32(); + notify_default_delay_ms = br.ReadInt32(); + chat_big_size = br.ReadInt32(); + push_chat_period_ms = br.ReadInt32(); + push_chat_limit = br.ReadInt32(); + saved_gifs_limit = br.ReadInt32(); + edit_time_limit = br.ReadInt32(); + rating_e_decay = br.ReadInt32(); + stickers_recent_limit = br.ReadInt32(); + if ((flags & 1) != 0) + tmp_sessions = br.ReadInt32(); + else + tmp_sessions = null; + disabled_features = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(date); -bw.Write(expires); -BoolUtil.Serialize(test_mode,bw); -bw.Write(this_dc); -ObjectUtils.SerializeObject(dc_options,bw); -bw.Write(chat_size_max); -bw.Write(megagroup_size_max); -bw.Write(forwarded_count_max); -bw.Write(online_update_period_ms); -bw.Write(offline_blur_timeout_ms); -bw.Write(offline_idle_timeout_ms); -bw.Write(online_cloud_timeout_ms); -bw.Write(notify_cloud_delay_ms); -bw.Write(notify_default_delay_ms); -bw.Write(chat_big_size); -bw.Write(push_chat_period_ms); -bw.Write(push_chat_limit); -bw.Write(saved_gifs_limit); -bw.Write(edit_time_limit); -bw.Write(rating_e_decay); -bw.Write(stickers_recent_limit); -if ((flags & 1) != 0) -bw.Write(tmp_sessions.Value); -ObjectUtils.SerializeObject(disabled_features,bw); - + bw.Write(flags); + bw.Write(date); + bw.Write(expires); + BoolUtil.Serialize(test_mode, bw); + bw.Write(this_dc); + ObjectUtils.SerializeObject(dc_options, bw); + bw.Write(chat_size_max); + bw.Write(megagroup_size_max); + bw.Write(forwarded_count_max); + bw.Write(online_update_period_ms); + bw.Write(offline_blur_timeout_ms); + bw.Write(offline_idle_timeout_ms); + bw.Write(online_cloud_timeout_ms); + bw.Write(notify_cloud_delay_ms); + bw.Write(notify_default_delay_ms); + bw.Write(chat_big_size); + bw.Write(push_chat_period_ms); + bw.Write(push_chat_limit); + bw.Write(saved_gifs_limit); + bw.Write(edit_time_limit); + bw.Write(rating_e_decay); + bw.Write(stickers_recent_limit); + if ((flags & 1) != 0) + bw.Write(tmp_sessions.Value); + ObjectUtils.SerializeObject(disabled_features, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContact.cs b/TeleSharp.TL/TL/TLContact.cs index 70b5d85..cd885ab 100644 --- a/TeleSharp.TL/TL/TLContact.cs +++ b/TeleSharp.TL/TL/TLContact.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-116274796)] + [TLObject(-116274796)] public class TLContact : TLObject { - public override int Constructor + public override int Constructor => -116274796; + + public int user_id { get; set; } + public bool mutual { get; set; } + + + public void ComputeFlags() { - get - { - return -116274796; - } } - public int user_id {get;set;} - public bool mutual {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -mutual = BoolUtil.Deserialize(br); - + mutual = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -BoolUtil.Serialize(mutual,bw); - + BoolUtil.Serialize(mutual, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContactBlocked.cs b/TeleSharp.TL/TL/TLContactBlocked.cs index 75c0222..79d9edf 100644 --- a/TeleSharp.TL/TL/TLContactBlocked.cs +++ b/TeleSharp.TL/TL/TLContactBlocked.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1444661369)] + [TLObject(1444661369)] public class TLContactBlocked : TLObject { - public override int Constructor + public override int Constructor => 1444661369; + + public int user_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return 1444661369; - } } - public int user_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -date = br.ReadInt32(); - + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(date); - + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContactLinkContact.cs b/TeleSharp.TL/TL/TLContactLinkContact.cs index 5b834a5..459849b 100644 --- a/TeleSharp.TL/TL/TLContactLinkContact.cs +++ b/TeleSharp.TL/TL/TLContactLinkContact.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-721239344)] + [TLObject(-721239344)] public class TLContactLinkContact : TLAbsContactLink { - public override int Constructor + public override int Constructor => -721239344; + + + public void ComputeFlags() { - get - { - return -721239344; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContactLinkHasPhone.cs b/TeleSharp.TL/TL/TLContactLinkHasPhone.cs index 90cc2e1..114677e 100644 --- a/TeleSharp.TL/TL/TLContactLinkHasPhone.cs +++ b/TeleSharp.TL/TL/TLContactLinkHasPhone.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(646922073)] + [TLObject(646922073)] public class TLContactLinkHasPhone : TLAbsContactLink { - public override int Constructor + public override int Constructor => 646922073; + + + public void ComputeFlags() { - get - { - return 646922073; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContactLinkNone.cs b/TeleSharp.TL/TL/TLContactLinkNone.cs index 21e0de7..a2208af 100644 --- a/TeleSharp.TL/TL/TLContactLinkNone.cs +++ b/TeleSharp.TL/TL/TLContactLinkNone.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-17968211)] + [TLObject(-17968211)] public class TLContactLinkNone : TLAbsContactLink { - public override int Constructor + public override int Constructor => -17968211; + + + public void ComputeFlags() { - get - { - return -17968211; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContactLinkUnknown.cs b/TeleSharp.TL/TL/TLContactLinkUnknown.cs index 972a5a8..753302e 100644 --- a/TeleSharp.TL/TL/TLContactLinkUnknown.cs +++ b/TeleSharp.TL/TL/TLContactLinkUnknown.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1599050311)] + [TLObject(1599050311)] public class TLContactLinkUnknown : TLAbsContactLink { - public override int Constructor + public override int Constructor => 1599050311; + + + public void ComputeFlags() { - get - { - return 1599050311; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLContactStatus.cs b/TeleSharp.TL/TL/TLContactStatus.cs index cfcc5b9..dec1f21 100644 --- a/TeleSharp.TL/TL/TLContactStatus.cs +++ b/TeleSharp.TL/TL/TLContactStatus.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-748155807)] + [TLObject(-748155807)] public class TLContactStatus : TLObject { - public override int Constructor + public override int Constructor => -748155807; + + public int user_id { get; set; } + public TLAbsUserStatus status { get; set; } + + + public void ComputeFlags() { - get - { - return -748155807; - } } - public int user_id {get;set;} - public TLAbsUserStatus status {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -status = (TLAbsUserStatus)ObjectUtils.DeserializeObject(br); - + status = (TLAbsUserStatus) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -ObjectUtils.SerializeObject(status,bw); - + ObjectUtils.SerializeObject(status, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDcOption.cs b/TeleSharp.TL/TL/TLDcOption.cs index c5b3755..5601e4f 100644 --- a/TeleSharp.TL/TL/TLDcOption.cs +++ b/TeleSharp.TL/TL/TLDcOption.cs @@ -1,65 +1,50 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(98092748)] + [TLObject(98092748)] public class TLDcOption : TLObject { - public override int Constructor + public override int Constructor => 98092748; + + public int flags { get; set; } + public bool ipv6 { get; set; } + public bool media_only { get; set; } + public bool tcpo_only { get; set; } + public int id { get; set; } + public string ip_address { get; set; } + public int port { get; set; } + + + public void ComputeFlags() { - get - { - return 98092748; - } + flags = 0; + flags = ipv6 ? flags | 1 : flags & ~1; + flags = media_only ? flags | 2 : flags & ~2; + flags = tcpo_only ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool ipv6 {get;set;} - public bool media_only {get;set;} - public bool tcpo_only {get;set;} - public int id {get;set;} - public string ip_address {get;set;} - public int port {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = ipv6 ? (flags | 1) : (flags & ~1); -flags = media_only ? (flags | 2) : (flags & ~2); -flags = tcpo_only ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -ipv6 = (flags & 1) != 0; -media_only = (flags & 2) != 0; -tcpo_only = (flags & 4) != 0; -id = br.ReadInt32(); -ip_address = StringUtil.Deserialize(br); -port = br.ReadInt32(); - + ipv6 = (flags & 1) != 0; + media_only = (flags & 2) != 0; + tcpo_only = (flags & 4) != 0; + id = br.ReadInt32(); + ip_address = StringUtil.Deserialize(br); + port = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - -bw.Write(id); -StringUtil.Serialize(ip_address,bw); -bw.Write(port); - + bw.Write(id); + StringUtil.Serialize(ip_address, bw); + bw.Write(port); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDialog.cs b/TeleSharp.TL/TL/TLDialog.cs index 33578e6..f0cf07f 100644 --- a/TeleSharp.TL/TL/TLDialog.cs +++ b/TeleSharp.TL/TL/TLDialog.cs @@ -1,80 +1,65 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1728035348)] + [TLObject(1728035348)] public class TLDialog : TLObject { - public override int Constructor + public override int Constructor => 1728035348; + + public int flags { get; set; } + public TLAbsPeer peer { get; set; } + public int top_message { get; set; } + public int read_inbox_max_id { get; set; } + public int read_outbox_max_id { get; set; } + public int unread_count { get; set; } + public TLAbsPeerNotifySettings notify_settings { get; set; } + public int? pts { get; set; } + public TLAbsDraftMessage draft { get; set; } + + + public void ComputeFlags() { - get - { - return 1728035348; - } + flags = 0; + flags = pts != null ? flags | 1 : flags & ~1; + flags = draft != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public TLAbsPeer peer {get;set;} - public int top_message {get;set;} - public int read_inbox_max_id {get;set;} - public int read_outbox_max_id {get;set;} - public int unread_count {get;set;} - public TLAbsPeerNotifySettings notify_settings {get;set;} - public int? pts {get;set;} - public TLAbsDraftMessage draft {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = pts != null ? (flags | 1) : (flags & ~1); -flags = draft != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -top_message = br.ReadInt32(); -read_inbox_max_id = br.ReadInt32(); -read_outbox_max_id = br.ReadInt32(); -unread_count = br.ReadInt32(); -notify_settings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -pts = br.ReadInt32(); -else -pts = null; - -if ((flags & 2) != 0) -draft = (TLAbsDraftMessage)ObjectUtils.DeserializeObject(br); -else -draft = null; - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + top_message = br.ReadInt32(); + read_inbox_max_id = br.ReadInt32(); + read_outbox_max_id = br.ReadInt32(); + unread_count = br.ReadInt32(); + notify_settings = (TLAbsPeerNotifySettings) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + pts = br.ReadInt32(); + else + pts = null; + if ((flags & 2) != 0) + draft = (TLAbsDraftMessage) ObjectUtils.DeserializeObject(br); + else + draft = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(peer,bw); -bw.Write(top_message); -bw.Write(read_inbox_max_id); -bw.Write(read_outbox_max_id); -bw.Write(unread_count); -ObjectUtils.SerializeObject(notify_settings,bw); -if ((flags & 1) != 0) -bw.Write(pts.Value); -if ((flags & 2) != 0) -ObjectUtils.SerializeObject(draft,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(top_message); + bw.Write(read_inbox_max_id); + bw.Write(read_outbox_max_id); + bw.Write(unread_count); + ObjectUtils.SerializeObject(notify_settings, bw); + if ((flags & 1) != 0) + bw.Write(pts.Value); + if ((flags & 2) != 0) + ObjectUtils.SerializeObject(draft, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDisabledFeature.cs b/TeleSharp.TL/TL/TLDisabledFeature.cs index 6e35761..bba4943 100644 --- a/TeleSharp.TL/TL/TLDisabledFeature.cs +++ b/TeleSharp.TL/TL/TLDisabledFeature.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1369215196)] + [TLObject(-1369215196)] public class TLDisabledFeature : TLObject { - public override int Constructor + public override int Constructor => -1369215196; + + public string feature { get; set; } + public string description { get; set; } + + + public void ComputeFlags() { - get - { - return -1369215196; - } } - public string feature {get;set;} - public string description {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { feature = StringUtil.Deserialize(br); -description = StringUtil.Deserialize(br); - + description = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(feature,bw); -StringUtil.Serialize(description,bw); - + bw.Write(Constructor); + StringUtil.Serialize(feature, bw); + StringUtil.Serialize(description, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocument.cs b/TeleSharp.TL/TL/TLDocument.cs index fe64f1e..464c539 100644 --- a/TeleSharp.TL/TL/TLDocument.cs +++ b/TeleSharp.TL/TL/TLDocument.cs @@ -1,66 +1,52 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2027738169)] + [TLObject(-2027738169)] public class TLDocument : TLAbsDocument { - public override int Constructor + public override int Constructor => -2027738169; + + public long id { get; set; } + public long access_hash { get; set; } + public int date { get; set; } + public string mime_type { get; set; } + public int size { get; set; } + public TLAbsPhotoSize thumb { get; set; } + public int dc_id { get; set; } + public int version { get; set; } + public TLVector attributes { get; set; } + + + public void ComputeFlags() { - get - { - return -2027738169; - } } - public long id {get;set;} - public long access_hash {get;set;} - public int date {get;set;} - public string mime_type {get;set;} - public int size {get;set;} - public TLAbsPhotoSize thumb {get;set;} - public int dc_id {get;set;} - public int version {get;set;} - public TLVector attributes {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); -date = br.ReadInt32(); -mime_type = StringUtil.Deserialize(br); -size = br.ReadInt32(); -thumb = (TLAbsPhotoSize)ObjectUtils.DeserializeObject(br); -dc_id = br.ReadInt32(); -version = br.ReadInt32(); -attributes = (TLVector)ObjectUtils.DeserializeVector(br); - + access_hash = br.ReadInt64(); + date = br.ReadInt32(); + mime_type = StringUtil.Deserialize(br); + size = br.ReadInt32(); + thumb = (TLAbsPhotoSize) ObjectUtils.DeserializeObject(br); + dc_id = br.ReadInt32(); + version = br.ReadInt32(); + attributes = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); -bw.Write(date); -StringUtil.Serialize(mime_type,bw); -bw.Write(size); -ObjectUtils.SerializeObject(thumb,bw); -bw.Write(dc_id); -bw.Write(version); -ObjectUtils.SerializeObject(attributes,bw); - + bw.Write(access_hash); + bw.Write(date); + StringUtil.Serialize(mime_type, bw); + bw.Write(size); + ObjectUtils.SerializeObject(thumb, bw); + bw.Write(dc_id); + bw.Write(version); + ObjectUtils.SerializeObject(attributes, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs b/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs index 0d0159d..84db238 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(297109817)] + [TLObject(297109817)] public class TLDocumentAttributeAnimated : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => 297109817; + + + public void ComputeFlags() { - get - { - return 297109817; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs b/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs index 7c6be47..04e8a8e 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs @@ -1,78 +1,63 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1739392570)] + [TLObject(-1739392570)] public class TLDocumentAttributeAudio : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => -1739392570; + + public int flags { get; set; } + public bool voice { get; set; } + public int duration { get; set; } + public string title { get; set; } + public string performer { get; set; } + public byte[] waveform { get; set; } + + + public void ComputeFlags() { - get - { - return -1739392570; - } + flags = 0; + flags = voice ? flags | 1024 : flags & ~1024; + flags = title != null ? flags | 1 : flags & ~1; + flags = performer != null ? flags | 2 : flags & ~2; + flags = waveform != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool voice {get;set;} - public int duration {get;set;} - public string title {get;set;} - public string performer {get;set;} - public byte[] waveform {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = voice ? (flags | 1024) : (flags & ~1024); -flags = title != null ? (flags | 1) : (flags & ~1); -flags = performer != null ? (flags | 2) : (flags & ~2); -flags = waveform != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -voice = (flags & 1024) != 0; -duration = br.ReadInt32(); -if ((flags & 1) != 0) -title = StringUtil.Deserialize(br); -else -title = null; - -if ((flags & 2) != 0) -performer = StringUtil.Deserialize(br); -else -performer = null; - -if ((flags & 4) != 0) -waveform = BytesUtil.Deserialize(br); -else -waveform = null; + voice = (flags & 1024) != 0; + duration = br.ReadInt32(); + if ((flags & 1) != 0) + title = StringUtil.Deserialize(br); + else + title = null; + if ((flags & 2) != 0) + performer = StringUtil.Deserialize(br); + else + performer = null; + if ((flags & 4) != 0) + waveform = BytesUtil.Deserialize(br); + else + waveform = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(duration); -if ((flags & 1) != 0) -StringUtil.Serialize(title,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(performer,bw); -if ((flags & 4) != 0) -BytesUtil.Serialize(waveform,bw); + bw.Write(flags); + bw.Write(duration); + if ((flags & 1) != 0) + StringUtil.Serialize(title, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(performer, bw); + if ((flags & 4) != 0) + BytesUtil.Serialize(waveform, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs b/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs index 5b41c66..464b3b3 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(358154344)] + [TLObject(358154344)] public class TLDocumentAttributeFilename : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => 358154344; + + public string file_name { get; set; } + + + public void ComputeFlags() { - get - { - return 358154344; - } } - public string file_name {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { file_name = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(file_name,bw); - + bw.Write(Constructor); + StringUtil.Serialize(file_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs b/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs index 706cfaa..5a2889c 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1744710921)] + [TLObject(-1744710921)] public class TLDocumentAttributeHasStickers : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => -1744710921; + + + public void ComputeFlags() { - get - { - return -1744710921; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs b/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs index bba7e08..735429f 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1815593308)] + [TLObject(1815593308)] public class TLDocumentAttributeImageSize : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => 1815593308; + + public int w { get; set; } + public int h { get; set; } + + + public void ComputeFlags() { - get - { - return 1815593308; - } } - public int w {get;set;} - public int h {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { w = br.ReadInt32(); -h = br.ReadInt32(); - + h = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(w); -bw.Write(h); - + bw.Write(h); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs b/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs index 3c784c8..f706a8b 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs @@ -1,63 +1,48 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1662637586)] + [TLObject(1662637586)] public class TLDocumentAttributeSticker : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => 1662637586; + + public int flags { get; set; } + public bool mask { get; set; } + public string alt { get; set; } + public TLAbsInputStickerSet stickerset { get; set; } + public TLMaskCoords mask_coords { get; set; } + + + public void ComputeFlags() { - get - { - return 1662637586; - } + flags = 0; + flags = mask ? flags | 2 : flags & ~2; + flags = mask_coords != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool mask {get;set;} - public string alt {get;set;} - public TLAbsInputStickerSet stickerset {get;set;} - public TLMaskCoords mask_coords {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = mask ? (flags | 2) : (flags & ~2); -flags = mask_coords != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -mask = (flags & 2) != 0; -alt = StringUtil.Deserialize(br); -stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -mask_coords = (TLMaskCoords)ObjectUtils.DeserializeObject(br); -else -mask_coords = null; - - + mask = (flags & 2) != 0; + alt = StringUtil.Deserialize(br); + stickerset = (TLAbsInputStickerSet) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + mask_coords = (TLMaskCoords) ObjectUtils.DeserializeObject(br); + else + mask_coords = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(alt,bw); -ObjectUtils.SerializeObject(stickerset,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(mask_coords,bw); + bw.Write(flags); + StringUtil.Serialize(alt, bw); + ObjectUtils.SerializeObject(stickerset, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(mask_coords, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs b/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs index 899001e..4dfbbda 100644 --- a/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs +++ b/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1494273227)] + [TLObject(1494273227)] public class TLDocumentAttributeVideo : TLAbsDocumentAttribute { - public override int Constructor + public override int Constructor => 1494273227; + + public int duration { get; set; } + public int w { get; set; } + public int h { get; set; } + + + public void ComputeFlags() { - get - { - return 1494273227; - } } - public int duration {get;set;} - public int w {get;set;} - public int h {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { duration = br.ReadInt32(); -w = br.ReadInt32(); -h = br.ReadInt32(); - + w = br.ReadInt32(); + h = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(duration); -bw.Write(w); -bw.Write(h); - + bw.Write(w); + bw.Write(h); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDocumentEmpty.cs b/TeleSharp.TL/TL/TLDocumentEmpty.cs index 9b50832..dcd99ba 100644 --- a/TeleSharp.TL/TL/TLDocumentEmpty.cs +++ b/TeleSharp.TL/TL/TLDocumentEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(922273905)] + [TLObject(922273905)] public class TLDocumentEmpty : TLAbsDocument { - public override int Constructor + public override int Constructor => 922273905; + + public long id { get; set; } + + + public void ComputeFlags() { - get - { - return 922273905; - } } - public long id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDraftMessage.cs b/TeleSharp.TL/TL/TLDraftMessage.cs index 80ed9aa..80f0f99 100644 --- a/TeleSharp.TL/TL/TLDraftMessage.cs +++ b/TeleSharp.TL/TL/TLDraftMessage.cs @@ -1,72 +1,58 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-40996577)] + [TLObject(-40996577)] public class TLDraftMessage : TLAbsDraftMessage { - public override int Constructor + public override int Constructor => -40996577; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public int? reply_to_msg_id { get; set; } + public string message { get; set; } + public TLVector entities { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -40996577; - } + flags = 0; + flags = no_webpage ? flags | 2 : flags & ~2; + flags = reply_to_msg_id != null ? flags | 1 : flags & ~1; + flags = entities != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public int? reply_to_msg_id {get;set;} - public string message {get;set;} - public TLVector entities {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 2) : (flags & ~2); -flags = reply_to_msg_id != null ? (flags | 1) : (flags & ~1); -flags = entities != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 2) != 0; -if ((flags & 1) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; + no_webpage = (flags & 2) != 0; + if ((flags & 1) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; -message = StringUtil.Deserialize(br); -if ((flags & 8) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; - -date = br.ReadInt32(); + message = StringUtil.Deserialize(br); + if ((flags & 8) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -if ((flags & 1) != 0) -bw.Write(reply_to_msg_id.Value); -StringUtil.Serialize(message,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(entities,bw); -bw.Write(date); + bw.Write(flags); + if ((flags & 1) != 0) + bw.Write(reply_to_msg_id.Value); + StringUtil.Serialize(message, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(entities, bw); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLDraftMessageEmpty.cs b/TeleSharp.TL/TL/TLDraftMessageEmpty.cs index 4c99e53..fbc9794 100644 --- a/TeleSharp.TL/TL/TLDraftMessageEmpty.cs +++ b/TeleSharp.TL/TL/TLDraftMessageEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1169445179)] + [TLObject(-1169445179)] public class TLDraftMessageEmpty : TLAbsDraftMessage { - public override int Constructor + public override int Constructor => -1169445179; + + + public void ComputeFlags() { - get - { - return -1169445179; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedChat.cs b/TeleSharp.TL/TL/TLEncryptedChat.cs index 47a9821..7acd138 100644 --- a/TeleSharp.TL/TL/TLEncryptedChat.cs +++ b/TeleSharp.TL/TL/TLEncryptedChat.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-94974410)] + [TLObject(-94974410)] public class TLEncryptedChat : TLAbsEncryptedChat { - public override int Constructor + public override int Constructor => -94974410; + + public int id { get; set; } + public long access_hash { get; set; } + public int date { get; set; } + public int admin_id { get; set; } + public int participant_id { get; set; } + public byte[] g_a_or_b { get; set; } + public long key_fingerprint { get; set; } + + + public void ComputeFlags() { - get - { - return -94974410; - } } - public int id {get;set;} - public long access_hash {get;set;} - public int date {get;set;} - public int admin_id {get;set;} - public int participant_id {get;set;} - public byte[] g_a_or_b {get;set;} - public long key_fingerprint {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -access_hash = br.ReadInt64(); -date = br.ReadInt32(); -admin_id = br.ReadInt32(); -participant_id = br.ReadInt32(); -g_a_or_b = BytesUtil.Deserialize(br); -key_fingerprint = br.ReadInt64(); - + access_hash = br.ReadInt64(); + date = br.ReadInt32(); + admin_id = br.ReadInt32(); + participant_id = br.ReadInt32(); + g_a_or_b = BytesUtil.Deserialize(br); + key_fingerprint = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); -bw.Write(date); -bw.Write(admin_id); -bw.Write(participant_id); -BytesUtil.Serialize(g_a_or_b,bw); -bw.Write(key_fingerprint); - + bw.Write(access_hash); + bw.Write(date); + bw.Write(admin_id); + bw.Write(participant_id); + BytesUtil.Serialize(g_a_or_b, bw); + bw.Write(key_fingerprint); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs b/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs index f77be4b..93e79de 100644 --- a/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs +++ b/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(332848423)] + [TLObject(332848423)] public class TLEncryptedChatDiscarded : TLAbsEncryptedChat { - public override int Constructor + public override int Constructor => 332848423; + + public int id { get; set; } + + + public void ComputeFlags() { - get - { - return 332848423; - } } - public int id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs b/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs index ade6345..c9cdada 100644 --- a/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs +++ b/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1417756512)] + [TLObject(-1417756512)] public class TLEncryptedChatEmpty : TLAbsEncryptedChat { - public override int Constructor + public override int Constructor => -1417756512; + + public int id { get; set; } + + + public void ComputeFlags() { - get - { - return -1417756512; - } } - public int id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedChatRequested.cs b/TeleSharp.TL/TL/TLEncryptedChatRequested.cs index 3d6a10e..98c7db6 100644 --- a/TeleSharp.TL/TL/TLEncryptedChatRequested.cs +++ b/TeleSharp.TL/TL/TLEncryptedChatRequested.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-931638658)] + [TLObject(-931638658)] public class TLEncryptedChatRequested : TLAbsEncryptedChat { - public override int Constructor + public override int Constructor => -931638658; + + public int id { get; set; } + public long access_hash { get; set; } + public int date { get; set; } + public int admin_id { get; set; } + public int participant_id { get; set; } + public byte[] g_a { get; set; } + + + public void ComputeFlags() { - get - { - return -931638658; - } } - public int id {get;set;} - public long access_hash {get;set;} - public int date {get;set;} - public int admin_id {get;set;} - public int participant_id {get;set;} - public byte[] g_a {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -access_hash = br.ReadInt64(); -date = br.ReadInt32(); -admin_id = br.ReadInt32(); -participant_id = br.ReadInt32(); -g_a = BytesUtil.Deserialize(br); - + access_hash = br.ReadInt64(); + date = br.ReadInt32(); + admin_id = br.ReadInt32(); + participant_id = br.ReadInt32(); + g_a = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); -bw.Write(date); -bw.Write(admin_id); -bw.Write(participant_id); -BytesUtil.Serialize(g_a,bw); - + bw.Write(access_hash); + bw.Write(date); + bw.Write(admin_id); + bw.Write(participant_id); + BytesUtil.Serialize(g_a, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs b/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs index 7a1e308..0a349f8 100644 --- a/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs +++ b/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1006044124)] + [TLObject(1006044124)] public class TLEncryptedChatWaiting : TLAbsEncryptedChat { - public override int Constructor + public override int Constructor => 1006044124; + + public int id { get; set; } + public long access_hash { get; set; } + public int date { get; set; } + public int admin_id { get; set; } + public int participant_id { get; set; } + + + public void ComputeFlags() { - get - { - return 1006044124; - } } - public int id {get;set;} - public long access_hash {get;set;} - public int date {get;set;} - public int admin_id {get;set;} - public int participant_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -access_hash = br.ReadInt64(); -date = br.ReadInt32(); -admin_id = br.ReadInt32(); -participant_id = br.ReadInt32(); - + access_hash = br.ReadInt64(); + date = br.ReadInt32(); + admin_id = br.ReadInt32(); + participant_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); -bw.Write(date); -bw.Write(admin_id); -bw.Write(participant_id); - + bw.Write(access_hash); + bw.Write(date); + bw.Write(admin_id); + bw.Write(participant_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedFile.cs b/TeleSharp.TL/TL/TLEncryptedFile.cs index fc6fd67..077a566 100644 --- a/TeleSharp.TL/TL/TLEncryptedFile.cs +++ b/TeleSharp.TL/TL/TLEncryptedFile.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1248893260)] + [TLObject(1248893260)] public class TLEncryptedFile : TLAbsEncryptedFile { - public override int Constructor + public override int Constructor => 1248893260; + + public long id { get; set; } + public long access_hash { get; set; } + public int size { get; set; } + public int dc_id { get; set; } + public int key_fingerprint { get; set; } + + + public void ComputeFlags() { - get - { - return 1248893260; - } } - public long id {get;set;} - public long access_hash {get;set;} - public int size {get;set;} - public int dc_id {get;set;} - public int key_fingerprint {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); -size = br.ReadInt32(); -dc_id = br.ReadInt32(); -key_fingerprint = br.ReadInt32(); - + access_hash = br.ReadInt64(); + size = br.ReadInt32(); + dc_id = br.ReadInt32(); + key_fingerprint = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); -bw.Write(size); -bw.Write(dc_id); -bw.Write(key_fingerprint); - + bw.Write(access_hash); + bw.Write(size); + bw.Write(dc_id); + bw.Write(key_fingerprint); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs b/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs index 91b1fed..45998cd 100644 --- a/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs +++ b/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1038136962)] + [TLObject(-1038136962)] public class TLEncryptedFileEmpty : TLAbsEncryptedFile { - public override int Constructor + public override int Constructor => -1038136962; + + + public void ComputeFlags() { - get - { - return -1038136962; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedMessage.cs b/TeleSharp.TL/TL/TLEncryptedMessage.cs index 6b834a4..1af561b 100644 --- a/TeleSharp.TL/TL/TLEncryptedMessage.cs +++ b/TeleSharp.TL/TL/TLEncryptedMessage.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-317144808)] + [TLObject(-317144808)] public class TLEncryptedMessage : TLAbsEncryptedMessage { - public override int Constructor + public override int Constructor => -317144808; + + public long random_id { get; set; } + public int chat_id { get; set; } + public int date { get; set; } + public byte[] bytes { get; set; } + public TLAbsEncryptedFile file { get; set; } + + + public void ComputeFlags() { - get - { - return -317144808; - } } - public long random_id {get;set;} - public int chat_id {get;set;} - public int date {get;set;} - public byte[] bytes {get;set;} - public TLAbsEncryptedFile file {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { random_id = br.ReadInt64(); -chat_id = br.ReadInt32(); -date = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); -file = (TLAbsEncryptedFile)ObjectUtils.DeserializeObject(br); - + chat_id = br.ReadInt32(); + date = br.ReadInt32(); + bytes = BytesUtil.Deserialize(br); + file = (TLAbsEncryptedFile) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(random_id); -bw.Write(chat_id); -bw.Write(date); -BytesUtil.Serialize(bytes,bw); -ObjectUtils.SerializeObject(file,bw); - + bw.Write(chat_id); + bw.Write(date); + BytesUtil.Serialize(bytes, bw); + ObjectUtils.SerializeObject(file, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLEncryptedMessageService.cs b/TeleSharp.TL/TL/TLEncryptedMessageService.cs index 643fd12..afbc906 100644 --- a/TeleSharp.TL/TL/TLEncryptedMessageService.cs +++ b/TeleSharp.TL/TL/TLEncryptedMessageService.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(594758406)] + [TLObject(594758406)] public class TLEncryptedMessageService : TLAbsEncryptedMessage { - public override int Constructor + public override int Constructor => 594758406; + + public long random_id { get; set; } + public int chat_id { get; set; } + public int date { get; set; } + public byte[] bytes { get; set; } + + + public void ComputeFlags() { - get - { - return 594758406; - } } - public long random_id {get;set;} - public int chat_id {get;set;} - public int date {get;set;} - public byte[] bytes {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { random_id = br.ReadInt64(); -chat_id = br.ReadInt32(); -date = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + chat_id = br.ReadInt32(); + date = br.ReadInt32(); + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(random_id); -bw.Write(chat_id); -bw.Write(date); -BytesUtil.Serialize(bytes,bw); - + bw.Write(chat_id); + bw.Write(date); + BytesUtil.Serialize(bytes, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLError.cs b/TeleSharp.TL/TL/TLError.cs index 73dab0a..eb543d5 100644 --- a/TeleSharp.TL/TL/TLError.cs +++ b/TeleSharp.TL/TL/TLError.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-994444869)] + [TLObject(-994444869)] public class TLError : TLObject { - public override int Constructor + public override int Constructor => -994444869; + + public int code { get; set; } + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -994444869; - } } - public int code {get;set;} - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { code = br.ReadInt32(); -text = StringUtil.Deserialize(br); - + text = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(code); -StringUtil.Serialize(text,bw); - + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLExportedMessageLink.cs b/TeleSharp.TL/TL/TLExportedMessageLink.cs index 47df36c..d9bdc51 100644 --- a/TeleSharp.TL/TL/TLExportedMessageLink.cs +++ b/TeleSharp.TL/TL/TLExportedMessageLink.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(524838915)] + [TLObject(524838915)] public class TLExportedMessageLink : TLObject { - public override int Constructor + public override int Constructor => 524838915; + + public string link { get; set; } + + + public void ComputeFlags() { - get - { - return 524838915; - } } - public string link {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { link = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(link,bw); - + bw.Write(Constructor); + StringUtil.Serialize(link, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLFileLocation.cs b/TeleSharp.TL/TL/TLFileLocation.cs index 41b7c83..4e5c7cc 100644 --- a/TeleSharp.TL/TL/TLFileLocation.cs +++ b/TeleSharp.TL/TL/TLFileLocation.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1406570614)] + [TLObject(1406570614)] public class TLFileLocation : TLAbsFileLocation { - public override int Constructor + public override int Constructor => 1406570614; + + public int dc_id { get; set; } + public long volume_id { get; set; } + public int local_id { get; set; } + public long secret { get; set; } + + + public void ComputeFlags() { - get - { - return 1406570614; - } } - public int dc_id {get;set;} - public long volume_id {get;set;} - public int local_id {get;set;} - public long secret {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { dc_id = br.ReadInt32(); -volume_id = br.ReadInt64(); -local_id = br.ReadInt32(); -secret = br.ReadInt64(); - + volume_id = br.ReadInt64(); + local_id = br.ReadInt32(); + secret = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(dc_id); -bw.Write(volume_id); -bw.Write(local_id); -bw.Write(secret); - + bw.Write(volume_id); + bw.Write(local_id); + bw.Write(secret); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLFileLocationUnavailable.cs b/TeleSharp.TL/TL/TLFileLocationUnavailable.cs index 0c848df..7a11a4a 100644 --- a/TeleSharp.TL/TL/TLFileLocationUnavailable.cs +++ b/TeleSharp.TL/TL/TLFileLocationUnavailable.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2086234950)] + [TLObject(2086234950)] public class TLFileLocationUnavailable : TLAbsFileLocation { - public override int Constructor + public override int Constructor => 2086234950; + + public long volume_id { get; set; } + public int local_id { get; set; } + public long secret { get; set; } + + + public void ComputeFlags() { - get - { - return 2086234950; - } } - public long volume_id {get;set;} - public int local_id {get;set;} - public long secret {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { volume_id = br.ReadInt64(); -local_id = br.ReadInt32(); -secret = br.ReadInt64(); - + local_id = br.ReadInt32(); + secret = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(volume_id); -bw.Write(local_id); -bw.Write(secret); - + bw.Write(local_id); + bw.Write(secret); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLFoundGif.cs b/TeleSharp.TL/TL/TLFoundGif.cs index d8b4c4d..1bb42ca 100644 --- a/TeleSharp.TL/TL/TLFoundGif.cs +++ b/TeleSharp.TL/TL/TLFoundGif.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(372165663)] + [TLObject(372165663)] public class TLFoundGif : TLAbsFoundGif { - public override int Constructor + public override int Constructor => 372165663; + + public string url { get; set; } + public string thumb_url { get; set; } + public string content_url { get; set; } + public string content_type { get; set; } + public int w { get; set; } + public int h { get; set; } + + + public void ComputeFlags() { - get - { - return 372165663; - } } - public string url {get;set;} - public string thumb_url {get;set;} - public string content_url {get;set;} - public string content_type {get;set;} - public int w {get;set;} - public int h {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { url = StringUtil.Deserialize(br); -thumb_url = StringUtil.Deserialize(br); -content_url = StringUtil.Deserialize(br); -content_type = StringUtil.Deserialize(br); -w = br.ReadInt32(); -h = br.ReadInt32(); - + thumb_url = StringUtil.Deserialize(br); + content_url = StringUtil.Deserialize(br); + content_type = StringUtil.Deserialize(br); + w = br.ReadInt32(); + h = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(url,bw); -StringUtil.Serialize(thumb_url,bw); -StringUtil.Serialize(content_url,bw); -StringUtil.Serialize(content_type,bw); -bw.Write(w); -bw.Write(h); - + bw.Write(Constructor); + StringUtil.Serialize(url, bw); + StringUtil.Serialize(thumb_url, bw); + StringUtil.Serialize(content_url, bw); + StringUtil.Serialize(content_type, bw); + bw.Write(w); + bw.Write(h); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLFoundGifCached.cs b/TeleSharp.TL/TL/TLFoundGifCached.cs index af1a4f1..cb8435c 100644 --- a/TeleSharp.TL/TL/TLFoundGifCached.cs +++ b/TeleSharp.TL/TL/TLFoundGifCached.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1670052855)] + [TLObject(-1670052855)] public class TLFoundGifCached : TLAbsFoundGif { - public override int Constructor + public override int Constructor => -1670052855; + + public string url { get; set; } + public TLAbsPhoto photo { get; set; } + public TLAbsDocument document { get; set; } + + + public void ComputeFlags() { - get - { - return -1670052855; - } } - public string url {get;set;} - public TLAbsPhoto photo {get;set;} - public TLAbsDocument document {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { url = StringUtil.Deserialize(br); -photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + document = (TLAbsDocument) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(url,bw); -ObjectUtils.SerializeObject(photo,bw); -ObjectUtils.SerializeObject(document,bw); - + bw.Write(Constructor); + StringUtil.Serialize(url, bw); + ObjectUtils.SerializeObject(photo, bw); + ObjectUtils.SerializeObject(document, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLGame.cs b/TeleSharp.TL/TL/TLGame.cs index 3ffebf3..2d3a47b 100644 --- a/TeleSharp.TL/TL/TLGame.cs +++ b/TeleSharp.TL/TL/TLGame.cs @@ -1,71 +1,56 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1107729093)] + [TLObject(-1107729093)] public class TLGame : TLObject { - public override int Constructor + public override int Constructor => -1107729093; + + public int flags { get; set; } + public long id { get; set; } + public long access_hash { get; set; } + public string short_name { get; set; } + public string title { get; set; } + public string description { get; set; } + public TLAbsPhoto photo { get; set; } + public TLAbsDocument document { get; set; } + + + public void ComputeFlags() { - get - { - return -1107729093; - } + flags = 0; + flags = document != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public long id {get;set;} - public long access_hash {get;set;} - public string short_name {get;set;} - public string title {get;set;} - public string description {get;set;} - public TLAbsPhoto photo {get;set;} - public TLAbsDocument document {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = document != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -id = br.ReadInt64(); -access_hash = br.ReadInt64(); -short_name = StringUtil.Deserialize(br); -title = StringUtil.Deserialize(br); -description = StringUtil.Deserialize(br); -photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -if ((flags & 1) != 0) -document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); -else -document = null; - - + id = br.ReadInt64(); + access_hash = br.ReadInt64(); + short_name = StringUtil.Deserialize(br); + title = StringUtil.Deserialize(br); + description = StringUtil.Deserialize(br); + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + if ((flags & 1) != 0) + document = (TLAbsDocument) ObjectUtils.DeserializeObject(br); + else + document = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(id); -bw.Write(access_hash); -StringUtil.Serialize(short_name,bw); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(description,bw); -ObjectUtils.SerializeObject(photo,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(document,bw); - + bw.Write(flags); + bw.Write(id); + bw.Write(access_hash); + StringUtil.Serialize(short_name, bw); + StringUtil.Serialize(title, bw); + StringUtil.Serialize(description, bw); + ObjectUtils.SerializeObject(photo, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(document, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLGeoPoint.cs b/TeleSharp.TL/TL/TLGeoPoint.cs index a7a7478..5e808ac 100644 --- a/TeleSharp.TL/TL/TLGeoPoint.cs +++ b/TeleSharp.TL/TL/TLGeoPoint.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(541710092)] + [TLObject(541710092)] public class TLGeoPoint : TLAbsGeoPoint { - public override int Constructor + public override int Constructor => 541710092; + + public double @long { get; set; } + public double lat { get; set; } + + + public void ComputeFlags() { - get - { - return 541710092; - } } - public double @long {get;set;} - public double lat {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { @long = br.ReadDouble(); -lat = br.ReadDouble(); - + lat = br.ReadDouble(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(@long); -bw.Write(lat); - + bw.Write(lat); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLGeoPointEmpty.cs b/TeleSharp.TL/TL/TLGeoPointEmpty.cs index e3e7d7e..a676277 100644 --- a/TeleSharp.TL/TL/TLGeoPointEmpty.cs +++ b/TeleSharp.TL/TL/TLGeoPointEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(286776671)] + [TLObject(286776671)] public class TLGeoPointEmpty : TLAbsGeoPoint { - public override int Constructor + public override int Constructor => 286776671; + + + public void ComputeFlags() { - get - { - return 286776671; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLHighScore.cs b/TeleSharp.TL/TL/TLHighScore.cs index d780248..2939e23 100644 --- a/TeleSharp.TL/TL/TLHighScore.cs +++ b/TeleSharp.TL/TL/TLHighScore.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1493171408)] + [TLObject(1493171408)] public class TLHighScore : TLObject { - public override int Constructor + public override int Constructor => 1493171408; + + public int pos { get; set; } + public int user_id { get; set; } + public int score { get; set; } + + + public void ComputeFlags() { - get - { - return 1493171408; - } } - public int pos {get;set;} - public int user_id {get;set;} - public int score {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { pos = br.ReadInt32(); -user_id = br.ReadInt32(); -score = br.ReadInt32(); - + user_id = br.ReadInt32(); + score = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(pos); -bw.Write(user_id); -bw.Write(score); - + bw.Write(user_id); + bw.Write(score); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLImportedContact.cs b/TeleSharp.TL/TL/TLImportedContact.cs index 0f4189d..bf0151e 100644 --- a/TeleSharp.TL/TL/TLImportedContact.cs +++ b/TeleSharp.TL/TL/TLImportedContact.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-805141448)] + [TLObject(-805141448)] public class TLImportedContact : TLObject { - public override int Constructor + public override int Constructor => -805141448; + + public int user_id { get; set; } + public long client_id { get; set; } + + + public void ComputeFlags() { - get - { - return -805141448; - } } - public int user_id {get;set;} - public long client_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -client_id = br.ReadInt64(); - + client_id = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(client_id); - + bw.Write(client_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs b/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs index 168d719..22a6651 100644 --- a/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs +++ b/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1008755359)] + [TLObject(1008755359)] public class TLInlineBotSwitchPM : TLObject { - public override int Constructor + public override int Constructor => 1008755359; + + public string text { get; set; } + public string start_param { get; set; } + + + public void ComputeFlags() { - get - { - return 1008755359; - } } - public string text {get;set;} - public string start_param {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); -start_param = StringUtil.Deserialize(br); - + start_param = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); -StringUtil.Serialize(start_param,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); + StringUtil.Serialize(start_param, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputAppEvent.cs b/TeleSharp.TL/TL/TLInputAppEvent.cs index 0ce016a..0a49c5e 100644 --- a/TeleSharp.TL/TL/TLInputAppEvent.cs +++ b/TeleSharp.TL/TL/TLInputAppEvent.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1996904104)] + [TLObject(1996904104)] public class TLInputAppEvent : TLObject { - public override int Constructor + public override int Constructor => 1996904104; + + public double time { get; set; } + public string type { get; set; } + public long peer { get; set; } + public string data { get; set; } + + + public void ComputeFlags() { - get - { - return 1996904104; - } } - public double time {get;set;} - public string type {get;set;} - public long peer {get;set;} - public string data {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { time = br.ReadDouble(); -type = StringUtil.Deserialize(br); -peer = br.ReadInt64(); -data = StringUtil.Deserialize(br); - + type = StringUtil.Deserialize(br); + peer = br.ReadInt64(); + data = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(time); -StringUtil.Serialize(type,bw); -bw.Write(peer); -StringUtil.Serialize(data,bw); - + StringUtil.Serialize(type, bw); + bw.Write(peer); + StringUtil.Serialize(data, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs index 719f6f8..f27c7ca 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs @@ -1,53 +1,38 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1262639204)] + [TLObject(1262639204)] public class TLInputBotInlineMessageGame : TLAbsInputBotInlineMessage { - public override int Constructor + public override int Constructor => 1262639204; + + public int flags { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 1262639204; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs index 2942e1d..c27f060 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1995686519)] + [TLObject(-1995686519)] public class TLInputBotInlineMessageID : TLObject { - public override int Constructor + public override int Constructor => -1995686519; + + public int dc_id { get; set; } + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -1995686519; - } } - public int dc_id {get;set;} - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { dc_id = br.ReadInt32(); -id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + id = br.ReadInt64(); + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(dc_id); -bw.Write(id); -bw.Write(access_hash); - + bw.Write(id); + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs index 6c872db..4c213ea 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs @@ -1,56 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(691006739)] + [TLObject(691006739)] public class TLInputBotInlineMessageMediaAuto : TLAbsInputBotInlineMessage { - public override int Constructor + public override int Constructor => 691006739; + + public int flags { get; set; } + public string caption { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 691006739; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public string caption {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -caption = StringUtil.Deserialize(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + caption = StringUtil.Deserialize(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(caption,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + StringUtil.Serialize(caption, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs index b7b8e8a..6875080 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs @@ -1,62 +1,47 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(766443943)] + [TLObject(766443943)] public class TLInputBotInlineMessageMediaContact : TLAbsInputBotInlineMessage { - public override int Constructor + public override int Constructor => 766443943; + + public int flags { get; set; } + public string phone_number { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 766443943; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public string phone_number {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -phone_number = StringUtil.Deserialize(br); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + phone_number = StringUtil.Deserialize(br); + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs index fb5cf6d..cfcce43 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs @@ -1,56 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-190472735)] + [TLObject(-190472735)] public class TLInputBotInlineMessageMediaGeo : TLAbsInputBotInlineMessage { - public override int Constructor + public override int Constructor => -190472735; + + public int flags { get; set; } + public TLAbsInputGeoPoint geo_point { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return -190472735; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public TLAbsInputGeoPoint geo_point {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -geo_point = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + geo_point = (TLAbsInputGeoPoint) ObjectUtils.DeserializeObject(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(geo_point,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(geo_point, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs index bccde0f..4d2d7f8 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs @@ -1,68 +1,53 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1431327288)] + [TLObject(-1431327288)] public class TLInputBotInlineMessageMediaVenue : TLAbsInputBotInlineMessage { - public override int Constructor + public override int Constructor => -1431327288; + + public int flags { get; set; } + public TLAbsInputGeoPoint geo_point { get; set; } + public string title { get; set; } + public string address { get; set; } + public string provider { get; set; } + public string venue_id { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return -1431327288; - } + flags = 0; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public TLAbsInputGeoPoint geo_point {get;set;} - public string title {get;set;} - public string address {get;set;} - public string provider {get;set;} - public string venue_id {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -geo_point = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); -title = StringUtil.Deserialize(br); -address = StringUtil.Deserialize(br); -provider = StringUtil.Deserialize(br); -venue_id = StringUtil.Deserialize(br); -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - - + geo_point = (TLAbsInputGeoPoint) ObjectUtils.DeserializeObject(br); + title = StringUtil.Deserialize(br); + address = StringUtil.Deserialize(br); + provider = StringUtil.Deserialize(br); + venue_id = StringUtil.Deserialize(br); + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(geo_point,bw); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(address,bw); -StringUtil.Serialize(provider,bw); -StringUtil.Serialize(venue_id,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(geo_point, bw); + StringUtil.Serialize(title, bw); + StringUtil.Serialize(address, bw); + StringUtil.Serialize(provider, bw); + StringUtil.Serialize(venue_id, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs b/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs index b2a3224..104a2d6 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs @@ -1,69 +1,54 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1036876423)] + [TLObject(1036876423)] public class TLInputBotInlineMessageText : TLAbsInputBotInlineMessage { - public override int Constructor + public override int Constructor => 1036876423; + + public int flags { get; set; } + public bool no_webpage { get; set; } + public string message { get; set; } + public TLVector entities { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + + + public void ComputeFlags() { - get - { - return 1036876423; - } + flags = 0; + flags = no_webpage ? flags | 1 : flags & ~1; + flags = entities != null ? flags | 2 : flags & ~2; + flags = reply_markup != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool no_webpage {get;set;} - public string message {get;set;} - public TLVector entities {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = no_webpage ? (flags | 1) : (flags & ~1); -flags = entities != null ? (flags | 2) : (flags & ~2); -flags = reply_markup != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -no_webpage = (flags & 1) != 0; -message = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; - -if ((flags & 4) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; - + no_webpage = (flags & 1) != 0; + message = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; + if ((flags & 4) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(message,bw); -if ((flags & 2) != 0) -ObjectUtils.SerializeObject(entities,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); + bw.Write(flags); + StringUtil.Serialize(message, bw); + if ((flags & 2) != 0) + ObjectUtils.SerializeObject(entities, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineResult.cs b/TeleSharp.TL/TL/TLInputBotInlineResult.cs index cc2d640..babb929 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineResult.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineResult.cs @@ -1,134 +1,120 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(750510426)] + [TLObject(750510426)] public class TLInputBotInlineResult : TLAbsInputBotInlineResult { - public override int Constructor + public override int Constructor => 750510426; + + public int flags { get; set; } + public string id { get; set; } + public string type { get; set; } + public string title { get; set; } + public string description { get; set; } + public string url { get; set; } + public string thumb_url { get; set; } + public string content_url { get; set; } + public string content_type { get; set; } + public int? w { get; set; } + public int? h { get; set; } + public int? duration { get; set; } + public TLAbsInputBotInlineMessage send_message { get; set; } + + + public void ComputeFlags() { - get - { - return 750510426; - } + flags = 0; + flags = title != null ? flags | 2 : flags & ~2; + flags = description != null ? flags | 4 : flags & ~4; + flags = url != null ? flags | 8 : flags & ~8; + flags = thumb_url != null ? flags | 16 : flags & ~16; + flags = content_url != null ? flags | 32 : flags & ~32; + flags = content_type != null ? flags | 32 : flags & ~32; + flags = w != null ? flags | 64 : flags & ~64; + flags = h != null ? flags | 64 : flags & ~64; + flags = duration != null ? flags | 128 : flags & ~128; } - public int flags {get;set;} - public string id {get;set;} - public string type {get;set;} - public string title {get;set;} - public string description {get;set;} - public string url {get;set;} - public string thumb_url {get;set;} - public string content_url {get;set;} - public string content_type {get;set;} - public int? w {get;set;} - public int? h {get;set;} - public int? duration {get;set;} - public TLAbsInputBotInlineMessage send_message {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = title != null ? (flags | 2) : (flags & ~2); -flags = description != null ? (flags | 4) : (flags & ~4); -flags = url != null ? (flags | 8) : (flags & ~8); -flags = thumb_url != null ? (flags | 16) : (flags & ~16); -flags = content_url != null ? (flags | 32) : (flags & ~32); -flags = content_type != null ? (flags | 32) : (flags & ~32); -flags = w != null ? (flags | 64) : (flags & ~64); -flags = h != null ? (flags | 64) : (flags & ~64); -flags = duration != null ? (flags | 128) : (flags & ~128); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -id = StringUtil.Deserialize(br); -type = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -title = StringUtil.Deserialize(br); -else -title = null; + id = StringUtil.Deserialize(br); + type = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + title = StringUtil.Deserialize(br); + else + title = null; -if ((flags & 4) != 0) -description = StringUtil.Deserialize(br); -else -description = null; + if ((flags & 4) != 0) + description = StringUtil.Deserialize(br); + else + description = null; -if ((flags & 8) != 0) -url = StringUtil.Deserialize(br); -else -url = null; + if ((flags & 8) != 0) + url = StringUtil.Deserialize(br); + else + url = null; -if ((flags & 16) != 0) -thumb_url = StringUtil.Deserialize(br); -else -thumb_url = null; + if ((flags & 16) != 0) + thumb_url = StringUtil.Deserialize(br); + else + thumb_url = null; -if ((flags & 32) != 0) -content_url = StringUtil.Deserialize(br); -else -content_url = null; + if ((flags & 32) != 0) + content_url = StringUtil.Deserialize(br); + else + content_url = null; -if ((flags & 32) != 0) -content_type = StringUtil.Deserialize(br); -else -content_type = null; + if ((flags & 32) != 0) + content_type = StringUtil.Deserialize(br); + else + content_type = null; -if ((flags & 64) != 0) -w = br.ReadInt32(); -else -w = null; + if ((flags & 64) != 0) + w = br.ReadInt32(); + else + w = null; -if ((flags & 64) != 0) -h = br.ReadInt32(); -else -h = null; + if ((flags & 64) != 0) + h = br.ReadInt32(); + else + h = null; -if ((flags & 128) != 0) -duration = br.ReadInt32(); -else -duration = null; - -send_message = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); + if ((flags & 128) != 0) + duration = br.ReadInt32(); + else + duration = null; + send_message = (TLAbsInputBotInlineMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(id,bw); -StringUtil.Serialize(type,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(title,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(description,bw); -if ((flags & 8) != 0) -StringUtil.Serialize(url,bw); -if ((flags & 16) != 0) -StringUtil.Serialize(thumb_url,bw); -if ((flags & 32) != 0) -StringUtil.Serialize(content_url,bw); -if ((flags & 32) != 0) -StringUtil.Serialize(content_type,bw); -if ((flags & 64) != 0) -bw.Write(w.Value); -if ((flags & 64) != 0) -bw.Write(h.Value); -if ((flags & 128) != 0) -bw.Write(duration.Value); -ObjectUtils.SerializeObject(send_message,bw); - + bw.Write(flags); + StringUtil.Serialize(id, bw); + StringUtil.Serialize(type, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(title, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(description, bw); + if ((flags & 8) != 0) + StringUtil.Serialize(url, bw); + if ((flags & 16) != 0) + StringUtil.Serialize(thumb_url, bw); + if ((flags & 32) != 0) + StringUtil.Serialize(content_url, bw); + if ((flags & 32) != 0) + StringUtil.Serialize(content_type, bw); + if ((flags & 64) != 0) + bw.Write(w.Value); + if ((flags & 64) != 0) + bw.Write(h.Value); + if ((flags & 128) != 0) + bw.Write(duration.Value); + ObjectUtils.SerializeObject(send_message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs b/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs index 8a66ef1..bc4b480 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs @@ -1,74 +1,60 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-459324)] + [TLObject(-459324)] public class TLInputBotInlineResultDocument : TLAbsInputBotInlineResult { - public override int Constructor + public override int Constructor => -459324; + + public int flags { get; set; } + public string id { get; set; } + public string type { get; set; } + public string title { get; set; } + public string description { get; set; } + public TLAbsInputDocument document { get; set; } + public TLAbsInputBotInlineMessage send_message { get; set; } + + + public void ComputeFlags() { - get - { - return -459324; - } + flags = 0; + flags = title != null ? flags | 2 : flags & ~2; + flags = description != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public string id {get;set;} - public string type {get;set;} - public string title {get;set;} - public string description {get;set;} - public TLAbsInputDocument document {get;set;} - public TLAbsInputBotInlineMessage send_message {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = title != null ? (flags | 2) : (flags & ~2); -flags = description != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -id = StringUtil.Deserialize(br); -type = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -title = StringUtil.Deserialize(br); -else -title = null; + id = StringUtil.Deserialize(br); + type = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + title = StringUtil.Deserialize(br); + else + title = null; -if ((flags & 4) != 0) -description = StringUtil.Deserialize(br); -else -description = null; - -document = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); -send_message = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); + if ((flags & 4) != 0) + description = StringUtil.Deserialize(br); + else + description = null; + document = (TLAbsInputDocument) ObjectUtils.DeserializeObject(br); + send_message = (TLAbsInputBotInlineMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -StringUtil.Serialize(id,bw); -StringUtil.Serialize(type,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(title,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(description,bw); -ObjectUtils.SerializeObject(document,bw); -ObjectUtils.SerializeObject(send_message,bw); - + bw.Write(flags); + StringUtil.Serialize(id, bw); + StringUtil.Serialize(type, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(title, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(description, bw); + ObjectUtils.SerializeObject(document, bw); + ObjectUtils.SerializeObject(send_message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs b/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs index acffa0c..db7578f 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1336154098)] + [TLObject(1336154098)] public class TLInputBotInlineResultGame : TLAbsInputBotInlineResult { - public override int Constructor + public override int Constructor => 1336154098; + + public string id { get; set; } + public string short_name { get; set; } + public TLAbsInputBotInlineMessage send_message { get; set; } + + + public void ComputeFlags() { - get - { - return 1336154098; - } } - public string id {get;set;} - public string short_name {get;set;} - public TLAbsInputBotInlineMessage send_message {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = StringUtil.Deserialize(br); -short_name = StringUtil.Deserialize(br); -send_message = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); - + short_name = StringUtil.Deserialize(br); + send_message = (TLAbsInputBotInlineMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(id,bw); -StringUtil.Serialize(short_name,bw); -ObjectUtils.SerializeObject(send_message,bw); - + bw.Write(Constructor); + StringUtil.Serialize(id, bw); + StringUtil.Serialize(short_name, bw); + ObjectUtils.SerializeObject(send_message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs b/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs index 9eb347a..c7a9a79 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1462213465)] + [TLObject(-1462213465)] public class TLInputBotInlineResultPhoto : TLAbsInputBotInlineResult { - public override int Constructor + public override int Constructor => -1462213465; + + public string id { get; set; } + public string type { get; set; } + public TLAbsInputPhoto photo { get; set; } + public TLAbsInputBotInlineMessage send_message { get; set; } + + + public void ComputeFlags() { - get - { - return -1462213465; - } } - public string id {get;set;} - public string type {get;set;} - public TLAbsInputPhoto photo {get;set;} - public TLAbsInputBotInlineMessage send_message {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = StringUtil.Deserialize(br); -type = StringUtil.Deserialize(br); -photo = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); -send_message = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); - + type = StringUtil.Deserialize(br); + photo = (TLAbsInputPhoto) ObjectUtils.DeserializeObject(br); + send_message = (TLAbsInputBotInlineMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(id,bw); -StringUtil.Serialize(type,bw); -ObjectUtils.SerializeObject(photo,bw); -ObjectUtils.SerializeObject(send_message,bw); - + bw.Write(Constructor); + StringUtil.Serialize(id, bw); + StringUtil.Serialize(type, bw); + ObjectUtils.SerializeObject(photo, bw); + ObjectUtils.SerializeObject(send_message, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputChannel.cs b/TeleSharp.TL/TL/TLInputChannel.cs index 85dddd5..e589f03 100644 --- a/TeleSharp.TL/TL/TLInputChannel.cs +++ b/TeleSharp.TL/TL/TLInputChannel.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1343524562)] + [TLObject(-1343524562)] public class TLInputChannel : TLAbsInputChannel { - public override int Constructor + public override int Constructor => -1343524562; + + public int channel_id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -1343524562; - } } - public int channel_id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputChannelEmpty.cs b/TeleSharp.TL/TL/TLInputChannelEmpty.cs index ca78ac3..e83f9be 100644 --- a/TeleSharp.TL/TL/TLInputChannelEmpty.cs +++ b/TeleSharp.TL/TL/TLInputChannelEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-292807034)] + [TLObject(-292807034)] public class TLInputChannelEmpty : TLAbsInputChannel { - public override int Constructor + public override int Constructor => -292807034; + + + public void ComputeFlags() { - get - { - return -292807034; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputChatPhoto.cs b/TeleSharp.TL/TL/TLInputChatPhoto.cs index 9fbf75f..dc89d09 100644 --- a/TeleSharp.TL/TL/TLInputChatPhoto.cs +++ b/TeleSharp.TL/TL/TLInputChatPhoto.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1991004873)] + [TLObject(-1991004873)] public class TLInputChatPhoto : TLAbsInputChatPhoto { - public override int Constructor + public override int Constructor => -1991004873; + + public TLAbsInputPhoto id { get; set; } + + + public void ComputeFlags() { - get - { - return -1991004873; - } } - public TLAbsInputPhoto id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputPhoto) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs b/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs index 06a5a4c..ff3d819 100644 --- a/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs +++ b/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(480546647)] + [TLObject(480546647)] public class TLInputChatPhotoEmpty : TLAbsInputChatPhoto { - public override int Constructor + public override int Constructor => 480546647; + + + public void ComputeFlags() { - get - { - return 480546647; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs b/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs index 261abd1..ce8d89b 100644 --- a/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs +++ b/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1837345356)] + [TLObject(-1837345356)] public class TLInputChatUploadedPhoto : TLAbsInputChatPhoto { - public override int Constructor + public override int Constructor => -1837345356; + + public TLAbsInputFile file { get; set; } + + + public void ComputeFlags() { - get - { - return -1837345356; - } } - public TLAbsInputFile file {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - file = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); - + file = (TLAbsInputFile) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(file,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(file, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputDocument.cs b/TeleSharp.TL/TL/TLInputDocument.cs index 9eddc50..000fe2e 100644 --- a/TeleSharp.TL/TL/TLInputDocument.cs +++ b/TeleSharp.TL/TL/TLInputDocument.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(410618194)] + [TLObject(410618194)] public class TLInputDocument : TLAbsInputDocument { - public override int Constructor + public override int Constructor => 410618194; + + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return 410618194; - } } - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputDocumentEmpty.cs b/TeleSharp.TL/TL/TLInputDocumentEmpty.cs index 633f184..72bff3c 100644 --- a/TeleSharp.TL/TL/TLInputDocumentEmpty.cs +++ b/TeleSharp.TL/TL/TLInputDocumentEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1928391342)] + [TLObject(1928391342)] public class TLInputDocumentEmpty : TLAbsInputDocument { - public override int Constructor + public override int Constructor => 1928391342; + + + public void ComputeFlags() { - get - { - return 1928391342; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs b/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs index 7ea3962..e2426dd 100644 --- a/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs +++ b/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1125058340)] + [TLObject(1125058340)] public class TLInputDocumentFileLocation : TLAbsInputFileLocation { - public override int Constructor + public override int Constructor => 1125058340; + + public long id { get; set; } + public long access_hash { get; set; } + public int version { get; set; } + + + public void ComputeFlags() { - get - { - return 1125058340; - } } - public long id {get;set;} - public long access_hash {get;set;} - public int version {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); -version = br.ReadInt32(); - + access_hash = br.ReadInt64(); + version = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); -bw.Write(version); - + bw.Write(access_hash); + bw.Write(version); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputEncryptedChat.cs b/TeleSharp.TL/TL/TLInputEncryptedChat.cs index 621c114..fe96028 100644 --- a/TeleSharp.TL/TL/TLInputEncryptedChat.cs +++ b/TeleSharp.TL/TL/TLInputEncryptedChat.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-247351839)] + [TLObject(-247351839)] public class TLInputEncryptedChat : TLObject { - public override int Constructor + public override int Constructor => -247351839; + + public int chat_id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -247351839; - } } - public int chat_id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputEncryptedFile.cs b/TeleSharp.TL/TL/TLInputEncryptedFile.cs index bb97377..012c286 100644 --- a/TeleSharp.TL/TL/TLInputEncryptedFile.cs +++ b/TeleSharp.TL/TL/TLInputEncryptedFile.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1511503333)] + [TLObject(1511503333)] public class TLInputEncryptedFile : TLAbsInputEncryptedFile { - public override int Constructor + public override int Constructor => 1511503333; + + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return 1511503333; - } } - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs b/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs index d4235b6..b607298 100644 --- a/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs +++ b/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(767652808)] + [TLObject(767652808)] public class TLInputEncryptedFileBigUploaded : TLAbsInputEncryptedFile { - public override int Constructor + public override int Constructor => 767652808; + + public long id { get; set; } + public int parts { get; set; } + public int key_fingerprint { get; set; } + + + public void ComputeFlags() { - get - { - return 767652808; - } } - public long id {get;set;} - public int parts {get;set;} - public int key_fingerprint {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -parts = br.ReadInt32(); -key_fingerprint = br.ReadInt32(); - + parts = br.ReadInt32(); + key_fingerprint = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(parts); -bw.Write(key_fingerprint); - + bw.Write(parts); + bw.Write(key_fingerprint); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs b/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs index 37c1002..0115152 100644 --- a/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs +++ b/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(406307684)] + [TLObject(406307684)] public class TLInputEncryptedFileEmpty : TLAbsInputEncryptedFile { - public override int Constructor + public override int Constructor => 406307684; + + + public void ComputeFlags() { - get - { - return 406307684; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs b/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs index 533b621..e18ed17 100644 --- a/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs +++ b/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-182231723)] + [TLObject(-182231723)] public class TLInputEncryptedFileLocation : TLAbsInputFileLocation { - public override int Constructor + public override int Constructor => -182231723; + + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -182231723; - } } - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs b/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs index 6b34147..483764f 100644 --- a/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs +++ b/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1690108678)] + [TLObject(1690108678)] public class TLInputEncryptedFileUploaded : TLAbsInputEncryptedFile { - public override int Constructor + public override int Constructor => 1690108678; + + public long id { get; set; } + public int parts { get; set; } + public string md5_checksum { get; set; } + public int key_fingerprint { get; set; } + + + public void ComputeFlags() { - get - { - return 1690108678; - } } - public long id {get;set;} - public int parts {get;set;} - public string md5_checksum {get;set;} - public int key_fingerprint {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -parts = br.ReadInt32(); -md5_checksum = StringUtil.Deserialize(br); -key_fingerprint = br.ReadInt32(); - + parts = br.ReadInt32(); + md5_checksum = StringUtil.Deserialize(br); + key_fingerprint = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(parts); -StringUtil.Serialize(md5_checksum,bw); -bw.Write(key_fingerprint); - + bw.Write(parts); + StringUtil.Serialize(md5_checksum, bw); + bw.Write(key_fingerprint); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputFile.cs b/TeleSharp.TL/TL/TLInputFile.cs index 0238639..7f1cdeb 100644 --- a/TeleSharp.TL/TL/TLInputFile.cs +++ b/TeleSharp.TL/TL/TLInputFile.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-181407105)] + [TLObject(-181407105)] public class TLInputFile : TLAbsInputFile { - public override int Constructor + public override int Constructor => -181407105; + + public long id { get; set; } + public int parts { get; set; } + public string name { get; set; } + public string md5_checksum { get; set; } + + + public void ComputeFlags() { - get - { - return -181407105; - } } - public long id {get;set;} - public int parts {get;set;} - public string name {get;set;} - public string md5_checksum {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -parts = br.ReadInt32(); -name = StringUtil.Deserialize(br); -md5_checksum = StringUtil.Deserialize(br); - + parts = br.ReadInt32(); + name = StringUtil.Deserialize(br); + md5_checksum = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(parts); -StringUtil.Serialize(name,bw); -StringUtil.Serialize(md5_checksum,bw); - + bw.Write(parts); + StringUtil.Serialize(name, bw); + StringUtil.Serialize(md5_checksum, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputFileBig.cs b/TeleSharp.TL/TL/TLInputFileBig.cs index 837d835..046bc51 100644 --- a/TeleSharp.TL/TL/TLInputFileBig.cs +++ b/TeleSharp.TL/TL/TLInputFileBig.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-95482955)] + [TLObject(-95482955)] public class TLInputFileBig : TLAbsInputFile { - public override int Constructor + public override int Constructor => -95482955; + + public long id { get; set; } + public int parts { get; set; } + public string name { get; set; } + + + public void ComputeFlags() { - get - { - return -95482955; - } } - public long id {get;set;} - public int parts {get;set;} - public string name {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -parts = br.ReadInt32(); -name = StringUtil.Deserialize(br); - + parts = br.ReadInt32(); + name = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(parts); -StringUtil.Serialize(name,bw); - + bw.Write(parts); + StringUtil.Serialize(name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputFileLocation.cs b/TeleSharp.TL/TL/TLInputFileLocation.cs index da5d20f..6b52e81 100644 --- a/TeleSharp.TL/TL/TLInputFileLocation.cs +++ b/TeleSharp.TL/TL/TLInputFileLocation.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(342061462)] + [TLObject(342061462)] public class TLInputFileLocation : TLAbsInputFileLocation { - public override int Constructor + public override int Constructor => 342061462; + + public long volume_id { get; set; } + public int local_id { get; set; } + public long secret { get; set; } + + + public void ComputeFlags() { - get - { - return 342061462; - } } - public long volume_id {get;set;} - public int local_id {get;set;} - public long secret {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { volume_id = br.ReadInt64(); -local_id = br.ReadInt32(); -secret = br.ReadInt64(); - + local_id = br.ReadInt32(); + secret = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(volume_id); -bw.Write(local_id); -bw.Write(secret); - + bw.Write(local_id); + bw.Write(secret); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputGameID.cs b/TeleSharp.TL/TL/TLInputGameID.cs index d397528..ffe9f36 100644 --- a/TeleSharp.TL/TL/TLInputGameID.cs +++ b/TeleSharp.TL/TL/TLInputGameID.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(53231223)] + [TLObject(53231223)] public class TLInputGameID : TLAbsInputGame { - public override int Constructor + public override int Constructor => 53231223; + + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return 53231223; - } } - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputGameShortName.cs b/TeleSharp.TL/TL/TLInputGameShortName.cs index 0231027..4750ca9 100644 --- a/TeleSharp.TL/TL/TLInputGameShortName.cs +++ b/TeleSharp.TL/TL/TLInputGameShortName.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1020139510)] + [TLObject(-1020139510)] public class TLInputGameShortName : TLAbsInputGame { - public override int Constructor + public override int Constructor => -1020139510; + + public TLAbsInputUser bot_id { get; set; } + public string short_name { get; set; } + + + public void ComputeFlags() { - get - { - return -1020139510; - } } - public TLAbsInputUser bot_id {get;set;} - public string short_name {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - bot_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); -short_name = StringUtil.Deserialize(br); - + bot_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); + short_name = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(bot_id,bw); -StringUtil.Serialize(short_name,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(bot_id, bw); + StringUtil.Serialize(short_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputGeoPoint.cs b/TeleSharp.TL/TL/TLInputGeoPoint.cs index e67feb7..279ce1e 100644 --- a/TeleSharp.TL/TL/TLInputGeoPoint.cs +++ b/TeleSharp.TL/TL/TLInputGeoPoint.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-206066487)] + [TLObject(-206066487)] public class TLInputGeoPoint : TLAbsInputGeoPoint { - public override int Constructor + public override int Constructor => -206066487; + + public double lat { get; set; } + public double @long { get; set; } + + + public void ComputeFlags() { - get - { - return -206066487; - } } - public double lat {get;set;} - public double @long {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { lat = br.ReadDouble(); -@long = br.ReadDouble(); - + @long = br.ReadDouble(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(lat); -bw.Write(@long); - + bw.Write(@long); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs b/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs index 43bb442..30d9e97 100644 --- a/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs +++ b/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-457104426)] + [TLObject(-457104426)] public class TLInputGeoPointEmpty : TLAbsInputGeoPoint { - public override int Constructor + public override int Constructor => -457104426; + + + public void ComputeFlags() { - get - { - return -457104426; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaContact.cs b/TeleSharp.TL/TL/TLInputMediaContact.cs index c363dfc..5ac810f 100644 --- a/TeleSharp.TL/TL/TLInputMediaContact.cs +++ b/TeleSharp.TL/TL/TLInputMediaContact.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1494984313)] + [TLObject(-1494984313)] public class TLInputMediaContact : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -1494984313; + + public string phone_number { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + + + public void ComputeFlags() { - get - { - return -1494984313; - } } - public string phone_number {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); - + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaDocument.cs b/TeleSharp.TL/TL/TLInputMediaDocument.cs index 74e59fe..221f839 100644 --- a/TeleSharp.TL/TL/TLInputMediaDocument.cs +++ b/TeleSharp.TL/TL/TLInputMediaDocument.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(444068508)] + [TLObject(444068508)] public class TLInputMediaDocument : TLAbsInputMedia { - public override int Constructor + public override int Constructor => 444068508; + + public TLAbsInputDocument id { get; set; } + public string caption { get; set; } + + + public void ComputeFlags() { - get - { - return 444068508; - } } - public TLAbsInputDocument id {get;set;} - public string caption {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); -caption = StringUtil.Deserialize(br); - + id = (TLAbsInputDocument) ObjectUtils.DeserializeObject(br); + caption = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); -StringUtil.Serialize(caption,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); + StringUtil.Serialize(caption, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs b/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs index e81ee17..1273f0b 100644 --- a/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs +++ b/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-437690244)] + [TLObject(-437690244)] public class TLInputMediaDocumentExternal : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -437690244; + + public string url { get; set; } + public string caption { get; set; } + + + public void ComputeFlags() { - get - { - return -437690244; - } } - public string url {get;set;} - public string caption {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { url = StringUtil.Deserialize(br); -caption = StringUtil.Deserialize(br); - + caption = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(url,bw); -StringUtil.Serialize(caption,bw); - + bw.Write(Constructor); + StringUtil.Serialize(url, bw); + StringUtil.Serialize(caption, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaEmpty.cs b/TeleSharp.TL/TL/TLInputMediaEmpty.cs index eb084d7..d84a1f0 100644 --- a/TeleSharp.TL/TL/TLInputMediaEmpty.cs +++ b/TeleSharp.TL/TL/TLInputMediaEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1771768449)] + [TLObject(-1771768449)] public class TLInputMediaEmpty : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -1771768449; + + + public void ComputeFlags() { - get - { - return -1771768449; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaGame.cs b/TeleSharp.TL/TL/TLInputMediaGame.cs index 55cda86..9a0b9e0 100644 --- a/TeleSharp.TL/TL/TLInputMediaGame.cs +++ b/TeleSharp.TL/TL/TLInputMediaGame.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-750828557)] + [TLObject(-750828557)] public class TLInputMediaGame : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -750828557; + + public TLAbsInputGame id { get; set; } + + + public void ComputeFlags() { - get - { - return -750828557; - } } - public TLAbsInputGame id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputGame)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputGame) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs b/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs index ef89518..a65a3eb 100644 --- a/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs +++ b/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-104578748)] + [TLObject(-104578748)] public class TLInputMediaGeoPoint : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -104578748; + + public TLAbsInputGeoPoint geo_point { get; set; } + + + public void ComputeFlags() { - get - { - return -104578748; - } } - public TLAbsInputGeoPoint geo_point {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - geo_point = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); - + geo_point = (TLAbsInputGeoPoint) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(geo_point,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(geo_point, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaGifExternal.cs b/TeleSharp.TL/TL/TLInputMediaGifExternal.cs index f87b5a7..36a60a5 100644 --- a/TeleSharp.TL/TL/TLInputMediaGifExternal.cs +++ b/TeleSharp.TL/TL/TLInputMediaGifExternal.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1212395773)] + [TLObject(1212395773)] public class TLInputMediaGifExternal : TLAbsInputMedia { - public override int Constructor + public override int Constructor => 1212395773; + + public string url { get; set; } + public string q { get; set; } + + + public void ComputeFlags() { - get - { - return 1212395773; - } } - public string url {get;set;} - public string q {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { url = StringUtil.Deserialize(br); -q = StringUtil.Deserialize(br); - + q = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(url,bw); -StringUtil.Serialize(q,bw); - + bw.Write(Constructor); + StringUtil.Serialize(url, bw); + StringUtil.Serialize(q, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaPhoto.cs b/TeleSharp.TL/TL/TLInputMediaPhoto.cs index fca67bf..07ee1d9 100644 --- a/TeleSharp.TL/TL/TLInputMediaPhoto.cs +++ b/TeleSharp.TL/TL/TLInputMediaPhoto.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-373312269)] + [TLObject(-373312269)] public class TLInputMediaPhoto : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -373312269; + + public TLAbsInputPhoto id { get; set; } + public string caption { get; set; } + + + public void ComputeFlags() { - get - { - return -373312269; - } } - public TLAbsInputPhoto id {get;set;} - public string caption {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); -caption = StringUtil.Deserialize(br); - + id = (TLAbsInputPhoto) ObjectUtils.DeserializeObject(br); + caption = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); -StringUtil.Serialize(caption,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); + StringUtil.Serialize(caption, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs b/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs index a252aab..15622e2 100644 --- a/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs +++ b/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1252045032)] + [TLObject(-1252045032)] public class TLInputMediaPhotoExternal : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -1252045032; + + public string url { get; set; } + public string caption { get; set; } + + + public void ComputeFlags() { - get - { - return -1252045032; - } } - public string url {get;set;} - public string caption {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { url = StringUtil.Deserialize(br); -caption = StringUtil.Deserialize(br); - + caption = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(url,bw); -StringUtil.Serialize(caption,bw); - + bw.Write(Constructor); + StringUtil.Serialize(url, bw); + StringUtil.Serialize(caption, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs b/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs index 23a57a8..13827ce 100644 --- a/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs +++ b/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs @@ -1,65 +1,50 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-797904407)] + [TLObject(-797904407)] public class TLInputMediaUploadedDocument : TLAbsInputMedia { - public override int Constructor + public override int Constructor => -797904407; + + public int flags { get; set; } + public TLAbsInputFile file { get; set; } + public string mime_type { get; set; } + public TLVector attributes { get; set; } + public string caption { get; set; } + public TLVector stickers { get; set; } + + + public void ComputeFlags() { - get - { - return -797904407; - } + flags = 0; + flags = stickers != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public TLAbsInputFile file {get;set;} - public string mime_type {get;set;} - public TLVector attributes {get;set;} - public string caption {get;set;} - public TLVector stickers {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = stickers != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -file = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); -mime_type = StringUtil.Deserialize(br); -attributes = (TLVector)ObjectUtils.DeserializeVector(br); -caption = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -stickers = (TLVector)ObjectUtils.DeserializeVector(br); -else -stickers = null; - - + file = (TLAbsInputFile) ObjectUtils.DeserializeObject(br); + mime_type = StringUtil.Deserialize(br); + attributes = ObjectUtils.DeserializeVector(br); + caption = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + stickers = ObjectUtils.DeserializeVector(br); + else + stickers = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(file,bw); -StringUtil.Serialize(mime_type,bw); -ObjectUtils.SerializeObject(attributes,bw); -StringUtil.Serialize(caption,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(stickers,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(file, bw); + StringUtil.Serialize(mime_type, bw); + ObjectUtils.SerializeObject(attributes, bw); + StringUtil.Serialize(caption, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(stickers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs b/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs index beb4050..57cf0a6 100644 --- a/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs +++ b/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs @@ -1,59 +1,44 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1661770481)] + [TLObject(1661770481)] public class TLInputMediaUploadedPhoto : TLAbsInputMedia { - public override int Constructor + public override int Constructor => 1661770481; + + public int flags { get; set; } + public TLAbsInputFile file { get; set; } + public string caption { get; set; } + public TLVector stickers { get; set; } + + + public void ComputeFlags() { - get - { - return 1661770481; - } + flags = 0; + flags = stickers != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public TLAbsInputFile file {get;set;} - public string caption {get;set;} - public TLVector stickers {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = stickers != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -file = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); -caption = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -stickers = (TLVector)ObjectUtils.DeserializeVector(br); -else -stickers = null; - - + file = (TLAbsInputFile) ObjectUtils.DeserializeObject(br); + caption = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + stickers = ObjectUtils.DeserializeVector(br); + else + stickers = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(file,bw); -StringUtil.Serialize(caption,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(stickers,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(file, bw); + StringUtil.Serialize(caption, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(stickers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs b/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs index 17b1c84..d073fbf 100644 --- a/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs +++ b/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs @@ -1,68 +1,53 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1356369070)] + [TLObject(1356369070)] public class TLInputMediaUploadedThumbDocument : TLAbsInputMedia { - public override int Constructor + public override int Constructor => 1356369070; + + public int flags { get; set; } + public TLAbsInputFile file { get; set; } + public TLAbsInputFile thumb { get; set; } + public string mime_type { get; set; } + public TLVector attributes { get; set; } + public string caption { get; set; } + public TLVector stickers { get; set; } + + + public void ComputeFlags() { - get - { - return 1356369070; - } + flags = 0; + flags = stickers != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public TLAbsInputFile file {get;set;} - public TLAbsInputFile thumb {get;set;} - public string mime_type {get;set;} - public TLVector attributes {get;set;} - public string caption {get;set;} - public TLVector stickers {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = stickers != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -file = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); -thumb = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); -mime_type = StringUtil.Deserialize(br); -attributes = (TLVector)ObjectUtils.DeserializeVector(br); -caption = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -stickers = (TLVector)ObjectUtils.DeserializeVector(br); -else -stickers = null; - - + file = (TLAbsInputFile) ObjectUtils.DeserializeObject(br); + thumb = (TLAbsInputFile) ObjectUtils.DeserializeObject(br); + mime_type = StringUtil.Deserialize(br); + attributes = ObjectUtils.DeserializeVector(br); + caption = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + stickers = ObjectUtils.DeserializeVector(br); + else + stickers = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -ObjectUtils.SerializeObject(file,bw); -ObjectUtils.SerializeObject(thumb,bw); -StringUtil.Serialize(mime_type,bw); -ObjectUtils.SerializeObject(attributes,bw); -StringUtil.Serialize(caption,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(stickers,bw); - + bw.Write(flags); + ObjectUtils.SerializeObject(file, bw); + ObjectUtils.SerializeObject(thumb, bw); + StringUtil.Serialize(mime_type, bw); + ObjectUtils.SerializeObject(attributes, bw); + StringUtil.Serialize(caption, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(stickers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMediaVenue.cs b/TeleSharp.TL/TL/TLInputMediaVenue.cs index dc263e7..44f439f 100644 --- a/TeleSharp.TL/TL/TLInputMediaVenue.cs +++ b/TeleSharp.TL/TL/TLInputMediaVenue.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(673687578)] + [TLObject(673687578)] public class TLInputMediaVenue : TLAbsInputMedia { - public override int Constructor + public override int Constructor => 673687578; + + public TLAbsInputGeoPoint geo_point { get; set; } + public string title { get; set; } + public string address { get; set; } + public string provider { get; set; } + public string venue_id { get; set; } + + + public void ComputeFlags() { - get - { - return 673687578; - } } - public TLAbsInputGeoPoint geo_point {get;set;} - public string title {get;set;} - public string address {get;set;} - public string provider {get;set;} - public string venue_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - geo_point = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); -title = StringUtil.Deserialize(br); -address = StringUtil.Deserialize(br); -provider = StringUtil.Deserialize(br); -venue_id = StringUtil.Deserialize(br); - + geo_point = (TLAbsInputGeoPoint) ObjectUtils.DeserializeObject(br); + title = StringUtil.Deserialize(br); + address = StringUtil.Deserialize(br); + provider = StringUtil.Deserialize(br); + venue_id = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(geo_point,bw); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(address,bw); -StringUtil.Serialize(provider,bw); -StringUtil.Serialize(venue_id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(geo_point, bw); + StringUtil.Serialize(title, bw); + StringUtil.Serialize(address, bw); + StringUtil.Serialize(provider, bw); + StringUtil.Serialize(venue_id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs b/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs index 227b439..20f5f33 100644 --- a/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs +++ b/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(546203849)] + [TLObject(546203849)] public class TLInputMessageEntityMentionName : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 546203849; + + public int offset { get; set; } + public int length { get; set; } + public TLAbsInputUser user_id { get; set; } + + + public void ComputeFlags() { - get - { - return 546203849; - } } - public int offset {get;set;} - public int length {get;set;} - public TLAbsInputUser user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); -user_id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + length = br.ReadInt32(); + user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); -ObjectUtils.SerializeObject(user_id,bw); - + bw.Write(length); + ObjectUtils.SerializeObject(user_id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs b/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs index f455a3c..7f56919 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(975236280)] + [TLObject(975236280)] public class TLInputMessagesFilterChatPhotos : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => 975236280; + + + public void ComputeFlags() { - get - { - return 975236280; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs b/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs index d2b52a6..018925f 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1629621880)] + [TLObject(-1629621880)] public class TLInputMessagesFilterDocument : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => -1629621880; + + + public void ComputeFlags() { - get - { - return -1629621880; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs b/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs index 947f778..b533cc1 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1474492012)] + [TLObject(1474492012)] public class TLInputMessagesFilterEmpty : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => 1474492012; + + + public void ComputeFlags() { - get - { - return 1474492012; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs b/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs index 0a59d17..d3e0b54 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-3644025)] + [TLObject(-3644025)] public class TLInputMessagesFilterGif : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => -3644025; + + + public void ComputeFlags() { - get - { - return -3644025; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs b/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs index 5baa36d..2446d62 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(928101534)] + [TLObject(928101534)] public class TLInputMessagesFilterMusic : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => 928101534; + + + public void ComputeFlags() { - get - { - return 928101534; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs b/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs index a791d0d..6f98bc9 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1458172132)] + [TLObject(1458172132)] public class TLInputMessagesFilterPhotoVideo : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => 1458172132; + + + public void ComputeFlags() { - get - { - return 1458172132; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs b/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs index 1f98292..c8f664a 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-648121413)] + [TLObject(-648121413)] public class TLInputMessagesFilterPhotoVideoDocuments : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => -648121413; + + + public void ComputeFlags() { - get - { - return -648121413; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs b/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs index bffea4e..fd2adc9 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1777752804)] + [TLObject(-1777752804)] public class TLInputMessagesFilterPhotos : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => -1777752804; + + + public void ComputeFlags() { - get - { - return -1777752804; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs b/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs index 035ca88..79a5012 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2129714567)] + [TLObject(2129714567)] public class TLInputMessagesFilterUrl : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => 2129714567; + + + public void ComputeFlags() { - get - { - return 2129714567; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs b/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs index 9463034..e29b40a 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1614803355)] + [TLObject(-1614803355)] public class TLInputMessagesFilterVideo : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => -1614803355; + + + public void ComputeFlags() { - get - { - return -1614803355; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs b/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs index a8a5e84..f500868 100644 --- a/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs +++ b/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1358283666)] + [TLObject(1358283666)] public class TLInputMessagesFilterVoice : TLAbsMessagesFilter { - public override int Constructor + public override int Constructor => 1358283666; + + + public void ComputeFlags() { - get - { - return 1358283666; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputNotifyAll.cs b/TeleSharp.TL/TL/TLInputNotifyAll.cs index 66d4344..d8e99f1 100644 --- a/TeleSharp.TL/TL/TLInputNotifyAll.cs +++ b/TeleSharp.TL/TL/TLInputNotifyAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1540769658)] + [TLObject(-1540769658)] public class TLInputNotifyAll : TLAbsInputNotifyPeer { - public override int Constructor + public override int Constructor => -1540769658; + + + public void ComputeFlags() { - get - { - return -1540769658; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputNotifyChats.cs b/TeleSharp.TL/TL/TLInputNotifyChats.cs index e478fdd..bb2dcef 100644 --- a/TeleSharp.TL/TL/TLInputNotifyChats.cs +++ b/TeleSharp.TL/TL/TLInputNotifyChats.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1251338318)] + [TLObject(1251338318)] public class TLInputNotifyChats : TLAbsInputNotifyPeer { - public override int Constructor + public override int Constructor => 1251338318; + + + public void ComputeFlags() { - get - { - return 1251338318; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputNotifyPeer.cs b/TeleSharp.TL/TL/TLInputNotifyPeer.cs index 14afd63..84c9c27 100644 --- a/TeleSharp.TL/TL/TLInputNotifyPeer.cs +++ b/TeleSharp.TL/TL/TLInputNotifyPeer.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1195615476)] + [TLObject(-1195615476)] public class TLInputNotifyPeer : TLAbsInputNotifyPeer { - public override int Constructor + public override int Constructor => -1195615476; + + public TLAbsInputPeer peer { get; set; } + + + public void ComputeFlags() { - get - { - return -1195615476; - } } - public TLAbsInputPeer peer {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsInputPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputNotifyUsers.cs b/TeleSharp.TL/TL/TLInputNotifyUsers.cs index 9a7aaa5..a763f59 100644 --- a/TeleSharp.TL/TL/TLInputNotifyUsers.cs +++ b/TeleSharp.TL/TL/TLInputNotifyUsers.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(423314455)] + [TLObject(423314455)] public class TLInputNotifyUsers : TLAbsInputNotifyPeer { - public override int Constructor + public override int Constructor => 423314455; + + + public void ComputeFlags() { - get - { - return 423314455; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerChannel.cs b/TeleSharp.TL/TL/TLInputPeerChannel.cs index 373252c..f2f93ad 100644 --- a/TeleSharp.TL/TL/TLInputPeerChannel.cs +++ b/TeleSharp.TL/TL/TLInputPeerChannel.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(548253432)] + [TLObject(548253432)] public class TLInputPeerChannel : TLAbsInputPeer { - public override int Constructor + public override int Constructor => 548253432; + + public int channel_id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return 548253432; - } } - public int channel_id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerChat.cs b/TeleSharp.TL/TL/TLInputPeerChat.cs index 698940e..c204513 100644 --- a/TeleSharp.TL/TL/TLInputPeerChat.cs +++ b/TeleSharp.TL/TL/TLInputPeerChat.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(396093539)] + [TLObject(396093539)] public class TLInputPeerChat : TLAbsInputPeer { - public override int Constructor + public override int Constructor => 396093539; + + public int chat_id { get; set; } + + + public void ComputeFlags() { - get - { - return 396093539; - } } - public int chat_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerEmpty.cs b/TeleSharp.TL/TL/TLInputPeerEmpty.cs index 6a2cd99..0bc09b2 100644 --- a/TeleSharp.TL/TL/TLInputPeerEmpty.cs +++ b/TeleSharp.TL/TL/TLInputPeerEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2134579434)] + [TLObject(2134579434)] public class TLInputPeerEmpty : TLAbsInputPeer { - public override int Constructor + public override int Constructor => 2134579434; + + + public void ComputeFlags() { - get - { - return 2134579434; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs b/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs index 112d750..b177ee7 100644 --- a/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs +++ b/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-395694988)] + [TLObject(-395694988)] public class TLInputPeerNotifyEventsAll : TLAbsInputPeerNotifyEvents { - public override int Constructor + public override int Constructor => -395694988; + + + public void ComputeFlags() { - get - { - return -395694988; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs b/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs index 9d1d885..205d334 100644 --- a/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs +++ b/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-265263912)] + [TLObject(-265263912)] public class TLInputPeerNotifyEventsEmpty : TLAbsInputPeerNotifyEvents { - public override int Constructor + public override int Constructor => -265263912; + + + public void ComputeFlags() { - get - { - return -265263912; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs b/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs index 827e12c..19cb941 100644 --- a/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs +++ b/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs @@ -1,58 +1,44 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(949182130)] + [TLObject(949182130)] public class TLInputPeerNotifySettings : TLObject { - public override int Constructor + public override int Constructor => 949182130; + + public int flags { get; set; } + public bool show_previews { get; set; } + public bool silent { get; set; } + public int mute_until { get; set; } + public string sound { get; set; } + + + public void ComputeFlags() { - get - { - return 949182130; - } + flags = 0; + flags = show_previews ? flags | 1 : flags & ~1; + flags = silent ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool show_previews {get;set;} - public bool silent {get;set;} - public int mute_until {get;set;} - public string sound {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = show_previews ? (flags | 1) : (flags & ~1); -flags = silent ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -show_previews = (flags & 1) != 0; -silent = (flags & 2) != 0; -mute_until = br.ReadInt32(); -sound = StringUtil.Deserialize(br); - + show_previews = (flags & 1) != 0; + silent = (flags & 2) != 0; + mute_until = br.ReadInt32(); + sound = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -bw.Write(mute_until); -StringUtil.Serialize(sound,bw); - + bw.Write(mute_until); + StringUtil.Serialize(sound, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerSelf.cs b/TeleSharp.TL/TL/TLInputPeerSelf.cs index 9eb864e..33a6392 100644 --- a/TeleSharp.TL/TL/TLInputPeerSelf.cs +++ b/TeleSharp.TL/TL/TLInputPeerSelf.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2107670217)] + [TLObject(2107670217)] public class TLInputPeerSelf : TLAbsInputPeer { - public override int Constructor + public override int Constructor => 2107670217; + + + public void ComputeFlags() { - get - { - return 2107670217; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPeerUser.cs b/TeleSharp.TL/TL/TLInputPeerUser.cs index 361eb61..413a0f3 100644 --- a/TeleSharp.TL/TL/TLInputPeerUser.cs +++ b/TeleSharp.TL/TL/TLInputPeerUser.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2072935910)] + [TLObject(2072935910)] public class TLInputPeerUser : TLAbsInputPeer { - public override int Constructor + public override int Constructor => 2072935910; + + public int user_id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return 2072935910; - } } - public int user_id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPhoneContact.cs b/TeleSharp.TL/TL/TLInputPhoneContact.cs index 69f9983..d20fe4c 100644 --- a/TeleSharp.TL/TL/TLInputPhoneContact.cs +++ b/TeleSharp.TL/TL/TLInputPhoneContact.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-208488460)] + [TLObject(-208488460)] public class TLInputPhoneContact : TLObject { - public override int Constructor + public override int Constructor => -208488460; + + public long client_id { get; set; } + public string phone { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + + + public void ComputeFlags() { - get - { - return -208488460; - } } - public long client_id {get;set;} - public string phone {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { client_id = br.ReadInt64(); -phone = StringUtil.Deserialize(br); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); - + phone = StringUtil.Deserialize(br); + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(client_id); -StringUtil.Serialize(phone,bw); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); - + StringUtil.Serialize(phone, bw); + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPhoto.cs b/TeleSharp.TL/TL/TLInputPhoto.cs index 542fdaa..22a956d 100644 --- a/TeleSharp.TL/TL/TLInputPhoto.cs +++ b/TeleSharp.TL/TL/TLInputPhoto.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-74070332)] + [TLObject(-74070332)] public class TLInputPhoto : TLAbsInputPhoto { - public override int Constructor + public override int Constructor => -74070332; + + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -74070332; - } } - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPhotoEmpty.cs b/TeleSharp.TL/TL/TLInputPhotoEmpty.cs index a940b96..7ad0c18 100644 --- a/TeleSharp.TL/TL/TLInputPhotoEmpty.cs +++ b/TeleSharp.TL/TL/TLInputPhotoEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(483901197)] + [TLObject(483901197)] public class TLInputPhotoEmpty : TLAbsInputPhoto { - public override int Constructor + public override int Constructor => 483901197; + + + public void ComputeFlags() { - get - { - return 483901197; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs b/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs index 65c0c9d..f7c81a8 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1107622874)] + [TLObject(-1107622874)] public class TLInputPrivacyKeyChatInvite : TLAbsInputPrivacyKey { - public override int Constructor + public override int Constructor => -1107622874; + + + public void ComputeFlags() { - get - { - return -1107622874; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs b/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs index 467d620..aa6785c 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1335282456)] + [TLObject(1335282456)] public class TLInputPrivacyKeyStatusTimestamp : TLAbsInputPrivacyKey { - public override int Constructor + public override int Constructor => 1335282456; + + + public void ComputeFlags() { - get - { - return 1335282456; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs b/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs index 5a58756..5dc16a0 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(407582158)] + [TLObject(407582158)] public class TLInputPrivacyValueAllowAll : TLAbsInputPrivacyRule { - public override int Constructor + public override int Constructor => 407582158; + + + public void ComputeFlags() { - get - { - return 407582158; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs b/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs index 66f1148..af8bb9f 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(218751099)] + [TLObject(218751099)] public class TLInputPrivacyValueAllowContacts : TLAbsInputPrivacyRule { - public override int Constructor + public override int Constructor => 218751099; + + + public void ComputeFlags() { - get - { - return 218751099; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs b/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs index 494d498..d8958a8 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(320652927)] + [TLObject(320652927)] public class TLInputPrivacyValueAllowUsers : TLAbsInputPrivacyRule { - public override int Constructor + public override int Constructor => 320652927; + + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 320652927; - } } - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - users = (TLVector)ObjectUtils.DeserializeVector(br); - + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs b/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs index 7502064..8256ea6 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-697604407)] + [TLObject(-697604407)] public class TLInputPrivacyValueDisallowAll : TLAbsInputPrivacyRule { - public override int Constructor + public override int Constructor => -697604407; + + + public void ComputeFlags() { - get - { - return -697604407; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs b/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs index 08c9977..9fb4695 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(195371015)] + [TLObject(195371015)] public class TLInputPrivacyValueDisallowContacts : TLAbsInputPrivacyRule { - public override int Constructor + public override int Constructor => 195371015; + + + public void ComputeFlags() { - get - { - return 195371015; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs b/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs index 97b5af3..4da7967 100644 --- a/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs +++ b/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1877932953)] + [TLObject(-1877932953)] public class TLInputPrivacyValueDisallowUsers : TLAbsInputPrivacyRule { - public override int Constructor + public override int Constructor => -1877932953; + + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1877932953; - } } - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - users = (TLVector)ObjectUtils.DeserializeVector(br); - + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputReportReasonOther.cs b/TeleSharp.TL/TL/TLInputReportReasonOther.cs index 484af5c..ec85f75 100644 --- a/TeleSharp.TL/TL/TLInputReportReasonOther.cs +++ b/TeleSharp.TL/TL/TLInputReportReasonOther.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-512463606)] + [TLObject(-512463606)] public class TLInputReportReasonOther : TLAbsReportReason { - public override int Constructor + public override int Constructor => -512463606; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -512463606; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputReportReasonPornography.cs b/TeleSharp.TL/TL/TLInputReportReasonPornography.cs index 18661a9..c605440 100644 --- a/TeleSharp.TL/TL/TLInputReportReasonPornography.cs +++ b/TeleSharp.TL/TL/TLInputReportReasonPornography.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(777640226)] + [TLObject(777640226)] public class TLInputReportReasonPornography : TLAbsReportReason { - public override int Constructor + public override int Constructor => 777640226; + + + public void ComputeFlags() { - get - { - return 777640226; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputReportReasonSpam.cs b/TeleSharp.TL/TL/TLInputReportReasonSpam.cs index 12634e3..d3d21e9 100644 --- a/TeleSharp.TL/TL/TLInputReportReasonSpam.cs +++ b/TeleSharp.TL/TL/TLInputReportReasonSpam.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1490799288)] + [TLObject(1490799288)] public class TLInputReportReasonSpam : TLAbsReportReason { - public override int Constructor + public override int Constructor => 1490799288; + + + public void ComputeFlags() { - get - { - return 1490799288; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputReportReasonViolence.cs b/TeleSharp.TL/TL/TLInputReportReasonViolence.cs index 8d69f8d..0f300f5 100644 --- a/TeleSharp.TL/TL/TLInputReportReasonViolence.cs +++ b/TeleSharp.TL/TL/TLInputReportReasonViolence.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(505595789)] + [TLObject(505595789)] public class TLInputReportReasonViolence : TLAbsReportReason { - public override int Constructor + public override int Constructor => 505595789; + + + public void ComputeFlags() { - get - { - return 505595789; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs b/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs index eda6e56..62aeee4 100644 --- a/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs +++ b/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-4838507)] + [TLObject(-4838507)] public class TLInputStickerSetEmpty : TLAbsInputStickerSet { - public override int Constructor + public override int Constructor => -4838507; + + + public void ComputeFlags() { - get - { - return -4838507; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputStickerSetID.cs b/TeleSharp.TL/TL/TLInputStickerSetID.cs index dd87fd9..254cfa7 100644 --- a/TeleSharp.TL/TL/TLInputStickerSetID.cs +++ b/TeleSharp.TL/TL/TLInputStickerSetID.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1645763991)] + [TLObject(-1645763991)] public class TLInputStickerSetID : TLAbsInputStickerSet { - public override int Constructor + public override int Constructor => -1645763991; + + public long id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -1645763991; - } } - public long id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputStickerSetShortName.cs b/TeleSharp.TL/TL/TLInputStickerSetShortName.cs index 7e6a45f..089a457 100644 --- a/TeleSharp.TL/TL/TLInputStickerSetShortName.cs +++ b/TeleSharp.TL/TL/TLInputStickerSetShortName.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2044933984)] + [TLObject(-2044933984)] public class TLInputStickerSetShortName : TLAbsInputStickerSet { - public override int Constructor + public override int Constructor => -2044933984; + + public string short_name { get; set; } + + + public void ComputeFlags() { - get - { - return -2044933984; - } } - public string short_name {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { short_name = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(short_name,bw); - + bw.Write(Constructor); + StringUtil.Serialize(short_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs b/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs index 800913c..ad3249f 100644 --- a/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs +++ b/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(70813275)] + [TLObject(70813275)] public class TLInputStickeredMediaDocument : TLAbsInputStickeredMedia { - public override int Constructor + public override int Constructor => 70813275; + + public TLAbsInputDocument id { get; set; } + + + public void ComputeFlags() { - get - { - return 70813275; - } } - public TLAbsInputDocument id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputDocument) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs b/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs index 6d8ffda..b29f317 100644 --- a/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs +++ b/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1251549527)] + [TLObject(1251549527)] public class TLInputStickeredMediaPhoto : TLAbsInputStickeredMedia { - public override int Constructor + public override int Constructor => 1251549527; + + public TLAbsInputPhoto id { get; set; } + + + public void ComputeFlags() { - get - { - return 1251549527; - } } - public TLAbsInputPhoto id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputPhoto) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputUser.cs b/TeleSharp.TL/TL/TLInputUser.cs index 23fd86e..7fe2553 100644 --- a/TeleSharp.TL/TL/TLInputUser.cs +++ b/TeleSharp.TL/TL/TLInputUser.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-668391402)] + [TLObject(-668391402)] public class TLInputUser : TLAbsInputUser { - public override int Constructor + public override int Constructor => -668391402; + + public int user_id { get; set; } + public long access_hash { get; set; } + + + public void ComputeFlags() { - get - { - return -668391402; - } } - public int user_id {get;set;} - public long access_hash {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -access_hash = br.ReadInt64(); - + access_hash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(access_hash); - + bw.Write(access_hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputUserEmpty.cs b/TeleSharp.TL/TL/TLInputUserEmpty.cs index 6c8aaf0..8a32e2d 100644 --- a/TeleSharp.TL/TL/TLInputUserEmpty.cs +++ b/TeleSharp.TL/TL/TLInputUserEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1182234929)] + [TLObject(-1182234929)] public class TLInputUserEmpty : TLAbsInputUser { - public override int Constructor + public override int Constructor => -1182234929; + + + public void ComputeFlags() { - get - { - return -1182234929; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLInputUserSelf.cs b/TeleSharp.TL/TL/TLInputUserSelf.cs index 9543daa..4ea90f6 100644 --- a/TeleSharp.TL/TL/TLInputUserSelf.cs +++ b/TeleSharp.TL/TL/TLInputUserSelf.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-138301121)] + [TLObject(-138301121)] public class TLInputUserSelf : TLAbsInputUser { - public override int Constructor + public override int Constructor => -138301121; + + + public void ComputeFlags() { - get - { - return -138301121; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButton.cs b/TeleSharp.TL/TL/TLKeyboardButton.cs index ede8ba7..17e071d 100644 --- a/TeleSharp.TL/TL/TLKeyboardButton.cs +++ b/TeleSharp.TL/TL/TLKeyboardButton.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1560655744)] + [TLObject(-1560655744)] public class TLKeyboardButton : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => -1560655744; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -1560655744; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs b/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs index b372950..9e2c259 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1748655686)] + [TLObject(1748655686)] public class TLKeyboardButtonCallback : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => 1748655686; + + public string text { get; set; } + public byte[] data { get; set; } + + + public void ComputeFlags() { - get - { - return 1748655686; - } } - public string text {get;set;} - public byte[] data {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); -data = BytesUtil.Deserialize(br); - + data = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); -BytesUtil.Serialize(data,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); + BytesUtil.Serialize(data, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonGame.cs b/TeleSharp.TL/TL/TLKeyboardButtonGame.cs index 8b475c5..87e3669 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonGame.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonGame.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1358175439)] + [TLObject(1358175439)] public class TLKeyboardButtonGame : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => 1358175439; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return 1358175439; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs b/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs index 2fd94b2..ef6e281 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-59151553)] + [TLObject(-59151553)] public class TLKeyboardButtonRequestGeoLocation : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => -59151553; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -59151553; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs b/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs index c674066..d95d395 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1318425559)] + [TLObject(-1318425559)] public class TLKeyboardButtonRequestPhone : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => -1318425559; + + public string text { get; set; } + + + public void ComputeFlags() { - get - { - return -1318425559; - } } - public string text {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonRow.cs b/TeleSharp.TL/TL/TLKeyboardButtonRow.cs index 7bab1c4..d3bc8a7 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonRow.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonRow.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2002815875)] + [TLObject(2002815875)] public class TLKeyboardButtonRow : TLObject { - public override int Constructor + public override int Constructor => 2002815875; + + public TLVector buttons { get; set; } + + + public void ComputeFlags() { - get - { - return 2002815875; - } } - public TLVector buttons {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - buttons = (TLVector)ObjectUtils.DeserializeVector(br); - + buttons = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(buttons,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(buttons, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs b/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs index 7c0459a..5a91787 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(90744648)] + [TLObject(90744648)] public class TLKeyboardButtonSwitchInline : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => 90744648; + + public int flags { get; set; } + public bool same_peer { get; set; } + public string text { get; set; } + public string query { get; set; } + + + public void ComputeFlags() { - get - { - return 90744648; - } + flags = 0; + flags = same_peer ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool same_peer {get;set;} - public string text {get;set;} - public string query {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = same_peer ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -same_peer = (flags & 1) != 0; -text = StringUtil.Deserialize(br); -query = StringUtil.Deserialize(br); - + same_peer = (flags & 1) != 0; + text = StringUtil.Deserialize(br); + query = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -StringUtil.Serialize(text,bw); -StringUtil.Serialize(query,bw); + bw.Write(flags); + StringUtil.Serialize(text, bw); + StringUtil.Serialize(query, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs b/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs index 4b60bf4..0c37a07 100644 --- a/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs +++ b/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(629866245)] + [TLObject(629866245)] public class TLKeyboardButtonUrl : TLAbsKeyboardButton { - public override int Constructor + public override int Constructor => 629866245; + + public string text { get; set; } + public string url { get; set; } + + + public void ComputeFlags() { - get - { - return 629866245; - } } - public string text {get;set;} - public string url {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { text = StringUtil.Deserialize(br); -url = StringUtil.Deserialize(br); - + url = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(text,bw); -StringUtil.Serialize(url,bw); - + bw.Write(Constructor); + StringUtil.Serialize(text, bw); + StringUtil.Serialize(url, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMaskCoords.cs b/TeleSharp.TL/TL/TLMaskCoords.cs index 0d0e890..e01fa8b 100644 --- a/TeleSharp.TL/TL/TLMaskCoords.cs +++ b/TeleSharp.TL/TL/TLMaskCoords.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1361650766)] + [TLObject(-1361650766)] public class TLMaskCoords : TLObject { - public override int Constructor + public override int Constructor => -1361650766; + + public int n { get; set; } + public double x { get; set; } + public double y { get; set; } + public double zoom { get; set; } + + + public void ComputeFlags() { - get - { - return -1361650766; - } } - public int n {get;set;} - public double x {get;set;} - public double y {get;set;} - public double zoom {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { n = br.ReadInt32(); -x = br.ReadDouble(); -y = br.ReadDouble(); -zoom = br.ReadDouble(); - + x = br.ReadDouble(); + y = br.ReadDouble(); + zoom = br.ReadDouble(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(n); -bw.Write(x); -bw.Write(y); -bw.Write(zoom); - + bw.Write(x); + bw.Write(y); + bw.Write(zoom); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessage.cs b/TeleSharp.TL/TL/TLMessage.cs index 6d27950..53e1b01 100644 --- a/TeleSharp.TL/TL/TLMessage.cs +++ b/TeleSharp.TL/TL/TLMessage.cs @@ -1,157 +1,139 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1063525281)] + [TLObject(-1063525281)] public class TLMessage : TLAbsMessage { - public override int Constructor + public override int Constructor => -1063525281; + + public int flags { get; set; } + public bool @out { get; set; } + public bool mentioned { get; set; } + public bool media_unread { get; set; } + public bool silent { get; set; } + public bool post { get; set; } + public int id { get; set; } + public int? from_id { get; set; } + public TLAbsPeer to_id { get; set; } + public TLMessageFwdHeader fwd_from { get; set; } + public int? via_bot_id { get; set; } + public int? reply_to_msg_id { get; set; } + public int date { get; set; } + public string message { get; set; } + public TLAbsMessageMedia media { get; set; } + public TLAbsReplyMarkup reply_markup { get; set; } + public TLVector entities { get; set; } + public int? views { get; set; } + public int? edit_date { get; set; } + + + public void ComputeFlags() { - get - { - return -1063525281; - } + flags = 0; + flags = @out ? flags | 2 : flags & ~2; + flags = mentioned ? flags | 16 : flags & ~16; + flags = media_unread ? flags | 32 : flags & ~32; + flags = silent ? flags | 8192 : flags & ~8192; + flags = post ? flags | 16384 : flags & ~16384; + flags = from_id != null ? flags | 256 : flags & ~256; + flags = fwd_from != null ? flags | 4 : flags & ~4; + flags = via_bot_id != null ? flags | 2048 : flags & ~2048; + flags = reply_to_msg_id != null ? flags | 8 : flags & ~8; + flags = media != null ? flags | 512 : flags & ~512; + flags = reply_markup != null ? flags | 64 : flags & ~64; + flags = entities != null ? flags | 128 : flags & ~128; + flags = views != null ? flags | 1024 : flags & ~1024; + flags = edit_date != null ? flags | 32768 : flags & ~32768; } - public int flags {get;set;} - public bool @out {get;set;} - public bool mentioned {get;set;} - public bool media_unread {get;set;} - public bool silent {get;set;} - public bool post {get;set;} - public int id {get;set;} - public int? from_id {get;set;} - public TLAbsPeer to_id {get;set;} - public TLMessageFwdHeader fwd_from {get;set;} - public int? via_bot_id {get;set;} - public int? reply_to_msg_id {get;set;} - public int date {get;set;} - public string message {get;set;} - public TLAbsMessageMedia media {get;set;} - public TLAbsReplyMarkup reply_markup {get;set;} - public TLVector entities {get;set;} - public int? views {get;set;} - public int? edit_date {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = @out ? (flags | 2) : (flags & ~2); -flags = mentioned ? (flags | 16) : (flags & ~16); -flags = media_unread ? (flags | 32) : (flags & ~32); -flags = silent ? (flags | 8192) : (flags & ~8192); -flags = post ? (flags | 16384) : (flags & ~16384); -flags = from_id != null ? (flags | 256) : (flags & ~256); -flags = fwd_from != null ? (flags | 4) : (flags & ~4); -flags = via_bot_id != null ? (flags | 2048) : (flags & ~2048); -flags = reply_to_msg_id != null ? (flags | 8) : (flags & ~8); -flags = media != null ? (flags | 512) : (flags & ~512); -flags = reply_markup != null ? (flags | 64) : (flags & ~64); -flags = entities != null ? (flags | 128) : (flags & ~128); -flags = views != null ? (flags | 1024) : (flags & ~1024); -flags = edit_date != null ? (flags | 32768) : (flags & ~32768); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -@out = (flags & 2) != 0; -mentioned = (flags & 16) != 0; -media_unread = (flags & 32) != 0; -silent = (flags & 8192) != 0; -post = (flags & 16384) != 0; -id = br.ReadInt32(); -if ((flags & 256) != 0) -from_id = br.ReadInt32(); -else -from_id = null; + @out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; + id = br.ReadInt32(); + if ((flags & 256) != 0) + from_id = br.ReadInt32(); + else + from_id = null; -to_id = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -if ((flags & 4) != 0) -fwd_from = (TLMessageFwdHeader)ObjectUtils.DeserializeObject(br); -else -fwd_from = null; + to_id = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + if ((flags & 4) != 0) + fwd_from = (TLMessageFwdHeader) ObjectUtils.DeserializeObject(br); + else + fwd_from = null; -if ((flags & 2048) != 0) -via_bot_id = br.ReadInt32(); -else -via_bot_id = null; + if ((flags & 2048) != 0) + via_bot_id = br.ReadInt32(); + else + via_bot_id = null; -if ((flags & 8) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; + if ((flags & 8) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; -date = br.ReadInt32(); -message = StringUtil.Deserialize(br); -if ((flags & 512) != 0) -media = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); -else -media = null; + date = br.ReadInt32(); + message = StringUtil.Deserialize(br); + if ((flags & 512) != 0) + media = (TLAbsMessageMedia) ObjectUtils.DeserializeObject(br); + else + media = null; -if ((flags & 64) != 0) -reply_markup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); -else -reply_markup = null; + if ((flags & 64) != 0) + reply_markup = (TLAbsReplyMarkup) ObjectUtils.DeserializeObject(br); + else + reply_markup = null; -if ((flags & 128) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; - -if ((flags & 1024) != 0) -views = br.ReadInt32(); -else -views = null; - -if ((flags & 32768) != 0) -edit_date = br.ReadInt32(); -else -edit_date = null; + if ((flags & 128) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; + if ((flags & 1024) != 0) + views = br.ReadInt32(); + else + views = null; + if ((flags & 32768) != 0) + edit_date = br.ReadInt32(); + else + edit_date = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - - -bw.Write(id); -if ((flags & 256) != 0) -bw.Write(from_id.Value); -ObjectUtils.SerializeObject(to_id,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(fwd_from,bw); -if ((flags & 2048) != 0) -bw.Write(via_bot_id.Value); -if ((flags & 8) != 0) -bw.Write(reply_to_msg_id.Value); -bw.Write(date); -StringUtil.Serialize(message,bw); -if ((flags & 512) != 0) -ObjectUtils.SerializeObject(media,bw); -if ((flags & 64) != 0) -ObjectUtils.SerializeObject(reply_markup,bw); -if ((flags & 128) != 0) -ObjectUtils.SerializeObject(entities,bw); -if ((flags & 1024) != 0) -bw.Write(views.Value); -if ((flags & 32768) != 0) -bw.Write(edit_date.Value); - + bw.Write(id); + if ((flags & 256) != 0) + bw.Write(from_id.Value); + ObjectUtils.SerializeObject(to_id, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(fwd_from, bw); + if ((flags & 2048) != 0) + bw.Write(via_bot_id.Value); + if ((flags & 8) != 0) + bw.Write(reply_to_msg_id.Value); + bw.Write(date); + StringUtil.Serialize(message, bw); + if ((flags & 512) != 0) + ObjectUtils.SerializeObject(media, bw); + if ((flags & 64) != 0) + ObjectUtils.SerializeObject(reply_markup, bw); + if ((flags & 128) != 0) + ObjectUtils.SerializeObject(entities, bw); + if ((flags & 1024) != 0) + bw.Write(views.Value); + if ((flags & 32768) != 0) + bw.Write(edit_date.Value); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs b/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs index 894e2d2..c0922bb 100644 --- a/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs +++ b/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1781355374)] + [TLObject(-1781355374)] public class TLMessageActionChannelCreate : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1781355374; + + public string title { get; set; } + + + public void ComputeFlags() { - get - { - return -1781355374; - } } - public string title {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(title,bw); - + bw.Write(Constructor); + StringUtil.Serialize(title, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs b/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs index 4b68f4d..8704fea 100644 --- a/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs +++ b/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1336546578)] + [TLObject(-1336546578)] public class TLMessageActionChannelMigrateFrom : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1336546578; + + public string title { get; set; } + public int chat_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1336546578; - } } - public string title {get;set;} - public int chat_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { title = StringUtil.Deserialize(br); -chat_id = br.ReadInt32(); - + chat_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(title,bw); -bw.Write(chat_id); - + bw.Write(Constructor); + StringUtil.Serialize(title, bw); + bw.Write(chat_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs b/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs index 6c7440b..dd729f9 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1217033015)] + [TLObject(1217033015)] public class TLMessageActionChatAddUser : TLAbsMessageAction { - public override int Constructor + public override int Constructor => 1217033015; + + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1217033015; - } } - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - users = (TLVector)ObjectUtils.DeserializeVector(br); - + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatCreate.cs b/TeleSharp.TL/TL/TLMessageActionChatCreate.cs index eab22ee..ff6090b 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatCreate.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatCreate.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1503425638)] + [TLObject(-1503425638)] public class TLMessageActionChatCreate : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1503425638; + + public string title { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return -1503425638; - } } - public string title {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { title = StringUtil.Deserialize(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); - + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(title,bw); -ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + StringUtil.Serialize(title, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs b/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs index 15c5c92..dde4935 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1780220945)] + [TLObject(-1780220945)] public class TLMessageActionChatDeletePhoto : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1780220945; + + + public void ComputeFlags() { - get - { - return -1780220945; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs b/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs index 2d73873..c04e6ff 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1297179892)] + [TLObject(-1297179892)] public class TLMessageActionChatDeleteUser : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1297179892; + + public int user_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1297179892; - } } - public int user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs b/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs index 9e633a7..2f72d02 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2144015272)] + [TLObject(2144015272)] public class TLMessageActionChatEditPhoto : TLAbsMessageAction { - public override int Constructor + public override int Constructor => 2144015272; + + public TLAbsPhoto photo { get; set; } + + + public void ComputeFlags() { - get - { - return 2144015272; - } } - public TLAbsPhoto photo {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); - + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(photo,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(photo, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs b/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs index 28b6bbd..7533fc5 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1247687078)] + [TLObject(-1247687078)] public class TLMessageActionChatEditTitle : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1247687078; + + public string title { get; set; } + + + public void ComputeFlags() { - get - { - return -1247687078; - } } - public string title {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(title,bw); - + bw.Write(Constructor); + StringUtil.Serialize(title, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs b/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs index 89f6b87..560a62e 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-123931160)] + [TLObject(-123931160)] public class TLMessageActionChatJoinedByLink : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -123931160; + + public int inviter_id { get; set; } + + + public void ComputeFlags() { - get - { - return -123931160; - } } - public int inviter_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { inviter_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(inviter_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs b/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs index 8c2d487..fcc1f34 100644 --- a/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs +++ b/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1371385889)] + [TLObject(1371385889)] public class TLMessageActionChatMigrateTo : TLAbsMessageAction { - public override int Constructor + public override int Constructor => 1371385889; + + public int channel_id { get; set; } + + + public void ComputeFlags() { - get - { - return 1371385889; - } } - public int channel_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionEmpty.cs b/TeleSharp.TL/TL/TLMessageActionEmpty.cs index a7ad05a..0299dcd 100644 --- a/TeleSharp.TL/TL/TLMessageActionEmpty.cs +++ b/TeleSharp.TL/TL/TLMessageActionEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1230047312)] + [TLObject(-1230047312)] public class TLMessageActionEmpty : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1230047312; + + + public void ComputeFlags() { - get - { - return -1230047312; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionGameScore.cs b/TeleSharp.TL/TL/TLMessageActionGameScore.cs index 2a0d308..9ce6b03 100644 --- a/TeleSharp.TL/TL/TLMessageActionGameScore.cs +++ b/TeleSharp.TL/TL/TLMessageActionGameScore.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1834538890)] + [TLObject(-1834538890)] public class TLMessageActionGameScore : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1834538890; + + public long game_id { get; set; } + public int score { get; set; } + + + public void ComputeFlags() { - get - { - return -1834538890; - } } - public long game_id {get;set;} - public int score {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { game_id = br.ReadInt64(); -score = br.ReadInt32(); - + score = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(game_id); -bw.Write(score); - + bw.Write(score); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs b/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs index f1e7ed1..31c3844 100644 --- a/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs +++ b/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1615153660)] + [TLObject(-1615153660)] public class TLMessageActionHistoryClear : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1615153660; + + + public void ComputeFlags() { - get - { - return -1615153660; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageActionPinMessage.cs b/TeleSharp.TL/TL/TLMessageActionPinMessage.cs index e39df7d..615ad6e 100644 --- a/TeleSharp.TL/TL/TLMessageActionPinMessage.cs +++ b/TeleSharp.TL/TL/TLMessageActionPinMessage.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1799538451)] + [TLObject(-1799538451)] public class TLMessageActionPinMessage : TLAbsMessageAction { - public override int Constructor + public override int Constructor => -1799538451; + + + public void ComputeFlags() { - get - { - return -1799538451; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEmpty.cs b/TeleSharp.TL/TL/TLMessageEmpty.cs index 21df48e..a3030e0 100644 --- a/TeleSharp.TL/TL/TLMessageEmpty.cs +++ b/TeleSharp.TL/TL/TLMessageEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2082087340)] + [TLObject(-2082087340)] public class TLMessageEmpty : TLAbsMessage { - public override int Constructor + public override int Constructor => -2082087340; + + public int id { get; set; } + + + public void ComputeFlags() { - get - { - return -2082087340; - } } - public int id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityBold.cs b/TeleSharp.TL/TL/TLMessageEntityBold.cs index 7a3affe..5604d99 100644 --- a/TeleSharp.TL/TL/TLMessageEntityBold.cs +++ b/TeleSharp.TL/TL/TLMessageEntityBold.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1117713463)] + [TLObject(-1117713463)] public class TLMessageEntityBold : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => -1117713463; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return -1117713463; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs b/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs index fa6c5ce..65fd027 100644 --- a/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs +++ b/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1827637959)] + [TLObject(1827637959)] public class TLMessageEntityBotCommand : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 1827637959; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 1827637959; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityCode.cs b/TeleSharp.TL/TL/TLMessageEntityCode.cs index ab9f940..ef966e4 100644 --- a/TeleSharp.TL/TL/TLMessageEntityCode.cs +++ b/TeleSharp.TL/TL/TLMessageEntityCode.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(681706865)] + [TLObject(681706865)] public class TLMessageEntityCode : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 681706865; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 681706865; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityEmail.cs b/TeleSharp.TL/TL/TLMessageEntityEmail.cs index 4947334..3ffa808 100644 --- a/TeleSharp.TL/TL/TLMessageEntityEmail.cs +++ b/TeleSharp.TL/TL/TLMessageEntityEmail.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1692693954)] + [TLObject(1692693954)] public class TLMessageEntityEmail : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 1692693954; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 1692693954; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityHashtag.cs b/TeleSharp.TL/TL/TLMessageEntityHashtag.cs index 59d6779..da911b9 100644 --- a/TeleSharp.TL/TL/TLMessageEntityHashtag.cs +++ b/TeleSharp.TL/TL/TLMessageEntityHashtag.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1868782349)] + [TLObject(1868782349)] public class TLMessageEntityHashtag : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 1868782349; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 1868782349; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityItalic.cs b/TeleSharp.TL/TL/TLMessageEntityItalic.cs index 08fd455..2e38d1a 100644 --- a/TeleSharp.TL/TL/TLMessageEntityItalic.cs +++ b/TeleSharp.TL/TL/TLMessageEntityItalic.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2106619040)] + [TLObject(-2106619040)] public class TLMessageEntityItalic : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => -2106619040; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return -2106619040; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityMention.cs b/TeleSharp.TL/TL/TLMessageEntityMention.cs index b98ecd4..f54a36e 100644 --- a/TeleSharp.TL/TL/TLMessageEntityMention.cs +++ b/TeleSharp.TL/TL/TLMessageEntityMention.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-100378723)] + [TLObject(-100378723)] public class TLMessageEntityMention : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => -100378723; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return -100378723; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityMentionName.cs b/TeleSharp.TL/TL/TLMessageEntityMentionName.cs index 4fca31b..bb5d19d 100644 --- a/TeleSharp.TL/TL/TLMessageEntityMentionName.cs +++ b/TeleSharp.TL/TL/TLMessageEntityMentionName.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(892193368)] + [TLObject(892193368)] public class TLMessageEntityMentionName : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 892193368; + + public int offset { get; set; } + public int length { get; set; } + public int user_id { get; set; } + + + public void ComputeFlags() { - get - { - return 892193368; - } } - public int offset {get;set;} - public int length {get;set;} - public int user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); -user_id = br.ReadInt32(); - + length = br.ReadInt32(); + user_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); -bw.Write(user_id); - + bw.Write(length); + bw.Write(user_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityPre.cs b/TeleSharp.TL/TL/TLMessageEntityPre.cs index 1438fc7..a03b3a3 100644 --- a/TeleSharp.TL/TL/TLMessageEntityPre.cs +++ b/TeleSharp.TL/TL/TLMessageEntityPre.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1938967520)] + [TLObject(1938967520)] public class TLMessageEntityPre : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 1938967520; + + public int offset { get; set; } + public int length { get; set; } + public string language { get; set; } + + + public void ComputeFlags() { - get - { - return 1938967520; - } } - public int offset {get;set;} - public int length {get;set;} - public string language {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); -language = StringUtil.Deserialize(br); - + length = br.ReadInt32(); + language = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); -StringUtil.Serialize(language,bw); - + bw.Write(length); + StringUtil.Serialize(language, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs b/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs index a2e809a..d7b7c2b 100644 --- a/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs +++ b/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1990644519)] + [TLObject(1990644519)] public class TLMessageEntityTextUrl : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 1990644519; + + public int offset { get; set; } + public int length { get; set; } + public string url { get; set; } + + + public void ComputeFlags() { - get - { - return 1990644519; - } } - public int offset {get;set;} - public int length {get;set;} - public string url {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); -url = StringUtil.Deserialize(br); - + length = br.ReadInt32(); + url = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); -StringUtil.Serialize(url,bw); - + bw.Write(length); + StringUtil.Serialize(url, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityUnknown.cs b/TeleSharp.TL/TL/TLMessageEntityUnknown.cs index dd3bbf3..db19daf 100644 --- a/TeleSharp.TL/TL/TLMessageEntityUnknown.cs +++ b/TeleSharp.TL/TL/TLMessageEntityUnknown.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1148011883)] + [TLObject(-1148011883)] public class TLMessageEntityUnknown : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => -1148011883; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return -1148011883; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageEntityUrl.cs b/TeleSharp.TL/TL/TLMessageEntityUrl.cs index 330d83c..5e1881f 100644 --- a/TeleSharp.TL/TL/TLMessageEntityUrl.cs +++ b/TeleSharp.TL/TL/TLMessageEntityUrl.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1859134776)] + [TLObject(1859134776)] public class TLMessageEntityUrl : TLAbsMessageEntity { - public override int Constructor + public override int Constructor => 1859134776; + + public int offset { get; set; } + public int length { get; set; } + + + public void ComputeFlags() { - get - { - return 1859134776; - } } - public int offset {get;set;} - public int length {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { offset = br.ReadInt32(); -length = br.ReadInt32(); - + length = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(offset); -bw.Write(length); - + bw.Write(length); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageFwdHeader.cs b/TeleSharp.TL/TL/TLMessageFwdHeader.cs index 085a3c2..e2759b3 100644 --- a/TeleSharp.TL/TL/TLMessageFwdHeader.cs +++ b/TeleSharp.TL/TL/TLMessageFwdHeader.cs @@ -1,74 +1,59 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-947462709)] + [TLObject(-947462709)] public class TLMessageFwdHeader : TLObject { - public override int Constructor + public override int Constructor => -947462709; + + public int flags { get; set; } + public int? from_id { get; set; } + public int date { get; set; } + public int? channel_id { get; set; } + public int? channel_post { get; set; } + + + public void ComputeFlags() { - get - { - return -947462709; - } + flags = 0; + flags = from_id != null ? flags | 1 : flags & ~1; + flags = channel_id != null ? flags | 2 : flags & ~2; + flags = channel_post != null ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public int? from_id {get;set;} - public int date {get;set;} - public int? channel_id {get;set;} - public int? channel_post {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = from_id != null ? (flags | 1) : (flags & ~1); -flags = channel_id != null ? (flags | 2) : (flags & ~2); -flags = channel_post != null ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -if ((flags & 1) != 0) -from_id = br.ReadInt32(); -else -from_id = null; - -date = br.ReadInt32(); -if ((flags & 2) != 0) -channel_id = br.ReadInt32(); -else -channel_id = null; - -if ((flags & 4) != 0) -channel_post = br.ReadInt32(); -else -channel_post = null; + if ((flags & 1) != 0) + from_id = br.ReadInt32(); + else + from_id = null; + date = br.ReadInt32(); + if ((flags & 2) != 0) + channel_id = br.ReadInt32(); + else + channel_id = null; + if ((flags & 4) != 0) + channel_post = br.ReadInt32(); + else + channel_post = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -if ((flags & 1) != 0) -bw.Write(from_id.Value); -bw.Write(date); -if ((flags & 2) != 0) -bw.Write(channel_id.Value); -if ((flags & 4) != 0) -bw.Write(channel_post.Value); - + bw.Write(flags); + if ((flags & 1) != 0) + bw.Write(from_id.Value); + bw.Write(date); + if ((flags & 2) != 0) + bw.Write(channel_id.Value); + if ((flags & 4) != 0) + bw.Write(channel_post.Value); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaContact.cs b/TeleSharp.TL/TL/TLMessageMediaContact.cs index 01a2c33..4b000f0 100644 --- a/TeleSharp.TL/TL/TLMessageMediaContact.cs +++ b/TeleSharp.TL/TL/TLMessageMediaContact.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1585262393)] + [TLObject(1585262393)] public class TLMessageMediaContact : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => 1585262393; + + public string phone_number { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public int user_id { get; set; } + + + public void ComputeFlags() { - get - { - return 1585262393; - } } - public string phone_number {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public int user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { phone_number = StringUtil.Deserialize(br); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); -user_id = br.ReadInt32(); - + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); + user_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(phone_number,bw); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); -bw.Write(user_id); - + bw.Write(Constructor); + StringUtil.Serialize(phone_number, bw); + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); + bw.Write(user_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaDocument.cs b/TeleSharp.TL/TL/TLMessageMediaDocument.cs index e92c924..9ad452e 100644 --- a/TeleSharp.TL/TL/TLMessageMediaDocument.cs +++ b/TeleSharp.TL/TL/TLMessageMediaDocument.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-203411800)] + [TLObject(-203411800)] public class TLMessageMediaDocument : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => -203411800; + + public TLAbsDocument document { get; set; } + public string caption { get; set; } + + + public void ComputeFlags() { - get - { - return -203411800; - } } - public TLAbsDocument document {get;set;} - public string caption {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); -caption = StringUtil.Deserialize(br); - + document = (TLAbsDocument) ObjectUtils.DeserializeObject(br); + caption = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(document,bw); -StringUtil.Serialize(caption,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(document, bw); + StringUtil.Serialize(caption, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaEmpty.cs b/TeleSharp.TL/TL/TLMessageMediaEmpty.cs index 15c696c..59b2894 100644 --- a/TeleSharp.TL/TL/TLMessageMediaEmpty.cs +++ b/TeleSharp.TL/TL/TLMessageMediaEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1038967584)] + [TLObject(1038967584)] public class TLMessageMediaEmpty : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => 1038967584; + + + public void ComputeFlags() { - get - { - return 1038967584; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaGame.cs b/TeleSharp.TL/TL/TLMessageMediaGame.cs index 46a2462..480c834 100644 --- a/TeleSharp.TL/TL/TLMessageMediaGame.cs +++ b/TeleSharp.TL/TL/TLMessageMediaGame.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-38694904)] + [TLObject(-38694904)] public class TLMessageMediaGame : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => -38694904; + + public TLGame game { get; set; } + + + public void ComputeFlags() { - get - { - return -38694904; - } } - public TLGame game {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - game = (TLGame)ObjectUtils.DeserializeObject(br); - + game = (TLGame) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(game,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(game, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaGeo.cs b/TeleSharp.TL/TL/TLMessageMediaGeo.cs index d80c8e4..49be760 100644 --- a/TeleSharp.TL/TL/TLMessageMediaGeo.cs +++ b/TeleSharp.TL/TL/TLMessageMediaGeo.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1457575028)] + [TLObject(1457575028)] public class TLMessageMediaGeo : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => 1457575028; + + public TLAbsGeoPoint geo { get; set; } + + + public void ComputeFlags() { - get - { - return 1457575028; - } } - public TLAbsGeoPoint geo {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); - + geo = (TLAbsGeoPoint) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(geo,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(geo, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaPhoto.cs b/TeleSharp.TL/TL/TLMessageMediaPhoto.cs index 41bc37b..610b1f3 100644 --- a/TeleSharp.TL/TL/TLMessageMediaPhoto.cs +++ b/TeleSharp.TL/TL/TLMessageMediaPhoto.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1032643901)] + [TLObject(1032643901)] public class TLMessageMediaPhoto : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => 1032643901; + + public TLAbsPhoto photo { get; set; } + public string caption { get; set; } + + + public void ComputeFlags() { - get - { - return 1032643901; - } } - public TLAbsPhoto photo {get;set;} - public string caption {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -caption = StringUtil.Deserialize(br); - + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + caption = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(photo,bw); -StringUtil.Serialize(caption,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(photo, bw); + StringUtil.Serialize(caption, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs b/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs index 88ffb13..454f13c 100644 --- a/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs +++ b/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1618676578)] + [TLObject(-1618676578)] public class TLMessageMediaUnsupported : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => -1618676578; + + + public void ComputeFlags() { - get - { - return -1618676578; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaVenue.cs b/TeleSharp.TL/TL/TLMessageMediaVenue.cs index 259c167..2edce0d 100644 --- a/TeleSharp.TL/TL/TLMessageMediaVenue.cs +++ b/TeleSharp.TL/TL/TLMessageMediaVenue.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2031269663)] + [TLObject(2031269663)] public class TLMessageMediaVenue : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => 2031269663; + + public TLAbsGeoPoint geo { get; set; } + public string title { get; set; } + public string address { get; set; } + public string provider { get; set; } + public string venue_id { get; set; } + + + public void ComputeFlags() { - get - { - return 2031269663; - } } - public TLAbsGeoPoint geo {get;set;} - public string title {get;set;} - public string address {get;set;} - public string provider {get;set;} - public string venue_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); -title = StringUtil.Deserialize(br); -address = StringUtil.Deserialize(br); -provider = StringUtil.Deserialize(br); -venue_id = StringUtil.Deserialize(br); - + geo = (TLAbsGeoPoint) ObjectUtils.DeserializeObject(br); + title = StringUtil.Deserialize(br); + address = StringUtil.Deserialize(br); + provider = StringUtil.Deserialize(br); + venue_id = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(geo,bw); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(address,bw); -StringUtil.Serialize(provider,bw); -StringUtil.Serialize(venue_id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(geo, bw); + StringUtil.Serialize(title, bw); + StringUtil.Serialize(address, bw); + StringUtil.Serialize(provider, bw); + StringUtil.Serialize(venue_id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageMediaWebPage.cs b/TeleSharp.TL/TL/TLMessageMediaWebPage.cs index 94306d1..d369b24 100644 --- a/TeleSharp.TL/TL/TLMessageMediaWebPage.cs +++ b/TeleSharp.TL/TL/TLMessageMediaWebPage.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1557277184)] + [TLObject(-1557277184)] public class TLMessageMediaWebPage : TLAbsMessageMedia { - public override int Constructor + public override int Constructor => -1557277184; + + public TLAbsWebPage webpage { get; set; } + + + public void ComputeFlags() { - get - { - return -1557277184; - } } - public TLAbsWebPage webpage {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - webpage = (TLAbsWebPage)ObjectUtils.DeserializeObject(br); - + webpage = (TLAbsWebPage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(webpage,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(webpage, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageRange.cs b/TeleSharp.TL/TL/TLMessageRange.cs index 5d5374d..280ccbb 100644 --- a/TeleSharp.TL/TL/TLMessageRange.cs +++ b/TeleSharp.TL/TL/TLMessageRange.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(182649427)] + [TLObject(182649427)] public class TLMessageRange : TLObject { - public override int Constructor + public override int Constructor => 182649427; + + public int min_id { get; set; } + public int max_id { get; set; } + + + public void ComputeFlags() { - get - { - return 182649427; - } } - public int min_id {get;set;} - public int max_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { min_id = br.ReadInt32(); -max_id = br.ReadInt32(); - + max_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(min_id); -bw.Write(max_id); - + bw.Write(max_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLMessageService.cs b/TeleSharp.TL/TL/TLMessageService.cs index 0449074..4d9b570 100644 --- a/TeleSharp.TL/TL/TLMessageService.cs +++ b/TeleSharp.TL/TL/TLMessageService.cs @@ -1,94 +1,77 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1642487306)] + [TLObject(-1642487306)] public class TLMessageService : TLAbsMessage { - public override int Constructor + public override int Constructor => -1642487306; + + public int flags { get; set; } + public bool @out { get; set; } + public bool mentioned { get; set; } + public bool media_unread { get; set; } + public bool silent { get; set; } + public bool post { get; set; } + public int id { get; set; } + public int? from_id { get; set; } + public TLAbsPeer to_id { get; set; } + public int? reply_to_msg_id { get; set; } + public int date { get; set; } + public TLAbsMessageAction action { get; set; } + + + public void ComputeFlags() { - get - { - return -1642487306; - } + flags = 0; + flags = @out ? flags | 2 : flags & ~2; + flags = mentioned ? flags | 16 : flags & ~16; + flags = media_unread ? flags | 32 : flags & ~32; + flags = silent ? flags | 8192 : flags & ~8192; + flags = post ? flags | 16384 : flags & ~16384; + flags = from_id != null ? flags | 256 : flags & ~256; + flags = reply_to_msg_id != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool @out {get;set;} - public bool mentioned {get;set;} - public bool media_unread {get;set;} - public bool silent {get;set;} - public bool post {get;set;} - public int id {get;set;} - public int? from_id {get;set;} - public TLAbsPeer to_id {get;set;} - public int? reply_to_msg_id {get;set;} - public int date {get;set;} - public TLAbsMessageAction action {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = @out ? (flags | 2) : (flags & ~2); -flags = mentioned ? (flags | 16) : (flags & ~16); -flags = media_unread ? (flags | 32) : (flags & ~32); -flags = silent ? (flags | 8192) : (flags & ~8192); -flags = post ? (flags | 16384) : (flags & ~16384); -flags = from_id != null ? (flags | 256) : (flags & ~256); -flags = reply_to_msg_id != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -@out = (flags & 2) != 0; -mentioned = (flags & 16) != 0; -media_unread = (flags & 32) != 0; -silent = (flags & 8192) != 0; -post = (flags & 16384) != 0; -id = br.ReadInt32(); -if ((flags & 256) != 0) -from_id = br.ReadInt32(); -else -from_id = null; + @out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; + id = br.ReadInt32(); + if ((flags & 256) != 0) + from_id = br.ReadInt32(); + else + from_id = null; -to_id = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -if ((flags & 8) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -date = br.ReadInt32(); -action = (TLAbsMessageAction)ObjectUtils.DeserializeObject(br); + to_id = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + if ((flags & 8) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + date = br.ReadInt32(); + action = (TLAbsMessageAction) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - - -bw.Write(id); -if ((flags & 256) != 0) -bw.Write(from_id.Value); -ObjectUtils.SerializeObject(to_id,bw); -if ((flags & 8) != 0) -bw.Write(reply_to_msg_id.Value); -bw.Write(date); -ObjectUtils.SerializeObject(action,bw); - + bw.Write(id); + if ((flags & 256) != 0) + bw.Write(from_id.Value); + ObjectUtils.SerializeObject(to_id, bw); + if ((flags & 8) != 0) + bw.Write(reply_to_msg_id.Value); + bw.Write(date); + ObjectUtils.SerializeObject(action, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLNearestDc.cs b/TeleSharp.TL/TL/TLNearestDc.cs index d554dd3..f96eea9 100644 --- a/TeleSharp.TL/TL/TLNearestDc.cs +++ b/TeleSharp.TL/TL/TLNearestDc.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1910892683)] + [TLObject(-1910892683)] public class TLNearestDc : TLObject { - public override int Constructor + public override int Constructor => -1910892683; + + public string country { get; set; } + public int this_dc { get; set; } + public int nearest_dc { get; set; } + + + public void ComputeFlags() { - get - { - return -1910892683; - } } - public string country {get;set;} - public int this_dc {get;set;} - public int nearest_dc {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { country = StringUtil.Deserialize(br); -this_dc = br.ReadInt32(); -nearest_dc = br.ReadInt32(); - + this_dc = br.ReadInt32(); + nearest_dc = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(country,bw); -bw.Write(this_dc); -bw.Write(nearest_dc); - + bw.Write(Constructor); + StringUtil.Serialize(country, bw); + bw.Write(this_dc); + bw.Write(nearest_dc); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLNotifyAll.cs b/TeleSharp.TL/TL/TLNotifyAll.cs index 284644b..0320933 100644 --- a/TeleSharp.TL/TL/TLNotifyAll.cs +++ b/TeleSharp.TL/TL/TLNotifyAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1959820384)] + [TLObject(1959820384)] public class TLNotifyAll : TLAbsNotifyPeer { - public override int Constructor + public override int Constructor => 1959820384; + + + public void ComputeFlags() { - get - { - return 1959820384; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLNotifyChats.cs b/TeleSharp.TL/TL/TLNotifyChats.cs index 98d9847..8449b83 100644 --- a/TeleSharp.TL/TL/TLNotifyChats.cs +++ b/TeleSharp.TL/TL/TLNotifyChats.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1073230141)] + [TLObject(-1073230141)] public class TLNotifyChats : TLAbsNotifyPeer { - public override int Constructor + public override int Constructor => -1073230141; + + + public void ComputeFlags() { - get - { - return -1073230141; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLNotifyPeer.cs b/TeleSharp.TL/TL/TLNotifyPeer.cs index 3e0bbe2..a2dbc76 100644 --- a/TeleSharp.TL/TL/TLNotifyPeer.cs +++ b/TeleSharp.TL/TL/TLNotifyPeer.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1613493288)] + [TLObject(-1613493288)] public class TLNotifyPeer : TLAbsNotifyPeer { - public override int Constructor + public override int Constructor => -1613493288; + + public TLAbsPeer peer { get; set; } + + + public void ComputeFlags() { - get - { - return -1613493288; - } } - public TLAbsPeer peer {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLNotifyUsers.cs b/TeleSharp.TL/TL/TLNotifyUsers.cs index e17a3f7..62c90e8 100644 --- a/TeleSharp.TL/TL/TLNotifyUsers.cs +++ b/TeleSharp.TL/TL/TLNotifyUsers.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1261946036)] + [TLObject(-1261946036)] public class TLNotifyUsers : TLAbsNotifyPeer { - public override int Constructor + public override int Constructor => -1261946036; + + + public void ComputeFlags() { - get - { - return -1261946036; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLNull.cs b/TeleSharp.TL/TL/TLNull.cs index bc92220..89f0fd9 100644 --- a/TeleSharp.TL/TL/TLNull.cs +++ b/TeleSharp.TL/TL/TLNull.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1450380236)] + [TLObject(1450380236)] public class TLNull : TLObject { - public override int Constructor + public override int Constructor => 1450380236; + + + public void ComputeFlags() { - get - { - return 1450380236; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerChannel.cs b/TeleSharp.TL/TL/TLPeerChannel.cs index 2caaf12..9e4fe4d 100644 --- a/TeleSharp.TL/TL/TLPeerChannel.cs +++ b/TeleSharp.TL/TL/TLPeerChannel.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1109531342)] + [TLObject(-1109531342)] public class TLPeerChannel : TLAbsPeer { - public override int Constructor + public override int Constructor => -1109531342; + + public int channel_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1109531342; - } } - public int channel_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerChat.cs b/TeleSharp.TL/TL/TLPeerChat.cs index b8384a9..62a2009 100644 --- a/TeleSharp.TL/TL/TLPeerChat.cs +++ b/TeleSharp.TL/TL/TLPeerChat.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1160714821)] + [TLObject(-1160714821)] public class TLPeerChat : TLAbsPeer { - public override int Constructor + public override int Constructor => -1160714821; + + public int chat_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1160714821; - } } - public int chat_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs b/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs index 3e7508c..d80bba4 100644 --- a/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs +++ b/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1830677896)] + [TLObject(1830677896)] public class TLPeerNotifyEventsAll : TLAbsPeerNotifyEvents { - public override int Constructor + public override int Constructor => 1830677896; + + + public void ComputeFlags() { - get - { - return 1830677896; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs b/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs index cd04dc6..c989dd5 100644 --- a/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs +++ b/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1378534221)] + [TLObject(-1378534221)] public class TLPeerNotifyEventsEmpty : TLAbsPeerNotifyEvents { - public override int Constructor + public override int Constructor => -1378534221; + + + public void ComputeFlags() { - get - { - return -1378534221; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerNotifySettings.cs b/TeleSharp.TL/TL/TLPeerNotifySettings.cs index 374130e..93dddcc 100644 --- a/TeleSharp.TL/TL/TLPeerNotifySettings.cs +++ b/TeleSharp.TL/TL/TLPeerNotifySettings.cs @@ -1,58 +1,44 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1697798976)] + [TLObject(-1697798976)] public class TLPeerNotifySettings : TLAbsPeerNotifySettings { - public override int Constructor + public override int Constructor => -1697798976; + + public int flags { get; set; } + public bool show_previews { get; set; } + public bool silent { get; set; } + public int mute_until { get; set; } + public string sound { get; set; } + + + public void ComputeFlags() { - get - { - return -1697798976; - } + flags = 0; + flags = show_previews ? flags | 1 : flags & ~1; + flags = silent ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool show_previews {get;set;} - public bool silent {get;set;} - public int mute_until {get;set;} - public string sound {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = show_previews ? (flags | 1) : (flags & ~1); -flags = silent ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -show_previews = (flags & 1) != 0; -silent = (flags & 2) != 0; -mute_until = br.ReadInt32(); -sound = StringUtil.Deserialize(br); - + show_previews = (flags & 1) != 0; + silent = (flags & 2) != 0; + mute_until = br.ReadInt32(); + sound = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); -bw.Write(mute_until); -StringUtil.Serialize(sound,bw); - + bw.Write(mute_until); + StringUtil.Serialize(sound, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs b/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs index 6d1a7ec..d40e9be 100644 --- a/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs +++ b/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1889961234)] + [TLObject(1889961234)] public class TLPeerNotifySettingsEmpty : TLAbsPeerNotifySettings { - public override int Constructor + public override int Constructor => 1889961234; + + + public void ComputeFlags() { - get - { - return 1889961234; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerSettings.cs b/TeleSharp.TL/TL/TLPeerSettings.cs index c9c00f1..696c960 100644 --- a/TeleSharp.TL/TL/TLPeerSettings.cs +++ b/TeleSharp.TL/TL/TLPeerSettings.cs @@ -1,48 +1,33 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2122045747)] + [TLObject(-2122045747)] public class TLPeerSettings : TLObject { - public override int Constructor + public override int Constructor => -2122045747; + + public int flags { get; set; } + public bool report_spam { get; set; } + + + public void ComputeFlags() { - get - { - return -2122045747; - } + flags = 0; + flags = report_spam ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool report_spam {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = report_spam ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -report_spam = (flags & 1) != 0; - + report_spam = (flags & 1) != 0; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - - + bw.Write(flags); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPeerUser.cs b/TeleSharp.TL/TL/TLPeerUser.cs index 5477679..f4d3d8c 100644 --- a/TeleSharp.TL/TL/TLPeerUser.cs +++ b/TeleSharp.TL/TL/TLPeerUser.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1649296275)] + [TLObject(-1649296275)] public class TLPeerUser : TLAbsPeer { - public override int Constructor + public override int Constructor => -1649296275; + + public int user_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1649296275; - } } - public int user_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPhoto.cs b/TeleSharp.TL/TL/TLPhoto.cs index a670bcd..fe49393 100644 --- a/TeleSharp.TL/TL/TLPhoto.cs +++ b/TeleSharp.TL/TL/TLPhoto.cs @@ -1,60 +1,46 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1836524247)] + [TLObject(-1836524247)] public class TLPhoto : TLAbsPhoto { - public override int Constructor + public override int Constructor => -1836524247; + + public int flags { get; set; } + public bool has_stickers { get; set; } + public long id { get; set; } + public long access_hash { get; set; } + public int date { get; set; } + public TLVector sizes { get; set; } + + + public void ComputeFlags() { - get - { - return -1836524247; - } + flags = 0; + flags = has_stickers ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool has_stickers {get;set;} - public long id {get;set;} - public long access_hash {get;set;} - public int date {get;set;} - public TLVector sizes {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = has_stickers ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -has_stickers = (flags & 1) != 0; -id = br.ReadInt64(); -access_hash = br.ReadInt64(); -date = br.ReadInt32(); -sizes = (TLVector)ObjectUtils.DeserializeVector(br); - + has_stickers = (flags & 1) != 0; + id = br.ReadInt64(); + access_hash = br.ReadInt64(); + date = br.ReadInt32(); + sizes = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(id); -bw.Write(access_hash); -bw.Write(date); -ObjectUtils.SerializeObject(sizes,bw); + bw.Write(flags); + bw.Write(id); + bw.Write(access_hash); + bw.Write(date); + ObjectUtils.SerializeObject(sizes, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPhotoCachedSize.cs b/TeleSharp.TL/TL/TLPhotoCachedSize.cs index fe6825c..4d2a3c9 100644 --- a/TeleSharp.TL/TL/TLPhotoCachedSize.cs +++ b/TeleSharp.TL/TL/TLPhotoCachedSize.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-374917894)] + [TLObject(-374917894)] public class TLPhotoCachedSize : TLAbsPhotoSize { - public override int Constructor + public override int Constructor => -374917894; + + public string type { get; set; } + public TLAbsFileLocation location { get; set; } + public int w { get; set; } + public int h { get; set; } + public byte[] bytes { get; set; } + + + public void ComputeFlags() { - get - { - return -374917894; - } } - public string type {get;set;} - public TLAbsFileLocation location {get;set;} - public int w {get;set;} - public int h {get;set;} - public byte[] bytes {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { type = StringUtil.Deserialize(br); -location = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); -w = br.ReadInt32(); -h = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + location = (TLAbsFileLocation) ObjectUtils.DeserializeObject(br); + w = br.ReadInt32(); + h = br.ReadInt32(); + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(type,bw); -ObjectUtils.SerializeObject(location,bw); -bw.Write(w); -bw.Write(h); -BytesUtil.Serialize(bytes,bw); - + bw.Write(Constructor); + StringUtil.Serialize(type, bw); + ObjectUtils.SerializeObject(location, bw); + bw.Write(w); + bw.Write(h); + BytesUtil.Serialize(bytes, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPhotoEmpty.cs b/TeleSharp.TL/TL/TLPhotoEmpty.cs index 40a9166..d91136f 100644 --- a/TeleSharp.TL/TL/TLPhotoEmpty.cs +++ b/TeleSharp.TL/TL/TLPhotoEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(590459437)] + [TLObject(590459437)] public class TLPhotoEmpty : TLAbsPhoto { - public override int Constructor + public override int Constructor => 590459437; + + public long id { get; set; } + + + public void ComputeFlags() { - get - { - return 590459437; - } } - public long id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPhotoSize.cs b/TeleSharp.TL/TL/TLPhotoSize.cs index 4429643..3c43678 100644 --- a/TeleSharp.TL/TL/TLPhotoSize.cs +++ b/TeleSharp.TL/TL/TLPhotoSize.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2009052699)] + [TLObject(2009052699)] public class TLPhotoSize : TLAbsPhotoSize { - public override int Constructor + public override int Constructor => 2009052699; + + public string type { get; set; } + public TLAbsFileLocation location { get; set; } + public int w { get; set; } + public int h { get; set; } + public int size { get; set; } + + + public void ComputeFlags() { - get - { - return 2009052699; - } } - public string type {get;set;} - public TLAbsFileLocation location {get;set;} - public int w {get;set;} - public int h {get;set;} - public int size {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { type = StringUtil.Deserialize(br); -location = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); -w = br.ReadInt32(); -h = br.ReadInt32(); -size = br.ReadInt32(); - + location = (TLAbsFileLocation) ObjectUtils.DeserializeObject(br); + w = br.ReadInt32(); + h = br.ReadInt32(); + size = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(type,bw); -ObjectUtils.SerializeObject(location,bw); -bw.Write(w); -bw.Write(h); -bw.Write(size); - + bw.Write(Constructor); + StringUtil.Serialize(type, bw); + ObjectUtils.SerializeObject(location, bw); + bw.Write(w); + bw.Write(h); + bw.Write(size); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs b/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs index 10b070d..1d941b8 100644 --- a/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs +++ b/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(236446268)] + [TLObject(236446268)] public class TLPhotoSizeEmpty : TLAbsPhotoSize { - public override int Constructor + public override int Constructor => 236446268; + + public string type { get; set; } + + + public void ComputeFlags() { - get - { - return 236446268; - } } - public string type {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { type = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(type,bw); - + bw.Write(Constructor); + StringUtil.Serialize(type, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs b/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs index e0ca982..60f59d7 100644 --- a/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs +++ b/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1343122938)] + [TLObject(1343122938)] public class TLPrivacyKeyChatInvite : TLAbsPrivacyKey { - public override int Constructor + public override int Constructor => 1343122938; + + + public void ComputeFlags() { - get - { - return 1343122938; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs b/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs index 979a53b..b1fe6b8 100644 --- a/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs +++ b/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1137792208)] + [TLObject(-1137792208)] public class TLPrivacyKeyStatusTimestamp : TLAbsPrivacyKey { - public override int Constructor + public override int Constructor => -1137792208; + + + public void ComputeFlags() { - get - { - return -1137792208; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs b/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs index 117613b..dd55ef7 100644 --- a/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs +++ b/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1698855810)] + [TLObject(1698855810)] public class TLPrivacyValueAllowAll : TLAbsPrivacyRule { - public override int Constructor + public override int Constructor => 1698855810; + + + public void ComputeFlags() { - get - { - return 1698855810; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs b/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs index 7856d22..9b98ed8 100644 --- a/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs +++ b/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-123988)] + [TLObject(-123988)] public class TLPrivacyValueAllowContacts : TLAbsPrivacyRule { - public override int Constructor + public override int Constructor => -123988; + + + public void ComputeFlags() { - get - { - return -123988; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs b/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs index 754d826..aa8616b 100644 --- a/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs +++ b/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1297858060)] + [TLObject(1297858060)] public class TLPrivacyValueAllowUsers : TLAbsPrivacyRule { - public override int Constructor + public override int Constructor => 1297858060; + + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1297858060; - } } - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - users = (TLVector)ObjectUtils.DeserializeVector(br); - + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs b/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs index 3225b9d..9b142d1 100644 --- a/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs +++ b/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1955338397)] + [TLObject(-1955338397)] public class TLPrivacyValueDisallowAll : TLAbsPrivacyRule { - public override int Constructor + public override int Constructor => -1955338397; + + + public void ComputeFlags() { - get - { - return -1955338397; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs b/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs index f324e15..e035be4 100644 --- a/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs +++ b/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-125240806)] + [TLObject(-125240806)] public class TLPrivacyValueDisallowContacts : TLAbsPrivacyRule { - public override int Constructor + public override int Constructor => -125240806; + + + public void ComputeFlags() { - get - { - return -125240806; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs b/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs index cd1ae94..a063370 100644 --- a/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs +++ b/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(209668535)] + [TLObject(209668535)] public class TLPrivacyValueDisallowUsers : TLAbsPrivacyRule { - public override int Constructor + public override int Constructor => 209668535; + + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 209668535; - } } - public TLVector users {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - users = (TLVector)ObjectUtils.DeserializeVector(br); - + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(users,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs b/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs index 6a09537..4faf900 100644 --- a/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs +++ b/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs @@ -1,47 +1,33 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1551583367)] + [TLObject(-1551583367)] public class TLReceivedNotifyMessage : TLObject { - public override int Constructor + public override int Constructor => -1551583367; + + public int id { get; set; } + public int flags { get; set; } + + + public void ComputeFlags() { - get - { - return -1551583367; - } + flags = 0; } - public int id {get;set;} - public int flags {get;set;} - - - public void ComputeFlags() - { - flags = 0; - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -flags = br.ReadInt32(); - + flags = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(id); - + bw.Write(flags); + bw.Write(id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLReplyInlineMarkup.cs b/TeleSharp.TL/TL/TLReplyInlineMarkup.cs index 1110211..df32ed6 100644 --- a/TeleSharp.TL/TL/TLReplyInlineMarkup.cs +++ b/TeleSharp.TL/TL/TLReplyInlineMarkup.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1218642516)] + [TLObject(1218642516)] public class TLReplyInlineMarkup : TLAbsReplyMarkup { - public override int Constructor + public override int Constructor => 1218642516; + + public TLVector rows { get; set; } + + + public void ComputeFlags() { - get - { - return 1218642516; - } } - public TLVector rows {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - rows = (TLVector)ObjectUtils.DeserializeVector(br); - + rows = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(rows,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(rows, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs b/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs index f1d26be..3eab7f0 100644 --- a/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs +++ b/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs @@ -1,52 +1,36 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-200242528)] + [TLObject(-200242528)] public class TLReplyKeyboardForceReply : TLAbsReplyMarkup { - public override int Constructor + public override int Constructor => -200242528; + + public int flags { get; set; } + public bool single_use { get; set; } + public bool selective { get; set; } + + + public void ComputeFlags() { - get - { - return -200242528; - } + flags = 0; + flags = single_use ? flags | 2 : flags & ~2; + flags = selective ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool single_use {get;set;} - public bool selective {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = single_use ? (flags | 2) : (flags & ~2); -flags = selective ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -single_use = (flags & 2) != 0; -selective = (flags & 4) != 0; - + single_use = (flags & 2) != 0; + selective = (flags & 4) != 0; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - - - + bw.Write(flags); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLReplyKeyboardHide.cs b/TeleSharp.TL/TL/TLReplyKeyboardHide.cs index 78c9ea2..9acb819 100644 --- a/TeleSharp.TL/TL/TLReplyKeyboardHide.cs +++ b/TeleSharp.TL/TL/TLReplyKeyboardHide.cs @@ -1,48 +1,33 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1606526075)] + [TLObject(-1606526075)] public class TLReplyKeyboardHide : TLAbsReplyMarkup { - public override int Constructor + public override int Constructor => -1606526075; + + public int flags { get; set; } + public bool selective { get; set; } + + + public void ComputeFlags() { - get - { - return -1606526075; - } + flags = 0; + flags = selective ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool selective {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = selective ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -selective = (flags & 4) != 0; - + selective = (flags & 4) != 0; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - - + bw.Write(flags); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs b/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs index 8a1e82a..c892504 100644 --- a/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs +++ b/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs @@ -1,59 +1,44 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(889353612)] + [TLObject(889353612)] public class TLReplyKeyboardMarkup : TLAbsReplyMarkup { - public override int Constructor + public override int Constructor => 889353612; + + public int flags { get; set; } + public bool resize { get; set; } + public bool single_use { get; set; } + public bool selective { get; set; } + public TLVector rows { get; set; } + + + public void ComputeFlags() { - get - { - return 889353612; - } + flags = 0; + flags = resize ? flags | 1 : flags & ~1; + flags = single_use ? flags | 2 : flags & ~2; + flags = selective ? flags | 4 : flags & ~4; } - public int flags {get;set;} - public bool resize {get;set;} - public bool single_use {get;set;} - public bool selective {get;set;} - public TLVector rows {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = resize ? (flags | 1) : (flags & ~1); -flags = single_use ? (flags | 2) : (flags & ~2); -flags = selective ? (flags | 4) : (flags & ~4); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -resize = (flags & 1) != 0; -single_use = (flags & 2) != 0; -selective = (flags & 4) != 0; -rows = (TLVector)ObjectUtils.DeserializeVector(br); - + resize = (flags & 1) != 0; + single_use = (flags & 2) != 0; + selective = (flags & 4) != 0; + rows = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - -ObjectUtils.SerializeObject(rows,bw); - + ObjectUtils.SerializeObject(rows, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLRequestInitConnection.cs b/TeleSharp.TL/TL/TLRequestInitConnection.cs index 9ce4488..872e240 100644 --- a/TeleSharp.TL/TL/TLRequestInitConnection.cs +++ b/TeleSharp.TL/TL/TLRequestInitConnection.cs @@ -1,63 +1,49 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1769565673)] + [TLObject(1769565673)] public class TLRequestInitConnection : TLMethod { - public override int Constructor + public override int Constructor => 1769565673; + + public int api_id { get; set; } + public string device_model { get; set; } + public string system_version { get; set; } + public string app_version { get; set; } + public string lang_code { get; set; } + public TLObject query { get; set; } + public TLObject Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1769565673; - } } - public int api_id {get;set;} - public string device_model {get;set;} - public string system_version {get;set;} - public string app_version {get;set;} - public string lang_code {get;set;} - public TLObject query {get;set;} - public TLObject Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { api_id = br.ReadInt32(); -device_model = StringUtil.Deserialize(br); -system_version = StringUtil.Deserialize(br); -app_version = StringUtil.Deserialize(br); -lang_code = StringUtil.Deserialize(br); -query = (TLObject)ObjectUtils.DeserializeObject(br); - + device_model = StringUtil.Deserialize(br); + system_version = StringUtil.Deserialize(br); + app_version = StringUtil.Deserialize(br); + lang_code = StringUtil.Deserialize(br); + query = (TLObject) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(api_id); -StringUtil.Serialize(device_model,bw); -StringUtil.Serialize(system_version,bw); -StringUtil.Serialize(app_version,bw); -StringUtil.Serialize(lang_code,bw); -ObjectUtils.SerializeObject(query,bw); - + StringUtil.Serialize(device_model, bw); + StringUtil.Serialize(system_version, bw); + StringUtil.Serialize(app_version, bw); + StringUtil.Serialize(lang_code, bw); + ObjectUtils.SerializeObject(query, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLObject)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLObject) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs b/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs index 635888a..0801cc8 100644 --- a/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs +++ b/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-878758099)] + [TLObject(-878758099)] public class TLRequestInvokeAfterMsg : TLMethod { - public override int Constructor + public override int Constructor => -878758099; + + public long msg_id { get; set; } + public TLObject query { get; set; } + public TLObject Response { get; set; } + + + public void ComputeFlags() { - get - { - return -878758099; - } } - public long msg_id {get;set;} - public TLObject query {get;set;} - public TLObject Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { msg_id = br.ReadInt64(); -query = (TLObject)ObjectUtils.DeserializeObject(br); - + query = (TLObject) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(msg_id); -ObjectUtils.SerializeObject(query,bw); - + ObjectUtils.SerializeObject(query, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLObject)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLObject) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs b/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs index 16a3a33..a756086 100644 --- a/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs +++ b/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1036301552)] + [TLObject(1036301552)] public class TLRequestInvokeAfterMsgs : TLMethod { - public override int Constructor + public override int Constructor => 1036301552; + + public TLVector msg_ids { get; set; } + public TLObject query { get; set; } + public TLObject Response { get; set; } + + + public void ComputeFlags() { - get - { - return 1036301552; - } } - public TLVector msg_ids {get;set;} - public TLObject query {get;set;} - public TLObject Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - msg_ids = (TLVector)ObjectUtils.DeserializeVector(br); -query = (TLObject)ObjectUtils.DeserializeObject(br); - + msg_ids = ObjectUtils.DeserializeVector(br); + query = (TLObject) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(msg_ids,bw); -ObjectUtils.SerializeObject(query,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(msg_ids, bw); + ObjectUtils.SerializeObject(query, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLObject)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLObject) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs b/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs index b2fe196..b14d7a5 100644 --- a/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs +++ b/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-627372787)] + [TLObject(-627372787)] public class TLRequestInvokeWithLayer : TLMethod { - public override int Constructor + public override int Constructor => -627372787; + + public int layer { get; set; } + public TLObject query { get; set; } + public TLObject Response { get; set; } + + + public void ComputeFlags() { - get - { - return -627372787; - } } - public int layer {get;set;} - public TLObject query {get;set;} - public TLObject Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { layer = br.ReadInt32(); -query = (TLObject)ObjectUtils.DeserializeObject(br); - + query = (TLObject) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(layer); -ObjectUtils.SerializeObject(query,bw); - + ObjectUtils.SerializeObject(query, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLObject)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLObject) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs b/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs index 2614801..51d5694 100644 --- a/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs +++ b/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1080796745)] + [TLObject(-1080796745)] public class TLRequestInvokeWithoutUpdates : TLMethod { - public override int Constructor + public override int Constructor => -1080796745; + + public TLObject query { get; set; } + public TLObject Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1080796745; - } } - public TLObject query {get;set;} - public TLObject Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - query = (TLObject)ObjectUtils.DeserializeObject(br); - + query = (TLObject) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(query,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(query, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLObject)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLObject) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageCancelAction.cs b/TeleSharp.TL/TL/TLSendMessageCancelAction.cs index 10ce44c..3eb5eb4 100644 --- a/TeleSharp.TL/TL/TLSendMessageCancelAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageCancelAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-44119819)] + [TLObject(-44119819)] public class TLSendMessageCancelAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -44119819; + + + public void ComputeFlags() { - get - { - return -44119819; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs b/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs index b46ba18..1aed15e 100644 --- a/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1653390447)] + [TLObject(1653390447)] public class TLSendMessageChooseContactAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => 1653390447; + + + public void ComputeFlags() { - get - { - return 1653390447; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs b/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs index 39f8943..9516ac6 100644 --- a/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-580219064)] + [TLObject(-580219064)] public class TLSendMessageGamePlayAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -580219064; + + + public void ComputeFlags() { - get - { - return -580219064; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs b/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs index 2198012..cba018f 100644 --- a/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(393186209)] + [TLObject(393186209)] public class TLSendMessageGeoLocationAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => 393186209; + + + public void ComputeFlags() { - get - { - return 393186209; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs b/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs index dbf577a..b3e0405 100644 --- a/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-718310409)] + [TLObject(-718310409)] public class TLSendMessageRecordAudioAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -718310409; + + + public void ComputeFlags() { - get - { - return -718310409; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs b/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs index 0c60759..6dd56a7 100644 --- a/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1584933265)] + [TLObject(-1584933265)] public class TLSendMessageRecordVideoAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -1584933265; + + + public void ComputeFlags() { - get - { - return -1584933265; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageTypingAction.cs b/TeleSharp.TL/TL/TLSendMessageTypingAction.cs index 991f168..05c1746 100644 --- a/TeleSharp.TL/TL/TLSendMessageTypingAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageTypingAction.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(381645902)] + [TLObject(381645902)] public class TLSendMessageTypingAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => 381645902; + + + public void ComputeFlags() { - get - { - return 381645902; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs b/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs index 2664cf0..1013bef 100644 --- a/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-212740181)] + [TLObject(-212740181)] public class TLSendMessageUploadAudioAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -212740181; + + public int progress { get; set; } + + + public void ComputeFlags() { - get - { - return -212740181; - } } - public int progress {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(progress); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs b/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs index bc45d33..ff17e3e 100644 --- a/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1441998364)] + [TLObject(-1441998364)] public class TLSendMessageUploadDocumentAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -1441998364; + + public int progress { get; set; } + + + public void ComputeFlags() { - get - { - return -1441998364; - } } - public int progress {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(progress); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs b/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs index 2e8a74d..7c245e7 100644 --- a/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-774682074)] + [TLObject(-774682074)] public class TLSendMessageUploadPhotoAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -774682074; + + public int progress { get; set; } + + + public void ComputeFlags() { - get - { - return -774682074; - } } - public int progress {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(progress); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs b/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs index a2576dd..051fd19 100644 --- a/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs +++ b/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-378127636)] + [TLObject(-378127636)] public class TLSendMessageUploadVideoAction : TLAbsSendMessageAction { - public override int Constructor + public override int Constructor => -378127636; + + public int progress { get; set; } + + + public void ComputeFlags() { - get - { - return -378127636; - } } - public int progress {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(progress); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLStickerPack.cs b/TeleSharp.TL/TL/TLStickerPack.cs index 5e701cd..a25077b 100644 --- a/TeleSharp.TL/TL/TLStickerPack.cs +++ b/TeleSharp.TL/TL/TLStickerPack.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(313694676)] + [TLObject(313694676)] public class TLStickerPack : TLObject { - public override int Constructor + public override int Constructor => 313694676; + + public string emoticon { get; set; } + public TLVector documents { get; set; } + + + public void ComputeFlags() { - get - { - return 313694676; - } } - public string emoticon {get;set;} - public TLVector documents {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { emoticon = StringUtil.Deserialize(br); -documents = (TLVector)ObjectUtils.DeserializeVector(br); - + documents = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(emoticon,bw); -ObjectUtils.SerializeObject(documents,bw); - + bw.Write(Constructor); + StringUtil.Serialize(emoticon, bw); + ObjectUtils.SerializeObject(documents, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLStickerSet.cs b/TeleSharp.TL/TL/TLStickerSet.cs index 166bf1a..8b774b0 100644 --- a/TeleSharp.TL/TL/TLStickerSet.cs +++ b/TeleSharp.TL/TL/TLStickerSet.cs @@ -1,78 +1,62 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-852477119)] + [TLObject(-852477119)] public class TLStickerSet : TLObject { - public override int Constructor + public override int Constructor => -852477119; + + public int flags { get; set; } + public bool installed { get; set; } + public bool archived { get; set; } + public bool official { get; set; } + public bool masks { get; set; } + public long id { get; set; } + public long access_hash { get; set; } + public string title { get; set; } + public string short_name { get; set; } + public int count { get; set; } + public int hash { get; set; } + + + public void ComputeFlags() { - get - { - return -852477119; - } + flags = 0; + flags = installed ? flags | 1 : flags & ~1; + flags = archived ? flags | 2 : flags & ~2; + flags = official ? flags | 4 : flags & ~4; + flags = masks ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool installed {get;set;} - public bool archived {get;set;} - public bool official {get;set;} - public bool masks {get;set;} - public long id {get;set;} - public long access_hash {get;set;} - public string title {get;set;} - public string short_name {get;set;} - public int count {get;set;} - public int hash {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = installed ? (flags | 1) : (flags & ~1); -flags = archived ? (flags | 2) : (flags & ~2); -flags = official ? (flags | 4) : (flags & ~4); -flags = masks ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -installed = (flags & 1) != 0; -archived = (flags & 2) != 0; -official = (flags & 4) != 0; -masks = (flags & 8) != 0; -id = br.ReadInt64(); -access_hash = br.ReadInt64(); -title = StringUtil.Deserialize(br); -short_name = StringUtil.Deserialize(br); -count = br.ReadInt32(); -hash = br.ReadInt32(); - + installed = (flags & 1) != 0; + archived = (flags & 2) != 0; + official = (flags & 4) != 0; + masks = (flags & 8) != 0; + id = br.ReadInt64(); + access_hash = br.ReadInt64(); + title = StringUtil.Deserialize(br); + short_name = StringUtil.Deserialize(br); + count = br.ReadInt32(); + hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - -bw.Write(id); -bw.Write(access_hash); -StringUtil.Serialize(title,bw); -StringUtil.Serialize(short_name,bw); -bw.Write(count); -bw.Write(hash); - + bw.Write(id); + bw.Write(access_hash); + StringUtil.Serialize(title, bw); + StringUtil.Serialize(short_name, bw); + bw.Write(count); + bw.Write(hash); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLStickerSetCovered.cs b/TeleSharp.TL/TL/TLStickerSetCovered.cs index 824a41c..d64d4f5 100644 --- a/TeleSharp.TL/TL/TLStickerSetCovered.cs +++ b/TeleSharp.TL/TL/TLStickerSetCovered.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1678812626)] + [TLObject(1678812626)] public class TLStickerSetCovered : TLAbsStickerSetCovered { - public override int Constructor + public override int Constructor => 1678812626; + + public TLStickerSet set { get; set; } + public TLAbsDocument cover { get; set; } + + + public void ComputeFlags() { - get - { - return 1678812626; - } } - public TLStickerSet @set {get;set;} - public TLAbsDocument cover {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - @set = (TLStickerSet)ObjectUtils.DeserializeObject(br); -cover = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - + set = (TLStickerSet) ObjectUtils.DeserializeObject(br); + cover = (TLAbsDocument) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(@set,bw); -ObjectUtils.SerializeObject(cover,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(set, bw); + ObjectUtils.SerializeObject(cover, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs b/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs index f3f5d1b..acafcca 100644 --- a/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs +++ b/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(872932635)] + [TLObject(872932635)] public class TLStickerSetMultiCovered : TLAbsStickerSetCovered { - public override int Constructor + public override int Constructor => 872932635; + + public TLStickerSet set { get; set; } + public TLVector covers { get; set; } + + + public void ComputeFlags() { - get - { - return 872932635; - } } - public TLStickerSet @set {get;set;} - public TLVector covers {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - @set = (TLStickerSet)ObjectUtils.DeserializeObject(br); -covers = (TLVector)ObjectUtils.DeserializeVector(br); - + set = (TLStickerSet) ObjectUtils.DeserializeObject(br); + covers = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(@set,bw); -ObjectUtils.SerializeObject(covers,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(set, bw); + ObjectUtils.SerializeObject(covers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeer.cs b/TeleSharp.TL/TL/TLTopPeer.cs index 13ed0b6..c746467 100644 --- a/TeleSharp.TL/TL/TLTopPeer.cs +++ b/TeleSharp.TL/TL/TLTopPeer.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-305282981)] + [TLObject(-305282981)] public class TLTopPeer : TLObject { - public override int Constructor + public override int Constructor => -305282981; + + public TLAbsPeer peer { get; set; } + public double rating { get; set; } + + + public void ComputeFlags() { - get - { - return -305282981; - } } - public TLAbsPeer peer {get;set;} - public double rating {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -rating = br.ReadDouble(); - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + rating = br.ReadDouble(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(rating); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(rating); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs b/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs index b44456d..ee99b52 100644 --- a/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs +++ b/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(344356834)] + [TLObject(344356834)] public class TLTopPeerCategoryBotsInline : TLAbsTopPeerCategory { - public override int Constructor + public override int Constructor => 344356834; + + + public void ComputeFlags() { - get - { - return 344356834; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs b/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs index c71bd21..03bb841 100644 --- a/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs +++ b/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1419371685)] + [TLObject(-1419371685)] public class TLTopPeerCategoryBotsPM : TLAbsTopPeerCategory { - public override int Constructor + public override int Constructor => -1419371685; + + + public void ComputeFlags() { - get - { - return -1419371685; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs b/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs index ebe7997..8c832ee 100644 --- a/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs +++ b/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(371037736)] + [TLObject(371037736)] public class TLTopPeerCategoryChannels : TLAbsTopPeerCategory { - public override int Constructor + public override int Constructor => 371037736; + + + public void ComputeFlags() { - get - { - return 371037736; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs b/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs index e402c6c..00240db 100644 --- a/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs +++ b/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(104314861)] + [TLObject(104314861)] public class TLTopPeerCategoryCorrespondents : TLAbsTopPeerCategory { - public override int Constructor + public override int Constructor => 104314861; + + + public void ComputeFlags() { - get - { - return 104314861; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs b/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs index 77d7dde..7ca1086 100644 --- a/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs +++ b/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1122524854)] + [TLObject(-1122524854)] public class TLTopPeerCategoryGroups : TLAbsTopPeerCategory { - public override int Constructor + public override int Constructor => -1122524854; + + + public void ComputeFlags() { - get - { - return -1122524854; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs b/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs index 77b1f6b..5784327 100644 --- a/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs +++ b/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-75283823)] + [TLObject(-75283823)] public class TLTopPeerCategoryPeers : TLObject { - public override int Constructor + public override int Constructor => -75283823; + + public TLAbsTopPeerCategory category { get; set; } + public int count { get; set; } + public TLVector peers { get; set; } + + + public void ComputeFlags() { - get - { - return -75283823; - } } - public TLAbsTopPeerCategory category {get;set;} - public int count {get;set;} - public TLVector peers {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - category = (TLAbsTopPeerCategory)ObjectUtils.DeserializeObject(br); -count = br.ReadInt32(); -peers = (TLVector)ObjectUtils.DeserializeVector(br); - + category = (TLAbsTopPeerCategory) ObjectUtils.DeserializeObject(br); + count = br.ReadInt32(); + peers = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(category,bw); -bw.Write(count); -ObjectUtils.SerializeObject(peers,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(category, bw); + bw.Write(count); + ObjectUtils.SerializeObject(peers, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLTrue.cs b/TeleSharp.TL/TL/TLTrue.cs index 140c5ea..80a39b8 100644 --- a/TeleSharp.TL/TL/TLTrue.cs +++ b/TeleSharp.TL/TL/TLTrue.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1072550713)] + [TLObject(1072550713)] public class TLTrue : TLObject { - public override int Constructor + public override int Constructor => 1072550713; + + + public void ComputeFlags() { - get - { - return 1072550713; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs b/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs index 1ef7fce..0dd9b95 100644 --- a/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs +++ b/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs @@ -1,77 +1,62 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-415938591)] + [TLObject(-415938591)] public class TLUpdateBotCallbackQuery : TLAbsUpdate { - public override int Constructor + public override int Constructor => -415938591; + + public int flags { get; set; } + public long query_id { get; set; } + public int user_id { get; set; } + public TLAbsPeer peer { get; set; } + public int msg_id { get; set; } + public long chat_instance { get; set; } + public byte[] data { get; set; } + public string game_short_name { get; set; } + + + public void ComputeFlags() { - get - { - return -415938591; - } + flags = 0; + flags = data != null ? flags | 1 : flags & ~1; + flags = game_short_name != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public long query_id {get;set;} - public int user_id {get;set;} - public TLAbsPeer peer {get;set;} - public int msg_id {get;set;} - public long chat_instance {get;set;} - public byte[] data {get;set;} - public string game_short_name {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = data != null ? (flags | 1) : (flags & ~1); -flags = game_short_name != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -query_id = br.ReadInt64(); -user_id = br.ReadInt32(); -peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -msg_id = br.ReadInt32(); -chat_instance = br.ReadInt64(); -if ((flags & 1) != 0) -data = BytesUtil.Deserialize(br); -else -data = null; - -if ((flags & 2) != 0) -game_short_name = StringUtil.Deserialize(br); -else -game_short_name = null; - + query_id = br.ReadInt64(); + user_id = br.ReadInt32(); + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + msg_id = br.ReadInt32(); + chat_instance = br.ReadInt64(); + if ((flags & 1) != 0) + data = BytesUtil.Deserialize(br); + else + data = null; + if ((flags & 2) != 0) + game_short_name = StringUtil.Deserialize(br); + else + game_short_name = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(query_id); -bw.Write(user_id); -ObjectUtils.SerializeObject(peer,bw); -bw.Write(msg_id); -bw.Write(chat_instance); -if ((flags & 1) != 0) -BytesUtil.Serialize(data,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(game_short_name,bw); - + bw.Write(flags); + bw.Write(query_id); + bw.Write(user_id); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(msg_id); + bw.Write(chat_instance); + if ((flags & 1) != 0) + BytesUtil.Serialize(data, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(game_short_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs b/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs index 9e2d0cb..a751d3d 100644 --- a/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs +++ b/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs @@ -1,65 +1,51 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1417832080)] + [TLObject(1417832080)] public class TLUpdateBotInlineQuery : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1417832080; + + public int flags { get; set; } + public long query_id { get; set; } + public int user_id { get; set; } + public string query { get; set; } + public TLAbsGeoPoint geo { get; set; } + public string offset { get; set; } + + + public void ComputeFlags() { - get - { - return 1417832080; - } + flags = 0; + flags = geo != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public long query_id {get;set;} - public int user_id {get;set;} - public string query {get;set;} - public TLAbsGeoPoint geo {get;set;} - public string offset {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = geo != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -query_id = br.ReadInt64(); -user_id = br.ReadInt32(); -query = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); -else -geo = null; - -offset = StringUtil.Deserialize(br); + query_id = br.ReadInt64(); + user_id = br.ReadInt32(); + query = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + geo = (TLAbsGeoPoint) ObjectUtils.DeserializeObject(br); + else + geo = null; + offset = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(query_id); -bw.Write(user_id); -StringUtil.Serialize(query,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(geo,bw); -StringUtil.Serialize(offset,bw); - + bw.Write(flags); + bw.Write(query_id); + bw.Write(user_id); + StringUtil.Serialize(query, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(geo, bw); + StringUtil.Serialize(offset, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs b/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs index 3c9c684..6b09be3 100644 --- a/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs +++ b/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs @@ -1,71 +1,56 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(239663460)] + [TLObject(239663460)] public class TLUpdateBotInlineSend : TLAbsUpdate { - public override int Constructor + public override int Constructor => 239663460; + + public int flags { get; set; } + public int user_id { get; set; } + public string query { get; set; } + public TLAbsGeoPoint geo { get; set; } + public string id { get; set; } + public TLInputBotInlineMessageID msg_id { get; set; } + + + public void ComputeFlags() { - get - { - return 239663460; - } + flags = 0; + flags = geo != null ? flags | 1 : flags & ~1; + flags = msg_id != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public int user_id {get;set;} - public string query {get;set;} - public TLAbsGeoPoint geo {get;set;} - public string id {get;set;} - public TLInputBotInlineMessageID msg_id {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = geo != null ? (flags | 1) : (flags & ~1); -flags = msg_id != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -user_id = br.ReadInt32(); -query = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); -else -geo = null; - -id = StringUtil.Deserialize(br); -if ((flags & 2) != 0) -msg_id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); -else -msg_id = null; - + user_id = br.ReadInt32(); + query = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + geo = (TLAbsGeoPoint) ObjectUtils.DeserializeObject(br); + else + geo = null; + id = StringUtil.Deserialize(br); + if ((flags & 2) != 0) + msg_id = (TLInputBotInlineMessageID) ObjectUtils.DeserializeObject(br); + else + msg_id = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(user_id); -StringUtil.Serialize(query,bw); -if ((flags & 1) != 0) -ObjectUtils.SerializeObject(geo,bw); -StringUtil.Serialize(id,bw); -if ((flags & 2) != 0) -ObjectUtils.SerializeObject(msg_id,bw); - + bw.Write(flags); + bw.Write(user_id); + StringUtil.Serialize(query, bw); + if ((flags & 1) != 0) + ObjectUtils.SerializeObject(geo, bw); + StringUtil.Serialize(id, bw); + if ((flags & 2) != 0) + ObjectUtils.SerializeObject(msg_id, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChannel.cs b/TeleSharp.TL/TL/TLUpdateChannel.cs index 69cd7f2..8968869 100644 --- a/TeleSharp.TL/TL/TLUpdateChannel.cs +++ b/TeleSharp.TL/TL/TLUpdateChannel.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1227598250)] + [TLObject(-1227598250)] public class TLUpdateChannel : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1227598250; + + public int channel_id { get; set; } + + + public void ComputeFlags() { - get - { - return -1227598250; - } } - public int channel_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs b/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs index b2c7d1a..8e385a8 100644 --- a/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs +++ b/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1734268085)] + [TLObject(-1734268085)] public class TLUpdateChannelMessageViews : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1734268085; + + public int channel_id { get; set; } + public int id { get; set; } + public int views { get; set; } + + + public void ComputeFlags() { - get - { - return -1734268085; - } } - public int channel_id {get;set;} - public int id {get;set;} - public int views {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -id = br.ReadInt32(); -views = br.ReadInt32(); - + id = br.ReadInt32(); + views = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -bw.Write(id); -bw.Write(views); - + bw.Write(id); + bw.Write(views); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs b/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs index ea79bcb..c802c86 100644 --- a/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1738988427)] + [TLObject(-1738988427)] public class TLUpdateChannelPinnedMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1738988427; + + public int channel_id { get; set; } + public int id { get; set; } + + + public void ComputeFlags() { - get - { - return -1738988427; - } } - public int channel_id {get;set;} - public int id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -id = br.ReadInt32(); - + id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -bw.Write(id); - + bw.Write(id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs b/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs index c4c5c52..5ae6dab 100644 --- a/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs +++ b/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs @@ -1,56 +1,41 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-352032773)] + [TLObject(-352032773)] public class TLUpdateChannelTooLong : TLAbsUpdate { - public override int Constructor + public override int Constructor => -352032773; + + public int flags { get; set; } + public int channel_id { get; set; } + public int? pts { get; set; } + + + public void ComputeFlags() { - get - { - return -352032773; - } + flags = 0; + flags = pts != null ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public int channel_id {get;set;} - public int? pts {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = pts != null ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -channel_id = br.ReadInt32(); -if ((flags & 1) != 0) -pts = br.ReadInt32(); -else -pts = null; - - + channel_id = br.ReadInt32(); + if ((flags & 1) != 0) + pts = br.ReadInt32(); + else + pts = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(channel_id); -if ((flags & 1) != 0) -bw.Write(pts.Value); - + bw.Write(flags); + bw.Write(channel_id); + if ((flags & 1) != 0) + bw.Write(pts.Value); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChatAdmins.cs b/TeleSharp.TL/TL/TLUpdateChatAdmins.cs index fdb056c..91a5356 100644 --- a/TeleSharp.TL/TL/TLUpdateChatAdmins.cs +++ b/TeleSharp.TL/TL/TLUpdateChatAdmins.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1855224129)] + [TLObject(1855224129)] public class TLUpdateChatAdmins : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1855224129; + + public int chat_id { get; set; } + public bool enabled { get; set; } + public int version { get; set; } + + + public void ComputeFlags() { - get - { - return 1855224129; - } } - public int chat_id {get;set;} - public bool enabled {get;set;} - public int version {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -enabled = BoolUtil.Deserialize(br); -version = br.ReadInt32(); - + enabled = BoolUtil.Deserialize(br); + version = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -BoolUtil.Serialize(enabled,bw); -bw.Write(version); - + BoolUtil.Serialize(enabled, bw); + bw.Write(version); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs b/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs index 26150a0..f4610d4 100644 --- a/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs +++ b/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-364179876)] + [TLObject(-364179876)] public class TLUpdateChatParticipantAdd : TLAbsUpdate { - public override int Constructor + public override int Constructor => -364179876; + + public int chat_id { get; set; } + public int user_id { get; set; } + public int inviter_id { get; set; } + public int date { get; set; } + public int version { get; set; } + + + public void ComputeFlags() { - get - { - return -364179876; - } } - public int chat_id {get;set;} - public int user_id {get;set;} - public int inviter_id {get;set;} - public int date {get;set;} - public int version {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = br.ReadInt32(); -inviter_id = br.ReadInt32(); -date = br.ReadInt32(); -version = br.ReadInt32(); - + user_id = br.ReadInt32(); + inviter_id = br.ReadInt32(); + date = br.ReadInt32(); + version = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -bw.Write(user_id); -bw.Write(inviter_id); -bw.Write(date); -bw.Write(version); - + bw.Write(user_id); + bw.Write(inviter_id); + bw.Write(date); + bw.Write(version); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs b/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs index ec25685..15f8ea9 100644 --- a/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs +++ b/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1232070311)] + [TLObject(-1232070311)] public class TLUpdateChatParticipantAdmin : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1232070311; + + public int chat_id { get; set; } + public int user_id { get; set; } + public bool is_admin { get; set; } + public int version { get; set; } + + + public void ComputeFlags() { - get - { - return -1232070311; - } } - public int chat_id {get;set;} - public int user_id {get;set;} - public bool is_admin {get;set;} - public int version {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = br.ReadInt32(); -is_admin = BoolUtil.Deserialize(br); -version = br.ReadInt32(); - + user_id = br.ReadInt32(); + is_admin = BoolUtil.Deserialize(br); + version = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -bw.Write(user_id); -BoolUtil.Serialize(is_admin,bw); -bw.Write(version); - + bw.Write(user_id); + BoolUtil.Serialize(is_admin, bw); + bw.Write(version); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs b/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs index 7c6e5b2..a863b5d 100644 --- a/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs +++ b/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1851755554)] + [TLObject(1851755554)] public class TLUpdateChatParticipantDelete : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1851755554; + + public int chat_id { get; set; } + public int user_id { get; set; } + public int version { get; set; } + + + public void ComputeFlags() { - get - { - return 1851755554; - } } - public int chat_id {get;set;} - public int user_id {get;set;} - public int version {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = br.ReadInt32(); -version = br.ReadInt32(); - + user_id = br.ReadInt32(); + version = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -bw.Write(user_id); -bw.Write(version); - + bw.Write(user_id); + bw.Write(version); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChatParticipants.cs b/TeleSharp.TL/TL/TLUpdateChatParticipants.cs index e979f69..74ba79e 100644 --- a/TeleSharp.TL/TL/TLUpdateChatParticipants.cs +++ b/TeleSharp.TL/TL/TLUpdateChatParticipants.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(125178264)] + [TLObject(125178264)] public class TLUpdateChatParticipants : TLAbsUpdate { - public override int Constructor + public override int Constructor => 125178264; + + public TLAbsChatParticipants participants { get; set; } + + + public void ComputeFlags() { - get - { - return 125178264; - } } - public TLAbsChatParticipants participants {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - participants = (TLAbsChatParticipants)ObjectUtils.DeserializeObject(br); - + participants = (TLAbsChatParticipants) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(participants,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(participants, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs b/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs index d956579..d7ec1fe 100644 --- a/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs +++ b/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1704596961)] + [TLObject(-1704596961)] public class TLUpdateChatUserTyping : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1704596961; + + public int chat_id { get; set; } + public int user_id { get; set; } + public TLAbsSendMessageAction action { get; set; } + + + public void ComputeFlags() { - get - { - return -1704596961; - } } - public int chat_id {get;set;} - public int user_id {get;set;} - public TLAbsSendMessageAction action {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -user_id = br.ReadInt32(); -action = (TLAbsSendMessageAction)ObjectUtils.DeserializeObject(br); - + user_id = br.ReadInt32(); + action = (TLAbsSendMessageAction) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -bw.Write(user_id); -ObjectUtils.SerializeObject(action,bw); - + bw.Write(user_id); + ObjectUtils.SerializeObject(action, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateConfig.cs b/TeleSharp.TL/TL/TLUpdateConfig.cs index ad80876..6b35e10 100644 --- a/TeleSharp.TL/TL/TLUpdateConfig.cs +++ b/TeleSharp.TL/TL/TLUpdateConfig.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1574314746)] + [TLObject(-1574314746)] public class TLUpdateConfig : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1574314746; + + + public void ComputeFlags() { - get - { - return -1574314746; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateContactLink.cs b/TeleSharp.TL/TL/TLUpdateContactLink.cs index 186bab2..951cca1 100644 --- a/TeleSharp.TL/TL/TLUpdateContactLink.cs +++ b/TeleSharp.TL/TL/TLUpdateContactLink.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1657903163)] + [TLObject(-1657903163)] public class TLUpdateContactLink : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1657903163; + + public int user_id { get; set; } + public TLAbsContactLink my_link { get; set; } + public TLAbsContactLink foreign_link { get; set; } + + + public void ComputeFlags() { - get - { - return -1657903163; - } } - public int user_id {get;set;} - public TLAbsContactLink my_link {get;set;} - public TLAbsContactLink foreign_link {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -my_link = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); -foreign_link = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); - + my_link = (TLAbsContactLink) ObjectUtils.DeserializeObject(br); + foreign_link = (TLAbsContactLink) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -ObjectUtils.SerializeObject(my_link,bw); -ObjectUtils.SerializeObject(foreign_link,bw); - + ObjectUtils.SerializeObject(my_link, bw); + ObjectUtils.SerializeObject(foreign_link, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateContactRegistered.cs b/TeleSharp.TL/TL/TLUpdateContactRegistered.cs index 6621713..d47af84 100644 --- a/TeleSharp.TL/TL/TLUpdateContactRegistered.cs +++ b/TeleSharp.TL/TL/TLUpdateContactRegistered.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(628472761)] + [TLObject(628472761)] public class TLUpdateContactRegistered : TLAbsUpdate { - public override int Constructor + public override int Constructor => 628472761; + + public int user_id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return 628472761; - } } - public int user_id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -date = br.ReadInt32(); - + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(date); - + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateDcOptions.cs b/TeleSharp.TL/TL/TLUpdateDcOptions.cs index 7ca80a1..fbabddf 100644 --- a/TeleSharp.TL/TL/TLUpdateDcOptions.cs +++ b/TeleSharp.TL/TL/TLUpdateDcOptions.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1906403213)] + [TLObject(-1906403213)] public class TLUpdateDcOptions : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1906403213; + + public TLVector dc_options { get; set; } + + + public void ComputeFlags() { - get - { - return -1906403213; - } } - public TLVector dc_options {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - dc_options = (TLVector)ObjectUtils.DeserializeVector(br); - + dc_options = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(dc_options,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(dc_options, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs b/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs index a1fea02..d90aafd 100644 --- a/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs +++ b/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1015733815)] + [TLObject(-1015733815)] public class TLUpdateDeleteChannelMessages : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1015733815; + + public int channel_id { get; set; } + public TLVector messages { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return -1015733815; - } } - public int channel_id {get;set;} - public TLVector messages {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + messages = ObjectUtils.DeserializeVector(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -ObjectUtils.SerializeObject(messages,bw); -bw.Write(pts); -bw.Write(pts_count); - + ObjectUtils.SerializeObject(messages, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs b/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs index d9d0ee0..634517b 100644 --- a/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs +++ b/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1576161051)] + [TLObject(-1576161051)] public class TLUpdateDeleteMessages : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1576161051; + + public TLVector messages { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return -1576161051; - } } - public TLVector messages {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - messages = (TLVector)ObjectUtils.DeserializeVector(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + messages = ObjectUtils.DeserializeVector(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(messages,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(messages, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateDraftMessage.cs b/TeleSharp.TL/TL/TLUpdateDraftMessage.cs index d7f299b..98dba68 100644 --- a/TeleSharp.TL/TL/TLUpdateDraftMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateDraftMessage.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-299124375)] + [TLObject(-299124375)] public class TLUpdateDraftMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => -299124375; + + public TLAbsPeer peer { get; set; } + public TLAbsDraftMessage draft { get; set; } + + + public void ComputeFlags() { - get - { - return -299124375; - } } - public TLAbsPeer peer {get;set;} - public TLAbsDraftMessage draft {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -draft = (TLAbsDraftMessage)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + draft = (TLAbsDraftMessage) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(draft,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(draft, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs b/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs index 7da5979..e1d1308 100644 --- a/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(457133559)] + [TLObject(457133559)] public class TLUpdateEditChannelMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => 457133559; + + public TLAbsMessage message { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return 457133559; - } } - public TLAbsMessage message {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + message = (TLAbsMessage) ObjectUtils.DeserializeObject(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(message,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(message, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateEditMessage.cs b/TeleSharp.TL/TL/TLUpdateEditMessage.cs index de8df3f..4378c34 100644 --- a/TeleSharp.TL/TL/TLUpdateEditMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateEditMessage.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-469536605)] + [TLObject(-469536605)] public class TLUpdateEditMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => -469536605; + + public TLAbsMessage message { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return -469536605; - } } - public TLAbsMessage message {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + message = (TLAbsMessage) ObjectUtils.DeserializeObject(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(message,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(message, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs b/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs index 50cb232..1f0aad3 100644 --- a/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs +++ b/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(386986326)] + [TLObject(386986326)] public class TLUpdateEncryptedChatTyping : TLAbsUpdate { - public override int Constructor + public override int Constructor => 386986326; + + public int chat_id { get; set; } + + + public void ComputeFlags() { - get - { - return 386986326; - } } - public int chat_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs b/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs index 298120f..a4ec786 100644 --- a/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs +++ b/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(956179895)] + [TLObject(956179895)] public class TLUpdateEncryptedMessagesRead : TLAbsUpdate { - public override int Constructor + public override int Constructor => 956179895; + + public int chat_id { get; set; } + public int max_date { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return 956179895; - } } - public int chat_id {get;set;} - public int max_date {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { chat_id = br.ReadInt32(); -max_date = br.ReadInt32(); -date = br.ReadInt32(); - + max_date = br.ReadInt32(); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(chat_id); -bw.Write(max_date); -bw.Write(date); - + bw.Write(max_date); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateEncryption.cs b/TeleSharp.TL/TL/TLUpdateEncryption.cs index 7103c27..e8b9dca 100644 --- a/TeleSharp.TL/TL/TLUpdateEncryption.cs +++ b/TeleSharp.TL/TL/TLUpdateEncryption.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1264392051)] + [TLObject(-1264392051)] public class TLUpdateEncryption : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1264392051; + + public TLAbsEncryptedChat chat { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -1264392051; - } } - public TLAbsEncryptedChat chat {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - chat = (TLAbsEncryptedChat)ObjectUtils.DeserializeObject(br); -date = br.ReadInt32(); - + chat = (TLAbsEncryptedChat) ObjectUtils.DeserializeObject(br); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(chat,bw); -bw.Write(date); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(chat, bw); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs b/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs index de61535..f4209ad 100644 --- a/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs +++ b/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs @@ -1,74 +1,59 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-103646630)] + [TLObject(-103646630)] public class TLUpdateInlineBotCallbackQuery : TLAbsUpdate { - public override int Constructor + public override int Constructor => -103646630; + + public int flags { get; set; } + public long query_id { get; set; } + public int user_id { get; set; } + public TLInputBotInlineMessageID msg_id { get; set; } + public long chat_instance { get; set; } + public byte[] data { get; set; } + public string game_short_name { get; set; } + + + public void ComputeFlags() { - get - { - return -103646630; - } + flags = 0; + flags = data != null ? flags | 1 : flags & ~1; + flags = game_short_name != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public long query_id {get;set;} - public int user_id {get;set;} - public TLInputBotInlineMessageID msg_id {get;set;} - public long chat_instance {get;set;} - public byte[] data {get;set;} - public string game_short_name {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = data != null ? (flags | 1) : (flags & ~1); -flags = game_short_name != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -query_id = br.ReadInt64(); -user_id = br.ReadInt32(); -msg_id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); -chat_instance = br.ReadInt64(); -if ((flags & 1) != 0) -data = BytesUtil.Deserialize(br); -else -data = null; - -if ((flags & 2) != 0) -game_short_name = StringUtil.Deserialize(br); -else -game_short_name = null; - + query_id = br.ReadInt64(); + user_id = br.ReadInt32(); + msg_id = (TLInputBotInlineMessageID) ObjectUtils.DeserializeObject(br); + chat_instance = br.ReadInt64(); + if ((flags & 1) != 0) + data = BytesUtil.Deserialize(br); + else + data = null; + if ((flags & 2) != 0) + game_short_name = StringUtil.Deserialize(br); + else + game_short_name = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(query_id); -bw.Write(user_id); -ObjectUtils.SerializeObject(msg_id,bw); -bw.Write(chat_instance); -if ((flags & 1) != 0) -BytesUtil.Serialize(data,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(game_short_name,bw); - + bw.Write(flags); + bw.Write(query_id); + bw.Write(user_id); + ObjectUtils.SerializeObject(msg_id, bw); + bw.Write(chat_instance); + if ((flags & 1) != 0) + BytesUtil.Serialize(data, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(game_short_name, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateMessageID.cs b/TeleSharp.TL/TL/TLUpdateMessageID.cs index 87af18a..9b60062 100644 --- a/TeleSharp.TL/TL/TLUpdateMessageID.cs +++ b/TeleSharp.TL/TL/TLUpdateMessageID.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1318109142)] + [TLObject(1318109142)] public class TLUpdateMessageID : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1318109142; + + public int id { get; set; } + public long random_id { get; set; } + + + public void ComputeFlags() { - get - { - return 1318109142; - } } - public int id {get;set;} - public long random_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -random_id = br.ReadInt64(); - + random_id = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(random_id); - + bw.Write(random_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateNewAuthorization.cs b/TeleSharp.TL/TL/TLUpdateNewAuthorization.cs index df03f05..02705aa 100644 --- a/TeleSharp.TL/TL/TLUpdateNewAuthorization.cs +++ b/TeleSharp.TL/TL/TLUpdateNewAuthorization.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1895411046)] + [TLObject(-1895411046)] public class TLUpdateNewAuthorization : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1895411046; + + public long auth_key_id { get; set; } + public int date { get; set; } + public string device { get; set; } + public string location { get; set; } + + + public void ComputeFlags() { - get - { - return -1895411046; - } } - public long auth_key_id {get;set;} - public int date {get;set;} - public string device {get;set;} - public string location {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { auth_key_id = br.ReadInt64(); -date = br.ReadInt32(); -device = StringUtil.Deserialize(br); -location = StringUtil.Deserialize(br); - + date = br.ReadInt32(); + device = StringUtil.Deserialize(br); + location = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(auth_key_id); -bw.Write(date); -StringUtil.Serialize(device,bw); -StringUtil.Serialize(location,bw); - + bw.Write(date); + StringUtil.Serialize(device, bw); + StringUtil.Serialize(location, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs b/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs index 7bd6c21..db9d914 100644 --- a/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1656358105)] + [TLObject(1656358105)] public class TLUpdateNewChannelMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1656358105; + + public TLAbsMessage message { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return 1656358105; - } } - public TLAbsMessage message {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + message = (TLAbsMessage) ObjectUtils.DeserializeObject(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(message,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(message, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs b/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs index 43e1398..19c29cd 100644 --- a/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(314359194)] + [TLObject(314359194)] public class TLUpdateNewEncryptedMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => 314359194; + + public TLAbsEncryptedMessage message { get; set; } + public int qts { get; set; } + + + public void ComputeFlags() { - get - { - return 314359194; - } } - public TLAbsEncryptedMessage message {get;set;} - public int qts {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - message = (TLAbsEncryptedMessage)ObjectUtils.DeserializeObject(br); -qts = br.ReadInt32(); - + message = (TLAbsEncryptedMessage) ObjectUtils.DeserializeObject(br); + qts = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(message,bw); -bw.Write(qts); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(message, bw); + bw.Write(qts); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateNewMessage.cs b/TeleSharp.TL/TL/TLUpdateNewMessage.cs index 0c524b8..0b297e1 100644 --- a/TeleSharp.TL/TL/TLUpdateNewMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateNewMessage.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(522914557)] + [TLObject(522914557)] public class TLUpdateNewMessage : TLAbsUpdate { - public override int Constructor + public override int Constructor => 522914557; + + public TLAbsMessage message { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return 522914557; - } } - public TLAbsMessage message {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + message = (TLAbsMessage) ObjectUtils.DeserializeObject(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(message,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(message, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs b/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs index cfa46d8..7a62d7d 100644 --- a/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs +++ b/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1753886890)] + [TLObject(1753886890)] public class TLUpdateNewStickerSet : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1753886890; + + public Messages.TLStickerSet stickerset { get; set; } + + + public void ComputeFlags() { - get - { - return 1753886890; - } } - public Messages.TLStickerSet stickerset {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - stickerset = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); - + stickerset = (Messages.TLStickerSet) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(stickerset,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(stickerset, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateNotifySettings.cs b/TeleSharp.TL/TL/TLUpdateNotifySettings.cs index 27989f0..968eb28 100644 --- a/TeleSharp.TL/TL/TLUpdateNotifySettings.cs +++ b/TeleSharp.TL/TL/TLUpdateNotifySettings.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1094555409)] + [TLObject(-1094555409)] public class TLUpdateNotifySettings : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1094555409; + + public TLAbsNotifyPeer peer { get; set; } + public TLAbsPeerNotifySettings notify_settings { get; set; } + + + public void ComputeFlags() { - get - { - return -1094555409; - } } - public TLAbsNotifyPeer peer {get;set;} - public TLAbsPeerNotifySettings notify_settings {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsNotifyPeer)ObjectUtils.DeserializeObject(br); -notify_settings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); - + peer = (TLAbsNotifyPeer) ObjectUtils.DeserializeObject(br); + notify_settings = (TLAbsPeerNotifySettings) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -ObjectUtils.SerializeObject(notify_settings,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + ObjectUtils.SerializeObject(notify_settings, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdatePrivacy.cs b/TeleSharp.TL/TL/TLUpdatePrivacy.cs index b4f0840..7c2560b 100644 --- a/TeleSharp.TL/TL/TLUpdatePrivacy.cs +++ b/TeleSharp.TL/TL/TLUpdatePrivacy.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-298113238)] + [TLObject(-298113238)] public class TLUpdatePrivacy : TLAbsUpdate { - public override int Constructor + public override int Constructor => -298113238; + + public TLAbsPrivacyKey key { get; set; } + public TLVector rules { get; set; } + + + public void ComputeFlags() { - get - { - return -298113238; - } } - public TLAbsPrivacyKey key {get;set;} - public TLVector rules {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - key = (TLAbsPrivacyKey)ObjectUtils.DeserializeObject(br); -rules = (TLVector)ObjectUtils.DeserializeVector(br); - + key = (TLAbsPrivacyKey) ObjectUtils.DeserializeObject(br); + rules = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(key,bw); -ObjectUtils.SerializeObject(rules,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(key, bw); + ObjectUtils.SerializeObject(rules, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdatePtsChanged.cs b/TeleSharp.TL/TL/TLUpdatePtsChanged.cs index 746ef21..ab07eb5 100644 --- a/TeleSharp.TL/TL/TLUpdatePtsChanged.cs +++ b/TeleSharp.TL/TL/TLUpdatePtsChanged.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(861169551)] + [TLObject(861169551)] public class TLUpdatePtsChanged : TLAbsUpdate { - public override int Constructor + public override int Constructor => 861169551; + + + public void ComputeFlags() { - get - { - return 861169551; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs b/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs index 1e8b0e7..663f27e 100644 --- a/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs +++ b/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1108669311)] + [TLObject(1108669311)] public class TLUpdateReadChannelInbox : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1108669311; + + public int channel_id { get; set; } + public int max_id { get; set; } + + + public void ComputeFlags() { - get - { - return 1108669311; - } } - public int channel_id {get;set;} - public int max_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -max_id = br.ReadInt32(); - + max_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -bw.Write(max_id); - + bw.Write(max_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs b/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs index 9f612b7..05043e0 100644 --- a/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs +++ b/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(634833351)] + [TLObject(634833351)] public class TLUpdateReadChannelOutbox : TLAbsUpdate { - public override int Constructor + public override int Constructor => 634833351; + + public int channel_id { get; set; } + public int max_id { get; set; } + + + public void ComputeFlags() { - get - { - return 634833351; - } } - public int channel_id {get;set;} - public int max_id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { channel_id = br.ReadInt32(); -max_id = br.ReadInt32(); - + max_id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(channel_id); -bw.Write(max_id); - + bw.Write(max_id); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs b/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs index 0479235..64222b8 100644 --- a/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs +++ b/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1461528386)] + [TLObject(1461528386)] public class TLUpdateReadFeaturedStickers : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1461528386; + + + public void ComputeFlags() { - get - { - return 1461528386; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs b/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs index 91038db..dda3fb1 100644 --- a/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs +++ b/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1721631396)] + [TLObject(-1721631396)] public class TLUpdateReadHistoryInbox : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1721631396; + + public TLAbsPeer peer { get; set; } + public int max_id { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return -1721631396; - } } - public TLAbsPeer peer {get;set;} - public int max_id {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -max_id = br.ReadInt32(); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + max_id = br.ReadInt32(); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(max_id); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(max_id); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs b/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs index 1fc526e..c675871 100644 --- a/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs +++ b/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(791617983)] + [TLObject(791617983)] public class TLUpdateReadHistoryOutbox : TLAbsUpdate { - public override int Constructor + public override int Constructor => 791617983; + + public TLAbsPeer peer { get; set; } + public int max_id { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return 791617983; - } } - public TLAbsPeer peer {get;set;} - public int max_id {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); -max_id = br.ReadInt32(); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + peer = (TLAbsPeer) ObjectUtils.DeserializeObject(br); + max_id = br.ReadInt32(); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(peer,bw); -bw.Write(max_id); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(peer, bw); + bw.Write(max_id); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs b/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs index 63faf4c..8ce1617 100644 --- a/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs +++ b/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1757493555)] + [TLObject(1757493555)] public class TLUpdateReadMessagesContents : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1757493555; + + public TLVector messages { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return 1757493555; - } } - public TLVector messages {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - messages = (TLVector)ObjectUtils.DeserializeVector(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + messages = ObjectUtils.DeserializeVector(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(messages,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(messages, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateRecentStickers.cs b/TeleSharp.TL/TL/TLUpdateRecentStickers.cs index 9f49524..345c59e 100644 --- a/TeleSharp.TL/TL/TLUpdateRecentStickers.cs +++ b/TeleSharp.TL/TL/TLUpdateRecentStickers.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1706939360)] + [TLObject(-1706939360)] public class TLUpdateRecentStickers : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1706939360; + + + public void ComputeFlags() { - get - { - return -1706939360; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateSavedGifs.cs b/TeleSharp.TL/TL/TLUpdateSavedGifs.cs index b236193..4e97b80 100644 --- a/TeleSharp.TL/TL/TLUpdateSavedGifs.cs +++ b/TeleSharp.TL/TL/TLUpdateSavedGifs.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1821035490)] + [TLObject(-1821035490)] public class TLUpdateSavedGifs : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1821035490; + + + public void ComputeFlags() { - get - { - return -1821035490; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateServiceNotification.cs b/TeleSharp.TL/TL/TLUpdateServiceNotification.cs index fead92c..9133264 100644 --- a/TeleSharp.TL/TL/TLUpdateServiceNotification.cs +++ b/TeleSharp.TL/TL/TLUpdateServiceNotification.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(942527460)] + [TLObject(942527460)] public class TLUpdateServiceNotification : TLAbsUpdate { - public override int Constructor + public override int Constructor => 942527460; + + public string type { get; set; } + public string message { get; set; } + public TLAbsMessageMedia media { get; set; } + public bool popup { get; set; } + + + public void ComputeFlags() { - get - { - return 942527460; - } } - public string type {get;set;} - public string message {get;set;} - public TLAbsMessageMedia media {get;set;} - public bool popup {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { type = StringUtil.Deserialize(br); -message = StringUtil.Deserialize(br); -media = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); -popup = BoolUtil.Deserialize(br); - + message = StringUtil.Deserialize(br); + media = (TLAbsMessageMedia) ObjectUtils.DeserializeObject(br); + popup = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - StringUtil.Serialize(type,bw); -StringUtil.Serialize(message,bw); -ObjectUtils.SerializeObject(media,bw); -BoolUtil.Serialize(popup,bw); - + bw.Write(Constructor); + StringUtil.Serialize(type, bw); + StringUtil.Serialize(message, bw); + ObjectUtils.SerializeObject(media, bw); + BoolUtil.Serialize(popup, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateShort.cs b/TeleSharp.TL/TL/TLUpdateShort.cs index 96a9f47..a930c67 100644 --- a/TeleSharp.TL/TL/TLUpdateShort.cs +++ b/TeleSharp.TL/TL/TLUpdateShort.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2027216577)] + [TLObject(2027216577)] public class TLUpdateShort : TLAbsUpdates { - public override int Constructor + public override int Constructor => 2027216577; + + public TLAbsUpdate update { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return 2027216577; - } } - public TLAbsUpdate update {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - update = (TLAbsUpdate)ObjectUtils.DeserializeObject(br); -date = br.ReadInt32(); - + update = (TLAbsUpdate) ObjectUtils.DeserializeObject(br); + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(update,bw); -bw.Write(date); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(update, bw); + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs b/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs index 30062c9..af110c1 100644 --- a/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs @@ -1,117 +1,100 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(377562760)] + [TLObject(377562760)] public class TLUpdateShortChatMessage : TLAbsUpdates { - public override int Constructor + public override int Constructor => 377562760; + + public int flags { get; set; } + public bool @out { get; set; } + public bool mentioned { get; set; } + public bool media_unread { get; set; } + public bool silent { get; set; } + public int id { get; set; } + public int from_id { get; set; } + public int chat_id { get; set; } + public string message { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + public int date { get; set; } + public TLMessageFwdHeader fwd_from { get; set; } + public int? via_bot_id { get; set; } + public int? reply_to_msg_id { get; set; } + public TLVector entities { get; set; } + + + public void ComputeFlags() { - get - { - return 377562760; - } + flags = 0; + flags = @out ? flags | 2 : flags & ~2; + flags = mentioned ? flags | 16 : flags & ~16; + flags = media_unread ? flags | 32 : flags & ~32; + flags = silent ? flags | 8192 : flags & ~8192; + flags = fwd_from != null ? flags | 4 : flags & ~4; + flags = via_bot_id != null ? flags | 2048 : flags & ~2048; + flags = reply_to_msg_id != null ? flags | 8 : flags & ~8; + flags = entities != null ? flags | 128 : flags & ~128; } - public int flags {get;set;} - public bool @out {get;set;} - public bool mentioned {get;set;} - public bool media_unread {get;set;} - public bool silent {get;set;} - public int id {get;set;} - public int from_id {get;set;} - public int chat_id {get;set;} - public string message {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - public int date {get;set;} - public TLMessageFwdHeader fwd_from {get;set;} - public int? via_bot_id {get;set;} - public int? reply_to_msg_id {get;set;} - public TLVector entities {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = @out ? (flags | 2) : (flags & ~2); -flags = mentioned ? (flags | 16) : (flags & ~16); -flags = media_unread ? (flags | 32) : (flags & ~32); -flags = silent ? (flags | 8192) : (flags & ~8192); -flags = fwd_from != null ? (flags | 4) : (flags & ~4); -flags = via_bot_id != null ? (flags | 2048) : (flags & ~2048); -flags = reply_to_msg_id != null ? (flags | 8) : (flags & ~8); -flags = entities != null ? (flags | 128) : (flags & ~128); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -@out = (flags & 2) != 0; -mentioned = (flags & 16) != 0; -media_unread = (flags & 32) != 0; -silent = (flags & 8192) != 0; -id = br.ReadInt32(); -from_id = br.ReadInt32(); -chat_id = br.ReadInt32(); -message = StringUtil.Deserialize(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); -date = br.ReadInt32(); -if ((flags & 4) != 0) -fwd_from = (TLMessageFwdHeader)ObjectUtils.DeserializeObject(br); -else -fwd_from = null; + @out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + id = br.ReadInt32(); + from_id = br.ReadInt32(); + chat_id = br.ReadInt32(); + message = StringUtil.Deserialize(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); + date = br.ReadInt32(); + if ((flags & 4) != 0) + fwd_from = (TLMessageFwdHeader) ObjectUtils.DeserializeObject(br); + else + fwd_from = null; -if ((flags & 2048) != 0) -via_bot_id = br.ReadInt32(); -else -via_bot_id = null; - -if ((flags & 8) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -if ((flags & 128) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; + if ((flags & 2048) != 0) + via_bot_id = br.ReadInt32(); + else + via_bot_id = null; + if ((flags & 8) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + if ((flags & 128) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - -bw.Write(id); -bw.Write(from_id); -bw.Write(chat_id); -StringUtil.Serialize(message,bw); -bw.Write(pts); -bw.Write(pts_count); -bw.Write(date); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(fwd_from,bw); -if ((flags & 2048) != 0) -bw.Write(via_bot_id.Value); -if ((flags & 8) != 0) -bw.Write(reply_to_msg_id.Value); -if ((flags & 128) != 0) -ObjectUtils.SerializeObject(entities,bw); - + bw.Write(id); + bw.Write(from_id); + bw.Write(chat_id); + StringUtil.Serialize(message, bw); + bw.Write(pts); + bw.Write(pts_count); + bw.Write(date); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(fwd_from, bw); + if ((flags & 2048) != 0) + bw.Write(via_bot_id.Value); + if ((flags & 8) != 0) + bw.Write(reply_to_msg_id.Value); + if ((flags & 128) != 0) + ObjectUtils.SerializeObject(entities, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateShortMessage.cs b/TeleSharp.TL/TL/TLUpdateShortMessage.cs index af3cbfe..b2c4ef0 100644 --- a/TeleSharp.TL/TL/TLUpdateShortMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateShortMessage.cs @@ -1,114 +1,97 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1857044719)] + [TLObject(-1857044719)] public class TLUpdateShortMessage : TLAbsUpdates { - public override int Constructor + public override int Constructor => -1857044719; + + public int flags { get; set; } + public bool @out { get; set; } + public bool mentioned { get; set; } + public bool media_unread { get; set; } + public bool silent { get; set; } + public int id { get; set; } + public int user_id { get; set; } + public string message { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + public int date { get; set; } + public TLMessageFwdHeader fwd_from { get; set; } + public int? via_bot_id { get; set; } + public int? reply_to_msg_id { get; set; } + public TLVector entities { get; set; } + + + public void ComputeFlags() { - get - { - return -1857044719; - } + flags = 0; + flags = @out ? flags | 2 : flags & ~2; + flags = mentioned ? flags | 16 : flags & ~16; + flags = media_unread ? flags | 32 : flags & ~32; + flags = silent ? flags | 8192 : flags & ~8192; + flags = fwd_from != null ? flags | 4 : flags & ~4; + flags = via_bot_id != null ? flags | 2048 : flags & ~2048; + flags = reply_to_msg_id != null ? flags | 8 : flags & ~8; + flags = entities != null ? flags | 128 : flags & ~128; } - public int flags {get;set;} - public bool @out {get;set;} - public bool mentioned {get;set;} - public bool media_unread {get;set;} - public bool silent {get;set;} - public int id {get;set;} - public int user_id {get;set;} - public string message {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - public int date {get;set;} - public TLMessageFwdHeader fwd_from {get;set;} - public int? via_bot_id {get;set;} - public int? reply_to_msg_id {get;set;} - public TLVector entities {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = @out ? (flags | 2) : (flags & ~2); -flags = mentioned ? (flags | 16) : (flags & ~16); -flags = media_unread ? (flags | 32) : (flags & ~32); -flags = silent ? (flags | 8192) : (flags & ~8192); -flags = fwd_from != null ? (flags | 4) : (flags & ~4); -flags = via_bot_id != null ? (flags | 2048) : (flags & ~2048); -flags = reply_to_msg_id != null ? (flags | 8) : (flags & ~8); -flags = entities != null ? (flags | 128) : (flags & ~128); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -@out = (flags & 2) != 0; -mentioned = (flags & 16) != 0; -media_unread = (flags & 32) != 0; -silent = (flags & 8192) != 0; -id = br.ReadInt32(); -user_id = br.ReadInt32(); -message = StringUtil.Deserialize(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); -date = br.ReadInt32(); -if ((flags & 4) != 0) -fwd_from = (TLMessageFwdHeader)ObjectUtils.DeserializeObject(br); -else -fwd_from = null; + @out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + id = br.ReadInt32(); + user_id = br.ReadInt32(); + message = StringUtil.Deserialize(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); + date = br.ReadInt32(); + if ((flags & 4) != 0) + fwd_from = (TLMessageFwdHeader) ObjectUtils.DeserializeObject(br); + else + fwd_from = null; -if ((flags & 2048) != 0) -via_bot_id = br.ReadInt32(); -else -via_bot_id = null; - -if ((flags & 8) != 0) -reply_to_msg_id = br.ReadInt32(); -else -reply_to_msg_id = null; - -if ((flags & 128) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; + if ((flags & 2048) != 0) + via_bot_id = br.ReadInt32(); + else + via_bot_id = null; + if ((flags & 8) != 0) + reply_to_msg_id = br.ReadInt32(); + else + reply_to_msg_id = null; + if ((flags & 128) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - -bw.Write(id); -bw.Write(user_id); -StringUtil.Serialize(message,bw); -bw.Write(pts); -bw.Write(pts_count); -bw.Write(date); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(fwd_from,bw); -if ((flags & 2048) != 0) -bw.Write(via_bot_id.Value); -if ((flags & 8) != 0) -bw.Write(reply_to_msg_id.Value); -if ((flags & 128) != 0) -ObjectUtils.SerializeObject(entities,bw); - + bw.Write(id); + bw.Write(user_id); + StringUtil.Serialize(message, bw); + bw.Write(pts); + bw.Write(pts_count); + bw.Write(date); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(fwd_from, bw); + if ((flags & 2048) != 0) + bw.Write(via_bot_id.Value); + if ((flags & 8) != 0) + bw.Write(reply_to_msg_id.Value); + if ((flags & 128) != 0) + ObjectUtils.SerializeObject(entities, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs b/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs index 62ebdf5..56ebd33 100644 --- a/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs +++ b/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs @@ -1,78 +1,63 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(301019932)] + [TLObject(301019932)] public class TLUpdateShortSentMessage : TLAbsUpdates { - public override int Constructor + public override int Constructor => 301019932; + + public int flags { get; set; } + public bool @out { get; set; } + public int id { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + public int date { get; set; } + public TLAbsMessageMedia media { get; set; } + public TLVector entities { get; set; } + + + public void ComputeFlags() { - get - { - return 301019932; - } + flags = 0; + flags = @out ? flags | 2 : flags & ~2; + flags = media != null ? flags | 512 : flags & ~512; + flags = entities != null ? flags | 128 : flags & ~128; } - public int flags {get;set;} - public bool @out {get;set;} - public int id {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - public int date {get;set;} - public TLAbsMessageMedia media {get;set;} - public TLVector entities {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = @out ? (flags | 2) : (flags & ~2); -flags = media != null ? (flags | 512) : (flags & ~512); -flags = entities != null ? (flags | 128) : (flags & ~128); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -@out = (flags & 2) != 0; -id = br.ReadInt32(); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); -date = br.ReadInt32(); -if ((flags & 512) != 0) -media = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); -else -media = null; - -if ((flags & 128) != 0) -entities = (TLVector)ObjectUtils.DeserializeVector(br); -else -entities = null; - + @out = (flags & 2) != 0; + id = br.ReadInt32(); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); + date = br.ReadInt32(); + if ((flags & 512) != 0) + media = (TLAbsMessageMedia) ObjectUtils.DeserializeObject(br); + else + media = null; + if ((flags & 128) != 0) + entities = ObjectUtils.DeserializeVector(br); + else + entities = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(id); -bw.Write(pts); -bw.Write(pts_count); -bw.Write(date); -if ((flags & 512) != 0) -ObjectUtils.SerializeObject(media,bw); -if ((flags & 128) != 0) -ObjectUtils.SerializeObject(entities,bw); + bw.Write(flags); + bw.Write(id); + bw.Write(pts); + bw.Write(pts_count); + bw.Write(date); + if ((flags & 512) != 0) + ObjectUtils.SerializeObject(media, bw); + if ((flags & 128) != 0) + ObjectUtils.SerializeObject(entities, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateStickerSets.cs b/TeleSharp.TL/TL/TLUpdateStickerSets.cs index 10947da..0eff102 100644 --- a/TeleSharp.TL/TL/TLUpdateStickerSets.cs +++ b/TeleSharp.TL/TL/TLUpdateStickerSets.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1135492588)] + [TLObject(1135492588)] public class TLUpdateStickerSets : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1135492588; + + + public void ComputeFlags() { - get - { - return 1135492588; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs b/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs index 8dfdb92..5813e3f 100644 --- a/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs +++ b/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(196268545)] + [TLObject(196268545)] public class TLUpdateStickerSetsOrder : TLAbsUpdate { - public override int Constructor + public override int Constructor => 196268545; + + public int flags { get; set; } + public bool masks { get; set; } + public TLVector order { get; set; } + + + public void ComputeFlags() { - get - { - return 196268545; - } + flags = 0; + flags = masks ? flags | 1 : flags & ~1; } - public int flags {get;set;} - public bool masks {get;set;} - public TLVector order {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = masks ? (flags | 1) : (flags & ~1); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -masks = (flags & 1) != 0; -order = (TLVector)ObjectUtils.DeserializeVector(br); - + masks = (flags & 1) != 0; + order = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(order,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(order, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateUserBlocked.cs b/TeleSharp.TL/TL/TLUpdateUserBlocked.cs index 9833b02..93f0109 100644 --- a/TeleSharp.TL/TL/TLUpdateUserBlocked.cs +++ b/TeleSharp.TL/TL/TLUpdateUserBlocked.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-2131957734)] + [TLObject(-2131957734)] public class TLUpdateUserBlocked : TLAbsUpdate { - public override int Constructor + public override int Constructor => -2131957734; + + public int user_id { get; set; } + public bool blocked { get; set; } + + + public void ComputeFlags() { - get - { - return -2131957734; - } } - public int user_id {get;set;} - public bool blocked {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -blocked = BoolUtil.Deserialize(br); - + blocked = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -BoolUtil.Serialize(blocked,bw); - + BoolUtil.Serialize(blocked, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateUserName.cs b/TeleSharp.TL/TL/TLUpdateUserName.cs index 20db403..0bdc20a 100644 --- a/TeleSharp.TL/TL/TLUpdateUserName.cs +++ b/TeleSharp.TL/TL/TLUpdateUserName.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1489818765)] + [TLObject(-1489818765)] public class TLUpdateUserName : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1489818765; + + public int user_id { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public string username { get; set; } + + + public void ComputeFlags() { - get - { - return -1489818765; - } } - public int user_id {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public string username {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -first_name = StringUtil.Deserialize(br); -last_name = StringUtil.Deserialize(br); -username = StringUtil.Deserialize(br); - + first_name = StringUtil.Deserialize(br); + last_name = StringUtil.Deserialize(br); + username = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -StringUtil.Serialize(first_name,bw); -StringUtil.Serialize(last_name,bw); -StringUtil.Serialize(username,bw); - + StringUtil.Serialize(first_name, bw); + StringUtil.Serialize(last_name, bw); + StringUtil.Serialize(username, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateUserPhone.cs b/TeleSharp.TL/TL/TLUpdateUserPhone.cs index 56c7a79..43f37bd 100644 --- a/TeleSharp.TL/TL/TLUpdateUserPhone.cs +++ b/TeleSharp.TL/TL/TLUpdateUserPhone.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(314130811)] + [TLObject(314130811)] public class TLUpdateUserPhone : TLAbsUpdate { - public override int Constructor + public override int Constructor => 314130811; + + public int user_id { get; set; } + public string phone { get; set; } + + + public void ComputeFlags() { - get - { - return 314130811; - } } - public int user_id {get;set;} - public string phone {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -phone = StringUtil.Deserialize(br); - + phone = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -StringUtil.Serialize(phone,bw); - + StringUtil.Serialize(phone, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateUserPhoto.cs b/TeleSharp.TL/TL/TLUpdateUserPhoto.cs index f57bea5..7778c74 100644 --- a/TeleSharp.TL/TL/TLUpdateUserPhoto.cs +++ b/TeleSharp.TL/TL/TLUpdateUserPhoto.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-1791935732)] + [TLObject(-1791935732)] public class TLUpdateUserPhoto : TLAbsUpdate { - public override int Constructor + public override int Constructor => -1791935732; + + public int user_id { get; set; } + public int date { get; set; } + public TLAbsUserProfilePhoto photo { get; set; } + public bool previous { get; set; } + + + public void ComputeFlags() { - get - { - return -1791935732; - } } - public int user_id {get;set;} - public int date {get;set;} - public TLAbsUserProfilePhoto photo {get;set;} - public bool previous {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -date = br.ReadInt32(); -photo = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); -previous = BoolUtil.Deserialize(br); - + date = br.ReadInt32(); + photo = (TLAbsUserProfilePhoto) ObjectUtils.DeserializeObject(br); + previous = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -bw.Write(date); -ObjectUtils.SerializeObject(photo,bw); -BoolUtil.Serialize(previous,bw); - + bw.Write(date); + ObjectUtils.SerializeObject(photo, bw); + BoolUtil.Serialize(previous, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateUserStatus.cs b/TeleSharp.TL/TL/TLUpdateUserStatus.cs index ec24cf8..e93edfd 100644 --- a/TeleSharp.TL/TL/TLUpdateUserStatus.cs +++ b/TeleSharp.TL/TL/TLUpdateUserStatus.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(469489699)] + [TLObject(469489699)] public class TLUpdateUserStatus : TLAbsUpdate { - public override int Constructor + public override int Constructor => 469489699; + + public int user_id { get; set; } + public TLAbsUserStatus status { get; set; } + + + public void ComputeFlags() { - get - { - return 469489699; - } } - public int user_id {get;set;} - public TLAbsUserStatus status {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -status = (TLAbsUserStatus)ObjectUtils.DeserializeObject(br); - + status = (TLAbsUserStatus) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -ObjectUtils.SerializeObject(status,bw); - + ObjectUtils.SerializeObject(status, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateUserTyping.cs b/TeleSharp.TL/TL/TLUpdateUserTyping.cs index 592d960..150e909 100644 --- a/TeleSharp.TL/TL/TLUpdateUserTyping.cs +++ b/TeleSharp.TL/TL/TLUpdateUserTyping.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1548249383)] + [TLObject(1548249383)] public class TLUpdateUserTyping : TLAbsUpdate { - public override int Constructor + public override int Constructor => 1548249383; + + public int user_id { get; set; } + public TLAbsSendMessageAction action { get; set; } + + + public void ComputeFlags() { - get - { - return 1548249383; - } } - public int user_id {get;set;} - public TLAbsSendMessageAction action {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { user_id = br.ReadInt32(); -action = (TLAbsSendMessageAction)ObjectUtils.DeserializeObject(br); - + action = (TLAbsSendMessageAction) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(user_id); -ObjectUtils.SerializeObject(action,bw); - + ObjectUtils.SerializeObject(action, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdateWebPage.cs b/TeleSharp.TL/TL/TLUpdateWebPage.cs index a98f3d6..95fd5f3 100644 --- a/TeleSharp.TL/TL/TLUpdateWebPage.cs +++ b/TeleSharp.TL/TL/TLUpdateWebPage.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2139689491)] + [TLObject(2139689491)] public class TLUpdateWebPage : TLAbsUpdate { - public override int Constructor + public override int Constructor => 2139689491; + + public TLAbsWebPage webpage { get; set; } + public int pts { get; set; } + public int pts_count { get; set; } + + + public void ComputeFlags() { - get - { - return 2139689491; - } } - public TLAbsWebPage webpage {get;set;} - public int pts {get;set;} - public int pts_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - webpage = (TLAbsWebPage)ObjectUtils.DeserializeObject(br); -pts = br.ReadInt32(); -pts_count = br.ReadInt32(); - + webpage = (TLAbsWebPage) ObjectUtils.DeserializeObject(br); + pts = br.ReadInt32(); + pts_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(webpage,bw); -bw.Write(pts); -bw.Write(pts_count); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(webpage, bw); + bw.Write(pts); + bw.Write(pts_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdates.cs b/TeleSharp.TL/TL/TLUpdates.cs index b6ee06a..d38e3b1 100644 --- a/TeleSharp.TL/TL/TLUpdates.cs +++ b/TeleSharp.TL/TL/TLUpdates.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1957577280)] + [TLObject(1957577280)] public class TLUpdates : TLAbsUpdates { - public override int Constructor + public override int Constructor => 1957577280; + + public TLVector updates { get; set; } + public TLVector users { get; set; } + public TLVector chats { get; set; } + public int date { get; set; } + public int seq { get; set; } + + + public void ComputeFlags() { - get - { - return 1957577280; - } } - public TLVector updates {get;set;} - public TLVector users {get;set;} - public TLVector chats {get;set;} - public int date {get;set;} - public int seq {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - updates = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -date = br.ReadInt32(); -seq = br.ReadInt32(); - + updates = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + date = br.ReadInt32(); + seq = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(updates,bw); -ObjectUtils.SerializeObject(users,bw); -ObjectUtils.SerializeObject(chats,bw); -bw.Write(date); -bw.Write(seq); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(updates, bw); + ObjectUtils.SerializeObject(users, bw); + ObjectUtils.SerializeObject(chats, bw); + bw.Write(date); + bw.Write(seq); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdatesCombined.cs b/TeleSharp.TL/TL/TLUpdatesCombined.cs index bb03ead..7bfc775 100644 --- a/TeleSharp.TL/TL/TLUpdatesCombined.cs +++ b/TeleSharp.TL/TL/TLUpdatesCombined.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1918567619)] + [TLObject(1918567619)] public class TLUpdatesCombined : TLAbsUpdates { - public override int Constructor + public override int Constructor => 1918567619; + + public TLVector updates { get; set; } + public TLVector users { get; set; } + public TLVector chats { get; set; } + public int date { get; set; } + public int seq_start { get; set; } + public int seq { get; set; } + + + public void ComputeFlags() { - get - { - return 1918567619; - } } - public TLVector updates {get;set;} - public TLVector users {get;set;} - public TLVector chats {get;set;} - public int date {get;set;} - public int seq_start {get;set;} - public int seq {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - updates = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -date = br.ReadInt32(); -seq_start = br.ReadInt32(); -seq = br.ReadInt32(); - + updates = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + date = br.ReadInt32(); + seq_start = br.ReadInt32(); + seq = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(updates,bw); -ObjectUtils.SerializeObject(users,bw); -ObjectUtils.SerializeObject(chats,bw); -bw.Write(date); -bw.Write(seq_start); -bw.Write(seq); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(updates, bw); + ObjectUtils.SerializeObject(users, bw); + ObjectUtils.SerializeObject(chats, bw); + bw.Write(date); + bw.Write(seq_start); + bw.Write(seq); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUpdatesTooLong.cs b/TeleSharp.TL/TL/TLUpdatesTooLong.cs index 28da140..16d26cb 100644 --- a/TeleSharp.TL/TL/TLUpdatesTooLong.cs +++ b/TeleSharp.TL/TL/TLUpdatesTooLong.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-484987010)] + [TLObject(-484987010)] public class TLUpdatesTooLong : TLAbsUpdates { - public override int Constructor + public override int Constructor => -484987010; + + + public void ComputeFlags() { - get - { - return -484987010; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUser.cs b/TeleSharp.TL/TL/TLUser.cs index 66712c8..bcecbf9 100644 --- a/TeleSharp.TL/TL/TLUser.cs +++ b/TeleSharp.TL/TL/TLUser.cs @@ -1,181 +1,157 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-787638374)] + [TLObject(-787638374)] public class TLUser : TLAbsUser { - public override int Constructor + public override int Constructor => -787638374; + + public int flags { get; set; } + public bool self { get; set; } + public bool contact { get; set; } + public bool mutual_contact { get; set; } + public bool deleted { get; set; } + public bool bot { get; set; } + public bool bot_chat_history { get; set; } + public bool bot_nochats { get; set; } + public bool verified { get; set; } + public bool restricted { get; set; } + public bool min { get; set; } + public bool bot_inline_geo { get; set; } + public int id { get; set; } + public long? access_hash { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public string username { get; set; } + public string phone { get; set; } + public TLAbsUserProfilePhoto photo { get; set; } + public TLAbsUserStatus status { get; set; } + public int? bot_info_version { get; set; } + public string restriction_reason { get; set; } + public string bot_inline_placeholder { get; set; } + + + public void ComputeFlags() { - get - { - return -787638374; - } + flags = 0; + flags = self ? flags | 1024 : flags & ~1024; + flags = contact ? flags | 2048 : flags & ~2048; + flags = mutual_contact ? flags | 4096 : flags & ~4096; + flags = deleted ? flags | 8192 : flags & ~8192; + flags = bot ? flags | 16384 : flags & ~16384; + flags = bot_chat_history ? flags | 32768 : flags & ~32768; + flags = bot_nochats ? flags | 65536 : flags & ~65536; + flags = verified ? flags | 131072 : flags & ~131072; + flags = restricted ? flags | 262144 : flags & ~262144; + flags = min ? flags | 1048576 : flags & ~1048576; + flags = bot_inline_geo ? flags | 2097152 : flags & ~2097152; + flags = access_hash != null ? flags | 1 : flags & ~1; + flags = first_name != null ? flags | 2 : flags & ~2; + flags = last_name != null ? flags | 4 : flags & ~4; + flags = username != null ? flags | 8 : flags & ~8; + flags = phone != null ? flags | 16 : flags & ~16; + flags = photo != null ? flags | 32 : flags & ~32; + flags = status != null ? flags | 64 : flags & ~64; + flags = bot_info_version != null ? flags | 16384 : flags & ~16384; + flags = restriction_reason != null ? flags | 262144 : flags & ~262144; + flags = bot_inline_placeholder != null ? flags | 524288 : flags & ~524288; } - public int flags {get;set;} - public bool self {get;set;} - public bool contact {get;set;} - public bool mutual_contact {get;set;} - public bool deleted {get;set;} - public bool bot {get;set;} - public bool bot_chat_history {get;set;} - public bool bot_nochats {get;set;} - public bool verified {get;set;} - public bool restricted {get;set;} - public bool min {get;set;} - public bool bot_inline_geo {get;set;} - public int id {get;set;} - public long? access_hash {get;set;} - public string first_name {get;set;} - public string last_name {get;set;} - public string username {get;set;} - public string phone {get;set;} - public TLAbsUserProfilePhoto photo {get;set;} - public TLAbsUserStatus status {get;set;} - public int? bot_info_version {get;set;} - public string restriction_reason {get;set;} - public string bot_inline_placeholder {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = self ? (flags | 1024) : (flags & ~1024); -flags = contact ? (flags | 2048) : (flags & ~2048); -flags = mutual_contact ? (flags | 4096) : (flags & ~4096); -flags = deleted ? (flags | 8192) : (flags & ~8192); -flags = bot ? (flags | 16384) : (flags & ~16384); -flags = bot_chat_history ? (flags | 32768) : (flags & ~32768); -flags = bot_nochats ? (flags | 65536) : (flags & ~65536); -flags = verified ? (flags | 131072) : (flags & ~131072); -flags = restricted ? (flags | 262144) : (flags & ~262144); -flags = min ? (flags | 1048576) : (flags & ~1048576); -flags = bot_inline_geo ? (flags | 2097152) : (flags & ~2097152); -flags = access_hash != null ? (flags | 1) : (flags & ~1); -flags = first_name != null ? (flags | 2) : (flags & ~2); -flags = last_name != null ? (flags | 4) : (flags & ~4); -flags = username != null ? (flags | 8) : (flags & ~8); -flags = phone != null ? (flags | 16) : (flags & ~16); -flags = photo != null ? (flags | 32) : (flags & ~32); -flags = status != null ? (flags | 64) : (flags & ~64); -flags = bot_info_version != null ? (flags | 16384) : (flags & ~16384); -flags = restriction_reason != null ? (flags | 262144) : (flags & ~262144); -flags = bot_inline_placeholder != null ? (flags | 524288) : (flags & ~524288); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -self = (flags & 1024) != 0; -contact = (flags & 2048) != 0; -mutual_contact = (flags & 4096) != 0; -deleted = (flags & 8192) != 0; -bot = (flags & 16384) != 0; -bot_chat_history = (flags & 32768) != 0; -bot_nochats = (flags & 65536) != 0; -verified = (flags & 131072) != 0; -restricted = (flags & 262144) != 0; -min = (flags & 1048576) != 0; -bot_inline_geo = (flags & 2097152) != 0; -id = br.ReadInt32(); -if ((flags & 1) != 0) -access_hash = br.ReadInt64(); -else -access_hash = null; + self = (flags & 1024) != 0; + contact = (flags & 2048) != 0; + mutual_contact = (flags & 4096) != 0; + deleted = (flags & 8192) != 0; + bot = (flags & 16384) != 0; + bot_chat_history = (flags & 32768) != 0; + bot_nochats = (flags & 65536) != 0; + verified = (flags & 131072) != 0; + restricted = (flags & 262144) != 0; + min = (flags & 1048576) != 0; + bot_inline_geo = (flags & 2097152) != 0; + id = br.ReadInt32(); + if ((flags & 1) != 0) + access_hash = br.ReadInt64(); + else + access_hash = null; -if ((flags & 2) != 0) -first_name = StringUtil.Deserialize(br); -else -first_name = null; + if ((flags & 2) != 0) + first_name = StringUtil.Deserialize(br); + else + first_name = null; -if ((flags & 4) != 0) -last_name = StringUtil.Deserialize(br); -else -last_name = null; + if ((flags & 4) != 0) + last_name = StringUtil.Deserialize(br); + else + last_name = null; -if ((flags & 8) != 0) -username = StringUtil.Deserialize(br); -else -username = null; + if ((flags & 8) != 0) + username = StringUtil.Deserialize(br); + else + username = null; -if ((flags & 16) != 0) -phone = StringUtil.Deserialize(br); -else -phone = null; + if ((flags & 16) != 0) + phone = StringUtil.Deserialize(br); + else + phone = null; -if ((flags & 32) != 0) -photo = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); -else -photo = null; + if ((flags & 32) != 0) + photo = (TLAbsUserProfilePhoto) ObjectUtils.DeserializeObject(br); + else + photo = null; -if ((flags & 64) != 0) -status = (TLAbsUserStatus)ObjectUtils.DeserializeObject(br); -else -status = null; + if ((flags & 64) != 0) + status = (TLAbsUserStatus) ObjectUtils.DeserializeObject(br); + else + status = null; -if ((flags & 16384) != 0) -bot_info_version = br.ReadInt32(); -else -bot_info_version = null; - -if ((flags & 262144) != 0) -restriction_reason = StringUtil.Deserialize(br); -else -restriction_reason = null; - -if ((flags & 524288) != 0) -bot_inline_placeholder = StringUtil.Deserialize(br); -else -bot_inline_placeholder = null; + if ((flags & 16384) != 0) + bot_info_version = br.ReadInt32(); + else + bot_info_version = null; + if ((flags & 262144) != 0) + restriction_reason = StringUtil.Deserialize(br); + else + restriction_reason = null; + if ((flags & 524288) != 0) + bot_inline_placeholder = StringUtil.Deserialize(br); + else + bot_inline_placeholder = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); + bw.Write(flags); - - - - - - - - - -bw.Write(id); -if ((flags & 1) != 0) -bw.Write(access_hash.Value); -if ((flags & 2) != 0) -StringUtil.Serialize(first_name,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(last_name,bw); -if ((flags & 8) != 0) -StringUtil.Serialize(username,bw); -if ((flags & 16) != 0) -StringUtil.Serialize(phone,bw); -if ((flags & 32) != 0) -ObjectUtils.SerializeObject(photo,bw); -if ((flags & 64) != 0) -ObjectUtils.SerializeObject(status,bw); -if ((flags & 16384) != 0) -bw.Write(bot_info_version.Value); -if ((flags & 262144) != 0) -StringUtil.Serialize(restriction_reason,bw); -if ((flags & 524288) != 0) -StringUtil.Serialize(bot_inline_placeholder,bw); - + bw.Write(id); + if ((flags & 1) != 0) + bw.Write(access_hash.Value); + if ((flags & 2) != 0) + StringUtil.Serialize(first_name, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(last_name, bw); + if ((flags & 8) != 0) + StringUtil.Serialize(username, bw); + if ((flags & 16) != 0) + StringUtil.Serialize(phone, bw); + if ((flags & 32) != 0) + ObjectUtils.SerializeObject(photo, bw); + if ((flags & 64) != 0) + ObjectUtils.SerializeObject(status, bw); + if ((flags & 16384) != 0) + bw.Write(bot_info_version.Value); + if ((flags & 262144) != 0) + StringUtil.Serialize(restriction_reason, bw); + if ((flags & 524288) != 0) + StringUtil.Serialize(bot_inline_placeholder, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserEmpty.cs b/TeleSharp.TL/TL/TLUserEmpty.cs index 1e311d2..af5540d 100644 --- a/TeleSharp.TL/TL/TLUserEmpty.cs +++ b/TeleSharp.TL/TL/TLUserEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(537022650)] + [TLObject(537022650)] public class TLUserEmpty : TLAbsUser { - public override int Constructor + public override int Constructor => 537022650; + + public int id { get; set; } + + + public void ComputeFlags() { - get - { - return 537022650; - } } - public int id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserFull.cs b/TeleSharp.TL/TL/TLUserFull.cs index fc1717d..87e0007 100644 --- a/TeleSharp.TL/TL/TLUserFull.cs +++ b/TeleSharp.TL/TL/TLUserFull.cs @@ -1,84 +1,70 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Contacts; + namespace TeleSharp.TL { - [TLObject(1496513539)] + [TLObject(1496513539)] public class TLUserFull : TLObject { - public override int Constructor + public override int Constructor => 1496513539; + + public int flags { get; set; } + public bool blocked { get; set; } + public TLAbsUser user { get; set; } + public string about { get; set; } + public TLLink link { get; set; } + public TLAbsPhoto profile_photo { get; set; } + public TLAbsPeerNotifySettings notify_settings { get; set; } + public TLBotInfo bot_info { get; set; } + + + public void ComputeFlags() { - get - { - return 1496513539; - } + flags = 0; + flags = blocked ? flags | 1 : flags & ~1; + flags = about != null ? flags | 2 : flags & ~2; + flags = profile_photo != null ? flags | 4 : flags & ~4; + flags = bot_info != null ? flags | 8 : flags & ~8; } - public int flags {get;set;} - public bool blocked {get;set;} - public TLAbsUser user {get;set;} - public string about {get;set;} - public Contacts.TLLink link {get;set;} - public TLAbsPhoto profile_photo {get;set;} - public TLAbsPeerNotifySettings notify_settings {get;set;} - public TLBotInfo bot_info {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = blocked ? (flags | 1) : (flags & ~1); -flags = about != null ? (flags | 2) : (flags & ~2); -flags = profile_photo != null ? (flags | 4) : (flags & ~4); -flags = bot_info != null ? (flags | 8) : (flags & ~8); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -blocked = (flags & 1) != 0; -user = (TLAbsUser)ObjectUtils.DeserializeObject(br); -if ((flags & 2) != 0) -about = StringUtil.Deserialize(br); -else -about = null; - -link = (Contacts.TLLink)ObjectUtils.DeserializeObject(br); -if ((flags & 4) != 0) -profile_photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -else -profile_photo = null; - -notify_settings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); -if ((flags & 8) != 0) -bot_info = (TLBotInfo)ObjectUtils.DeserializeObject(br); -else -bot_info = null; + blocked = (flags & 1) != 0; + user = (TLAbsUser) ObjectUtils.DeserializeObject(br); + if ((flags & 2) != 0) + about = StringUtil.Deserialize(br); + else + about = null; + link = (TLLink) ObjectUtils.DeserializeObject(br); + if ((flags & 4) != 0) + profile_photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + else + profile_photo = null; + notify_settings = (TLAbsPeerNotifySettings) ObjectUtils.DeserializeObject(br); + if ((flags & 8) != 0) + bot_info = (TLBotInfo) ObjectUtils.DeserializeObject(br); + else + bot_info = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -ObjectUtils.SerializeObject(user,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(about,bw); -ObjectUtils.SerializeObject(link,bw); -if ((flags & 4) != 0) -ObjectUtils.SerializeObject(profile_photo,bw); -ObjectUtils.SerializeObject(notify_settings,bw); -if ((flags & 8) != 0) -ObjectUtils.SerializeObject(bot_info,bw); + bw.Write(flags); + ObjectUtils.SerializeObject(user, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(about, bw); + ObjectUtils.SerializeObject(link, bw); + if ((flags & 4) != 0) + ObjectUtils.SerializeObject(profile_photo, bw); + ObjectUtils.SerializeObject(notify_settings, bw); + if ((flags & 8) != 0) + ObjectUtils.SerializeObject(bot_info, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserProfilePhoto.cs b/TeleSharp.TL/TL/TLUserProfilePhoto.cs index 717a2df..76d035c 100644 --- a/TeleSharp.TL/TL/TLUserProfilePhoto.cs +++ b/TeleSharp.TL/TL/TLUserProfilePhoto.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-715532088)] + [TLObject(-715532088)] public class TLUserProfilePhoto : TLAbsUserProfilePhoto { - public override int Constructor + public override int Constructor => -715532088; + + public long photo_id { get; set; } + public TLAbsFileLocation photo_small { get; set; } + public TLAbsFileLocation photo_big { get; set; } + + + public void ComputeFlags() { - get - { - return -715532088; - } } - public long photo_id {get;set;} - public TLAbsFileLocation photo_small {get;set;} - public TLAbsFileLocation photo_big {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { photo_id = br.ReadInt64(); -photo_small = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); -photo_big = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); - + photo_small = (TLAbsFileLocation) ObjectUtils.DeserializeObject(br); + photo_big = (TLAbsFileLocation) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(photo_id); -ObjectUtils.SerializeObject(photo_small,bw); -ObjectUtils.SerializeObject(photo_big,bw); - + ObjectUtils.SerializeObject(photo_small, bw); + ObjectUtils.SerializeObject(photo_big, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs b/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs index 126cfd3..15c749d 100644 --- a/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs +++ b/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1326562017)] + [TLObject(1326562017)] public class TLUserProfilePhotoEmpty : TLAbsUserProfilePhoto { - public override int Constructor + public override int Constructor => 1326562017; + + + public void ComputeFlags() { - get - { - return 1326562017; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserStatusEmpty.cs b/TeleSharp.TL/TL/TLUserStatusEmpty.cs index 1fe6b96..9d26aea 100644 --- a/TeleSharp.TL/TL/TLUserStatusEmpty.cs +++ b/TeleSharp.TL/TL/TLUserStatusEmpty.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(164646985)] + [TLObject(164646985)] public class TLUserStatusEmpty : TLAbsUserStatus { - public override int Constructor + public override int Constructor => 164646985; + + + public void ComputeFlags() { - get - { - return 164646985; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserStatusLastMonth.cs b/TeleSharp.TL/TL/TLUserStatusLastMonth.cs index 504440f..4cf8fe2 100644 --- a/TeleSharp.TL/TL/TLUserStatusLastMonth.cs +++ b/TeleSharp.TL/TL/TLUserStatusLastMonth.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(2011940674)] + [TLObject(2011940674)] public class TLUserStatusLastMonth : TLAbsUserStatus { - public override int Constructor + public override int Constructor => 2011940674; + + + public void ComputeFlags() { - get - { - return 2011940674; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserStatusLastWeek.cs b/TeleSharp.TL/TL/TLUserStatusLastWeek.cs index ad6be60..2422a96 100644 --- a/TeleSharp.TL/TL/TLUserStatusLastWeek.cs +++ b/TeleSharp.TL/TL/TLUserStatusLastWeek.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(129960444)] + [TLObject(129960444)] public class TLUserStatusLastWeek : TLAbsUserStatus { - public override int Constructor + public override int Constructor => 129960444; + + + public void ComputeFlags() { - get - { - return 129960444; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserStatusOffline.cs b/TeleSharp.TL/TL/TLUserStatusOffline.cs index 92c2f87..221ef36 100644 --- a/TeleSharp.TL/TL/TLUserStatusOffline.cs +++ b/TeleSharp.TL/TL/TLUserStatusOffline.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(9203775)] + [TLObject(9203775)] public class TLUserStatusOffline : TLAbsUserStatus { - public override int Constructor + public override int Constructor => 9203775; + + public int was_online { get; set; } + + + public void ComputeFlags() { - get - { - return 9203775; - } } - public int was_online {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { was_online = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(was_online); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserStatusOnline.cs b/TeleSharp.TL/TL/TLUserStatusOnline.cs index 6cfbf1f..a4cdea3 100644 --- a/TeleSharp.TL/TL/TLUserStatusOnline.cs +++ b/TeleSharp.TL/TL/TLUserStatusOnline.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-306628279)] + [TLObject(-306628279)] public class TLUserStatusOnline : TLAbsUserStatus { - public override int Constructor + public override int Constructor => -306628279; + + public int expires { get; set; } + + + public void ComputeFlags() { - get - { - return -306628279; - } } - public int expires {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { expires = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(expires); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLUserStatusRecently.cs b/TeleSharp.TL/TL/TLUserStatusRecently.cs index 1011953..8922ce4 100644 --- a/TeleSharp.TL/TL/TLUserStatusRecently.cs +++ b/TeleSharp.TL/TL/TLUserStatusRecently.cs @@ -1,39 +1,24 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-496024847)] + [TLObject(-496024847)] public class TLUserStatusRecently : TLAbsUserStatus { - public override int Constructor + public override int Constructor => -496024847; + + + public void ComputeFlags() { - get - { - return -496024847; - } } - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLWallPaper.cs b/TeleSharp.TL/TL/TLWallPaper.cs index b53bb23..a4fba7f 100644 --- a/TeleSharp.TL/TL/TLWallPaper.cs +++ b/TeleSharp.TL/TL/TLWallPaper.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-860866985)] + [TLObject(-860866985)] public class TLWallPaper : TLAbsWallPaper { - public override int Constructor + public override int Constructor => -860866985; + + public int id { get; set; } + public string title { get; set; } + public TLVector sizes { get; set; } + public int color { get; set; } + + + public void ComputeFlags() { - get - { - return -860866985; - } } - public int id {get;set;} - public string title {get;set;} - public TLVector sizes {get;set;} - public int color {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -title = StringUtil.Deserialize(br); -sizes = (TLVector)ObjectUtils.DeserializeVector(br); -color = br.ReadInt32(); - + title = StringUtil.Deserialize(br); + sizes = ObjectUtils.DeserializeVector(br); + color = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -StringUtil.Serialize(title,bw); -ObjectUtils.SerializeObject(sizes,bw); -bw.Write(color); - + StringUtil.Serialize(title, bw); + ObjectUtils.SerializeObject(sizes, bw); + bw.Write(color); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLWallPaperSolid.cs b/TeleSharp.TL/TL/TLWallPaperSolid.cs index 42ceedf..10d38e5 100644 --- a/TeleSharp.TL/TL/TLWallPaperSolid.cs +++ b/TeleSharp.TL/TL/TLWallPaperSolid.cs @@ -1,51 +1,37 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(1662091044)] + [TLObject(1662091044)] public class TLWallPaperSolid : TLAbsWallPaper { - public override int Constructor + public override int Constructor => 1662091044; + + public int id { get; set; } + public string title { get; set; } + public int bg_color { get; set; } + public int color { get; set; } + + + public void ComputeFlags() { - get - { - return 1662091044; - } } - public int id {get;set;} - public string title {get;set;} - public int bg_color {get;set;} - public int color {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt32(); -title = StringUtil.Deserialize(br); -bg_color = br.ReadInt32(); -color = br.ReadInt32(); - + title = StringUtil.Deserialize(br); + bg_color = br.ReadInt32(); + color = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -StringUtil.Serialize(title,bw); -bw.Write(bg_color); -bw.Write(color); - + StringUtil.Serialize(title, bw); + bw.Write(bg_color); + bw.Write(color); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLWebPage.cs b/TeleSharp.TL/TL/TLWebPage.cs index 570a05a..c3bf6aa 100644 --- a/TeleSharp.TL/TL/TLWebPage.cs +++ b/TeleSharp.TL/TL/TLWebPage.cs @@ -1,161 +1,146 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-897446185)] + [TLObject(-897446185)] public class TLWebPage : TLAbsWebPage { - public override int Constructor + public override int Constructor => -897446185; + + public int flags { get; set; } + public long id { get; set; } + public string url { get; set; } + public string display_url { get; set; } + public string type { get; set; } + public string site_name { get; set; } + public string title { get; set; } + public string description { get; set; } + public TLAbsPhoto photo { get; set; } + public string embed_url { get; set; } + public string embed_type { get; set; } + public int? embed_width { get; set; } + public int? embed_height { get; set; } + public int? duration { get; set; } + public string author { get; set; } + public TLAbsDocument document { get; set; } + + + public void ComputeFlags() { - get - { - return -897446185; - } + flags = 0; + flags = type != null ? flags | 1 : flags & ~1; + flags = site_name != null ? flags | 2 : flags & ~2; + flags = title != null ? flags | 4 : flags & ~4; + flags = description != null ? flags | 8 : flags & ~8; + flags = photo != null ? flags | 16 : flags & ~16; + flags = embed_url != null ? flags | 32 : flags & ~32; + flags = embed_type != null ? flags | 32 : flags & ~32; + flags = embed_width != null ? flags | 64 : flags & ~64; + flags = embed_height != null ? flags | 64 : flags & ~64; + flags = duration != null ? flags | 128 : flags & ~128; + flags = author != null ? flags | 256 : flags & ~256; + flags = document != null ? flags | 512 : flags & ~512; } - public int flags {get;set;} - public long id {get;set;} - public string url {get;set;} - public string display_url {get;set;} - public string type {get;set;} - public string site_name {get;set;} - public string title {get;set;} - public string description {get;set;} - public TLAbsPhoto photo {get;set;} - public string embed_url {get;set;} - public string embed_type {get;set;} - public int? embed_width {get;set;} - public int? embed_height {get;set;} - public int? duration {get;set;} - public string author {get;set;} - public TLAbsDocument document {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = type != null ? (flags | 1) : (flags & ~1); -flags = site_name != null ? (flags | 2) : (flags & ~2); -flags = title != null ? (flags | 4) : (flags & ~4); -flags = description != null ? (flags | 8) : (flags & ~8); -flags = photo != null ? (flags | 16) : (flags & ~16); -flags = embed_url != null ? (flags | 32) : (flags & ~32); -flags = embed_type != null ? (flags | 32) : (flags & ~32); -flags = embed_width != null ? (flags | 64) : (flags & ~64); -flags = embed_height != null ? (flags | 64) : (flags & ~64); -flags = duration != null ? (flags | 128) : (flags & ~128); -flags = author != null ? (flags | 256) : (flags & ~256); -flags = document != null ? (flags | 512) : (flags & ~512); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -id = br.ReadInt64(); -url = StringUtil.Deserialize(br); -display_url = StringUtil.Deserialize(br); -if ((flags & 1) != 0) -type = StringUtil.Deserialize(br); -else -type = null; + id = br.ReadInt64(); + url = StringUtil.Deserialize(br); + display_url = StringUtil.Deserialize(br); + if ((flags & 1) != 0) + type = StringUtil.Deserialize(br); + else + type = null; -if ((flags & 2) != 0) -site_name = StringUtil.Deserialize(br); -else -site_name = null; + if ((flags & 2) != 0) + site_name = StringUtil.Deserialize(br); + else + site_name = null; -if ((flags & 4) != 0) -title = StringUtil.Deserialize(br); -else -title = null; + if ((flags & 4) != 0) + title = StringUtil.Deserialize(br); + else + title = null; -if ((flags & 8) != 0) -description = StringUtil.Deserialize(br); -else -description = null; + if ((flags & 8) != 0) + description = StringUtil.Deserialize(br); + else + description = null; -if ((flags & 16) != 0) -photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); -else -photo = null; + if ((flags & 16) != 0) + photo = (TLAbsPhoto) ObjectUtils.DeserializeObject(br); + else + photo = null; -if ((flags & 32) != 0) -embed_url = StringUtil.Deserialize(br); -else -embed_url = null; + if ((flags & 32) != 0) + embed_url = StringUtil.Deserialize(br); + else + embed_url = null; -if ((flags & 32) != 0) -embed_type = StringUtil.Deserialize(br); -else -embed_type = null; + if ((flags & 32) != 0) + embed_type = StringUtil.Deserialize(br); + else + embed_type = null; -if ((flags & 64) != 0) -embed_width = br.ReadInt32(); -else -embed_width = null; + if ((flags & 64) != 0) + embed_width = br.ReadInt32(); + else + embed_width = null; -if ((flags & 64) != 0) -embed_height = br.ReadInt32(); -else -embed_height = null; + if ((flags & 64) != 0) + embed_height = br.ReadInt32(); + else + embed_height = null; -if ((flags & 128) != 0) -duration = br.ReadInt32(); -else -duration = null; - -if ((flags & 256) != 0) -author = StringUtil.Deserialize(br); -else -author = null; - -if ((flags & 512) != 0) -document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); -else -document = null; + if ((flags & 128) != 0) + duration = br.ReadInt32(); + else + duration = null; + if ((flags & 256) != 0) + author = StringUtil.Deserialize(br); + else + author = null; + if ((flags & 512) != 0) + document = (TLAbsDocument) ObjectUtils.DeserializeObject(br); + else + document = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); -bw.Write(id); -StringUtil.Serialize(url,bw); -StringUtil.Serialize(display_url,bw); -if ((flags & 1) != 0) -StringUtil.Serialize(type,bw); -if ((flags & 2) != 0) -StringUtil.Serialize(site_name,bw); -if ((flags & 4) != 0) -StringUtil.Serialize(title,bw); -if ((flags & 8) != 0) -StringUtil.Serialize(description,bw); -if ((flags & 16) != 0) -ObjectUtils.SerializeObject(photo,bw); -if ((flags & 32) != 0) -StringUtil.Serialize(embed_url,bw); -if ((flags & 32) != 0) -StringUtil.Serialize(embed_type,bw); -if ((flags & 64) != 0) -bw.Write(embed_width.Value); -if ((flags & 64) != 0) -bw.Write(embed_height.Value); -if ((flags & 128) != 0) -bw.Write(duration.Value); -if ((flags & 256) != 0) -StringUtil.Serialize(author,bw); -if ((flags & 512) != 0) -ObjectUtils.SerializeObject(document,bw); - + bw.Write(flags); + bw.Write(id); + StringUtil.Serialize(url, bw); + StringUtil.Serialize(display_url, bw); + if ((flags & 1) != 0) + StringUtil.Serialize(type, bw); + if ((flags & 2) != 0) + StringUtil.Serialize(site_name, bw); + if ((flags & 4) != 0) + StringUtil.Serialize(title, bw); + if ((flags & 8) != 0) + StringUtil.Serialize(description, bw); + if ((flags & 16) != 0) + ObjectUtils.SerializeObject(photo, bw); + if ((flags & 32) != 0) + StringUtil.Serialize(embed_url, bw); + if ((flags & 32) != 0) + StringUtil.Serialize(embed_type, bw); + if ((flags & 64) != 0) + bw.Write(embed_width.Value); + if ((flags & 64) != 0) + bw.Write(embed_height.Value); + if ((flags & 128) != 0) + bw.Write(duration.Value); + if ((flags & 256) != 0) + StringUtil.Serialize(author, bw); + if ((flags & 512) != 0) + ObjectUtils.SerializeObject(document, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLWebPageEmpty.cs b/TeleSharp.TL/TL/TLWebPageEmpty.cs index b485b95..4224222 100644 --- a/TeleSharp.TL/TL/TLWebPageEmpty.cs +++ b/TeleSharp.TL/TL/TLWebPageEmpty.cs @@ -1,42 +1,28 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-350980120)] + [TLObject(-350980120)] public class TLWebPageEmpty : TLAbsWebPage { - public override int Constructor + public override int Constructor => -350980120; + + public long id { get; set; } + + + public void ComputeFlags() { - get - { - return -350980120; - } } - public long id {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); - } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/TLWebPagePending.cs b/TeleSharp.TL/TL/TLWebPagePending.cs index 7829b94..40a61b6 100644 --- a/TeleSharp.TL/TL/TLWebPagePending.cs +++ b/TeleSharp.TL/TL/TLWebPagePending.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL { - [TLObject(-981018084)] + [TLObject(-981018084)] public class TLWebPagePending : TLAbsWebPage { - public override int Constructor + public override int Constructor => -981018084; + + public long id { get; set; } + public int date { get; set; } + + + public void ComputeFlags() { - get - { - return -981018084; - } } - public long id {get;set;} - public int date {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { id = br.ReadInt64(); -date = br.ReadInt32(); - + date = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(id); -bw.Write(date); - + bw.Write(date); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs b/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs index ca3c10a..ff64c0b 100644 --- a/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs +++ b/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Updates { public abstract class TLAbsChannelDifference : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLAbsDifference.cs b/TeleSharp.TL/TL/Updates/TLAbsDifference.cs index 10807ea..359954c 100644 --- a/TeleSharp.TL/TL/Updates/TLAbsDifference.cs +++ b/TeleSharp.TL/TL/Updates/TLAbsDifference.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL.Updates { public abstract class TLAbsDifference : TLObject { } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLChannelDifference.cs b/TeleSharp.TL/TL/Updates/TLChannelDifference.cs index f014882..03f6486 100644 --- a/TeleSharp.TL/TL/Updates/TLChannelDifference.cs +++ b/TeleSharp.TL/TL/Updates/TLChannelDifference.cs @@ -1,72 +1,58 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(543450958)] + [TLObject(543450958)] public class TLChannelDifference : TLAbsChannelDifference { - public override int Constructor + public override int Constructor => 543450958; + + public int flags { get; set; } + public bool final { get; set; } + public int pts { get; set; } + public int? timeout { get; set; } + public TLVector new_messages { get; set; } + public TLVector other_updates { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 543450958; - } + flags = 0; + flags = final ? flags | 1 : flags & ~1; + flags = timeout != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool final {get;set;} - public int pts {get;set;} - public int? timeout {get;set;} - public TLVector new_messages {get;set;} - public TLVector other_updates {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = final ? (flags | 1) : (flags & ~1); -flags = timeout != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -final = (flags & 1) != 0; -pts = br.ReadInt32(); -if ((flags & 2) != 0) -timeout = br.ReadInt32(); -else -timeout = null; - -new_messages = (TLVector)ObjectUtils.DeserializeVector(br); -other_updates = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); + final = (flags & 1) != 0; + pts = br.ReadInt32(); + if ((flags & 2) != 0) + timeout = br.ReadInt32(); + else + timeout = null; + new_messages = ObjectUtils.DeserializeVector(br); + other_updates = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(pts); -if ((flags & 2) != 0) -bw.Write(timeout.Value); -ObjectUtils.SerializeObject(new_messages,bw); -ObjectUtils.SerializeObject(other_updates,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); + bw.Write(flags); + bw.Write(pts); + if ((flags & 2) != 0) + bw.Write(timeout.Value); + ObjectUtils.SerializeObject(new_messages, bw); + ObjectUtils.SerializeObject(other_updates, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs b/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs index 57cd74d..43064a8 100644 --- a/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs +++ b/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs @@ -1,60 +1,45 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(1041346555)] + [TLObject(1041346555)] public class TLChannelDifferenceEmpty : TLAbsChannelDifference { - public override int Constructor + public override int Constructor => 1041346555; + + public int flags { get; set; } + public bool final { get; set; } + public int pts { get; set; } + public int? timeout { get; set; } + + + public void ComputeFlags() { - get - { - return 1041346555; - } + flags = 0; + flags = final ? flags | 1 : flags & ~1; + flags = timeout != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool final {get;set;} - public int pts {get;set;} - public int? timeout {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = final ? (flags | 1) : (flags & ~1); -flags = timeout != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -final = (flags & 1) != 0; -pts = br.ReadInt32(); -if ((flags & 2) != 0) -timeout = br.ReadInt32(); -else -timeout = null; - - + final = (flags & 1) != 0; + pts = br.ReadInt32(); + if ((flags & 2) != 0) + timeout = br.ReadInt32(); + else + timeout = null; } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(pts); -if ((flags & 2) != 0) -bw.Write(timeout.Value); + bw.Write(flags); + bw.Write(pts); + if ((flags & 2) != 0) + bw.Write(timeout.Value); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs b/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs index a869024..10ebb56 100644 --- a/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs +++ b/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs @@ -1,81 +1,67 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(1091431943)] + [TLObject(1091431943)] public class TLChannelDifferenceTooLong : TLAbsChannelDifference { - public override int Constructor + public override int Constructor => 1091431943; + + public int flags { get; set; } + public bool final { get; set; } + public int pts { get; set; } + public int? timeout { get; set; } + public int top_message { get; set; } + public int read_inbox_max_id { get; set; } + public int read_outbox_max_id { get; set; } + public int unread_count { get; set; } + public TLVector messages { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + + + public void ComputeFlags() { - get - { - return 1091431943; - } + flags = 0; + flags = final ? flags | 1 : flags & ~1; + flags = timeout != null ? flags | 2 : flags & ~2; } - public int flags {get;set;} - public bool final {get;set;} - public int pts {get;set;} - public int? timeout {get;set;} - public int top_message {get;set;} - public int read_inbox_max_id {get;set;} - public int read_outbox_max_id {get;set;} - public int unread_count {get;set;} - public TLVector messages {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - - - public void ComputeFlags() - { - flags = 0; -flags = final ? (flags | 1) : (flags & ~1); -flags = timeout != null ? (flags | 2) : (flags & ~2); - - } - public override void DeserializeBody(BinaryReader br) { flags = br.ReadInt32(); -final = (flags & 1) != 0; -pts = br.ReadInt32(); -if ((flags & 2) != 0) -timeout = br.ReadInt32(); -else -timeout = null; - -top_message = br.ReadInt32(); -read_inbox_max_id = br.ReadInt32(); -read_outbox_max_id = br.ReadInt32(); -unread_count = br.ReadInt32(); -messages = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); + final = (flags & 1) != 0; + pts = br.ReadInt32(); + if ((flags & 2) != 0) + timeout = br.ReadInt32(); + else + timeout = null; + top_message = br.ReadInt32(); + read_inbox_max_id = br.ReadInt32(); + read_outbox_max_id = br.ReadInt32(); + unread_count = br.ReadInt32(); + messages = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); ComputeFlags(); -bw.Write(flags); - -bw.Write(pts); -if ((flags & 2) != 0) -bw.Write(timeout.Value); -bw.Write(top_message); -bw.Write(read_inbox_max_id); -bw.Write(read_outbox_max_id); -bw.Write(unread_count); -ObjectUtils.SerializeObject(messages,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); + bw.Write(flags); + bw.Write(pts); + if ((flags & 2) != 0) + bw.Write(timeout.Value); + bw.Write(top_message); + bw.Write(read_inbox_max_id); + bw.Write(read_outbox_max_id); + bw.Write(unread_count); + ObjectUtils.SerializeObject(messages, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLDifference.cs b/TeleSharp.TL/TL/Updates/TLDifference.cs index fd4401b..4b23388 100644 --- a/TeleSharp.TL/TL/Updates/TLDifference.cs +++ b/TeleSharp.TL/TL/Updates/TLDifference.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(16030880)] + [TLObject(16030880)] public class TLDifference : TLAbsDifference { - public override int Constructor + public override int Constructor => 16030880; + + public TLVector new_messages { get; set; } + public TLVector new_encrypted_messages { get; set; } + public TLVector other_updates { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + public TLState state { get; set; } + + + public void ComputeFlags() { - get - { - return 16030880; - } } - public TLVector new_messages {get;set;} - public TLVector new_encrypted_messages {get;set;} - public TLVector other_updates {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - public Updates.TLState state {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - new_messages = (TLVector)ObjectUtils.DeserializeVector(br); -new_encrypted_messages = (TLVector)ObjectUtils.DeserializeVector(br); -other_updates = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); -state = (Updates.TLState)ObjectUtils.DeserializeObject(br); - + new_messages = ObjectUtils.DeserializeVector(br); + new_encrypted_messages = ObjectUtils.DeserializeVector(br); + other_updates = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); + state = (TLState) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(new_messages,bw); -ObjectUtils.SerializeObject(new_encrypted_messages,bw); -ObjectUtils.SerializeObject(other_updates,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); -ObjectUtils.SerializeObject(state,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(new_messages, bw); + ObjectUtils.SerializeObject(new_encrypted_messages, bw); + ObjectUtils.SerializeObject(other_updates, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); + ObjectUtils.SerializeObject(state, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs b/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs index bf42268..4491888 100644 --- a/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs +++ b/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(1567990072)] + [TLObject(1567990072)] public class TLDifferenceEmpty : TLAbsDifference { - public override int Constructor + public override int Constructor => 1567990072; + + public int date { get; set; } + public int seq { get; set; } + + + public void ComputeFlags() { - get - { - return 1567990072; - } } - public int date {get;set;} - public int seq {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { date = br.ReadInt32(); -seq = br.ReadInt32(); - + seq = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(date); -bw.Write(seq); - + bw.Write(seq); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs b/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs index 8468db7..95fd036 100644 --- a/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs +++ b/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(-1459938943)] + [TLObject(-1459938943)] public class TLDifferenceSlice : TLAbsDifference { - public override int Constructor + public override int Constructor => -1459938943; + + public TLVector new_messages { get; set; } + public TLVector new_encrypted_messages { get; set; } + public TLVector other_updates { get; set; } + public TLVector chats { get; set; } + public TLVector users { get; set; } + public TLState intermediate_state { get; set; } + + + public void ComputeFlags() { - get - { - return -1459938943; - } } - public TLVector new_messages {get;set;} - public TLVector new_encrypted_messages {get;set;} - public TLVector other_updates {get;set;} - public TLVector chats {get;set;} - public TLVector users {get;set;} - public Updates.TLState intermediate_state {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - new_messages = (TLVector)ObjectUtils.DeserializeVector(br); -new_encrypted_messages = (TLVector)ObjectUtils.DeserializeVector(br); -other_updates = (TLVector)ObjectUtils.DeserializeVector(br); -chats = (TLVector)ObjectUtils.DeserializeVector(br); -users = (TLVector)ObjectUtils.DeserializeVector(br); -intermediate_state = (Updates.TLState)ObjectUtils.DeserializeObject(br); - + new_messages = ObjectUtils.DeserializeVector(br); + new_encrypted_messages = ObjectUtils.DeserializeVector(br); + other_updates = ObjectUtils.DeserializeVector(br); + chats = ObjectUtils.DeserializeVector(br); + users = ObjectUtils.DeserializeVector(br); + intermediate_state = (TLState) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(new_messages,bw); -ObjectUtils.SerializeObject(new_encrypted_messages,bw); -ObjectUtils.SerializeObject(other_updates,bw); -ObjectUtils.SerializeObject(chats,bw); -ObjectUtils.SerializeObject(users,bw); -ObjectUtils.SerializeObject(intermediate_state,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(new_messages, bw); + ObjectUtils.SerializeObject(new_encrypted_messages, bw); + ObjectUtils.SerializeObject(other_updates, bw); + ObjectUtils.SerializeObject(chats, bw); + ObjectUtils.SerializeObject(users, bw); + ObjectUtils.SerializeObject(intermediate_state, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs b/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs index 7d4e79b..14e4fcb 100644 --- a/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs +++ b/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(-1154295872)] + [TLObject(-1154295872)] public class TLRequestGetChannelDifference : TLMethod { - public override int Constructor + public override int Constructor => -1154295872; + + public TLAbsInputChannel channel { get; set; } + public TLAbsChannelMessagesFilter filter { get; set; } + public int pts { get; set; } + public int limit { get; set; } + public TLAbsChannelDifference Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1154295872; - } } - public TLAbsInputChannel channel {get;set;} - public TLAbsChannelMessagesFilter filter {get;set;} - public int pts {get;set;} - public int limit {get;set;} - public Updates.TLAbsChannelDifference Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); -filter = (TLAbsChannelMessagesFilter)ObjectUtils.DeserializeObject(br); -pts = br.ReadInt32(); -limit = br.ReadInt32(); - + channel = (TLAbsInputChannel) ObjectUtils.DeserializeObject(br); + filter = (TLAbsChannelMessagesFilter) ObjectUtils.DeserializeObject(br); + pts = br.ReadInt32(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(channel,bw); -ObjectUtils.SerializeObject(filter,bw); -bw.Write(pts); -bw.Write(limit); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(channel, bw); + ObjectUtils.SerializeObject(filter, bw); + bw.Write(pts); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Updates.TLAbsChannelDifference)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsChannelDifference) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs b/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs index 65b6318..24d2ce0 100644 --- a/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs +++ b/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(168039573)] + [TLObject(168039573)] public class TLRequestGetDifference : TLMethod { - public override int Constructor + public override int Constructor => 168039573; + + public int pts { get; set; } + public int date { get; set; } + public int qts { get; set; } + public TLAbsDifference Response { get; set; } + + + public void ComputeFlags() { - get - { - return 168039573; - } } - public int pts {get;set;} - public int date {get;set;} - public int qts {get;set;} - public Updates.TLAbsDifference Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { pts = br.ReadInt32(); -date = br.ReadInt32(); -qts = br.ReadInt32(); - + date = br.ReadInt32(); + qts = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(pts); -bw.Write(date); -bw.Write(qts); - + bw.Write(date); + bw.Write(qts); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Updates.TLAbsDifference)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLAbsDifference) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLRequestGetState.cs b/TeleSharp.TL/TL/Updates/TLRequestGetState.cs index 5d80b7b..fc925d7 100644 --- a/TeleSharp.TL/TL/Updates/TLRequestGetState.cs +++ b/TeleSharp.TL/TL/Updates/TLRequestGetState.cs @@ -1,45 +1,31 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(-304838614)] + [TLObject(-304838614)] public class TLRequestGetState : TLMethod { - public override int Constructor + public override int Constructor => -304838614; + + public TLState Response { get; set; } + + + public void ComputeFlags() { - get - { - return -304838614; - } } - public Updates.TLState Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - + bw.Write(Constructor); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Updates.TLState)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLState) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Updates/TLState.cs b/TeleSharp.TL/TL/Updates/TLState.cs index d287979..730e6ab 100644 --- a/TeleSharp.TL/TL/Updates/TLState.cs +++ b/TeleSharp.TL/TL/Updates/TLState.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Updates { - [TLObject(-1519637954)] + [TLObject(-1519637954)] public class TLState : TLObject { - public override int Constructor + public override int Constructor => -1519637954; + + public int pts { get; set; } + public int qts { get; set; } + public int date { get; set; } + public int seq { get; set; } + public int unread_count { get; set; } + + + public void ComputeFlags() { - get - { - return -1519637954; - } } - public int pts {get;set;} - public int qts {get;set;} - public int date {get;set;} - public int seq {get;set;} - public int unread_count {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { pts = br.ReadInt32(); -qts = br.ReadInt32(); -date = br.ReadInt32(); -seq = br.ReadInt32(); -unread_count = br.ReadInt32(); - + qts = br.ReadInt32(); + date = br.ReadInt32(); + seq = br.ReadInt32(); + unread_count = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(pts); -bw.Write(qts); -bw.Write(date); -bw.Write(seq); -bw.Write(unread_count); - + bw.Write(qts); + bw.Write(date); + bw.Write(seq); + bw.Write(unread_count); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Upload/TLFile.cs b/TeleSharp.TL/TL/Upload/TLFile.cs index 3cdd4cc..70a3a69 100644 --- a/TeleSharp.TL/TL/Upload/TLFile.cs +++ b/TeleSharp.TL/TL/Upload/TLFile.cs @@ -1,48 +1,35 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; +using TeleSharp.TL.Storage; + namespace TeleSharp.TL.Upload { - [TLObject(157948117)] + [TLObject(157948117)] public class TLFile : TLObject { - public override int Constructor + public override int Constructor => 157948117; + + public TLAbsFileType type { get; set; } + public int mtime { get; set; } + public byte[] bytes { get; set; } + + + public void ComputeFlags() { - get - { - return 157948117; - } } - public Storage.TLAbsFileType type {get;set;} - public int mtime {get;set;} - public byte[] bytes {get;set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - type = (Storage.TLAbsFileType)ObjectUtils.DeserializeObject(br); -mtime = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + type = (TLAbsFileType) ObjectUtils.DeserializeObject(br); + mtime = br.ReadInt32(); + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(type,bw); -bw.Write(mtime); -BytesUtil.Serialize(bytes,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(type, bw); + bw.Write(mtime); + BytesUtil.Serialize(bytes, bw); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs b/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs index c34b8a0..c4ba06b 100644 --- a/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs +++ b/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Upload { - [TLObject(-475607115)] + [TLObject(-475607115)] public class TLRequestGetFile : TLMethod { - public override int Constructor + public override int Constructor => -475607115; + + public TLAbsInputFileLocation location { get; set; } + public int offset { get; set; } + public int limit { get; set; } + public TLFile Response { get; set; } + + + public void ComputeFlags() { - get - { - return -475607115; - } } - public TLAbsInputFileLocation location {get;set;} - public int offset {get;set;} - public int limit {get;set;} - public Upload.TLFile Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - location = (TLAbsInputFileLocation)ObjectUtils.DeserializeObject(br); -offset = br.ReadInt32(); -limit = br.ReadInt32(); - + location = (TLAbsInputFileLocation) ObjectUtils.DeserializeObject(br); + offset = br.ReadInt32(); + limit = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(location,bw); -bw.Write(offset); -bw.Write(limit); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(location, bw); + bw.Write(offset); + bw.Write(limit); } - public override void deserializeResponse(BinaryReader br) - { - Response = (Upload.TLFile)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLFile) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs b/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs index cb6c22f..de8609c 100644 --- a/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs +++ b/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Upload { - [TLObject(-562337987)] + [TLObject(-562337987)] public class TLRequestSaveBigFilePart : TLMethod { - public override int Constructor + public override int Constructor => -562337987; + + public long file_id { get; set; } + public int file_part { get; set; } + public int file_total_parts { get; set; } + public byte[] bytes { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -562337987; - } } - public long file_id {get;set;} - public int file_part {get;set;} - public int file_total_parts {get;set;} - public byte[] bytes {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { file_id = br.ReadInt64(); -file_part = br.ReadInt32(); -file_total_parts = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + file_part = br.ReadInt32(); + file_total_parts = br.ReadInt32(); + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(file_id); -bw.Write(file_part); -bw.Write(file_total_parts); -BytesUtil.Serialize(bytes,bw); - + bw.Write(file_part); + bw.Write(file_total_parts); + BytesUtil.Serialize(bytes, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs b/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs index 86ce30a..a3f286c 100644 --- a/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs +++ b/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs @@ -1,54 +1,40 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Upload { - [TLObject(-1291540959)] + [TLObject(-1291540959)] public class TLRequestSaveFilePart : TLMethod { - public override int Constructor + public override int Constructor => -1291540959; + + public long file_id { get; set; } + public int file_part { get; set; } + public byte[] bytes { get; set; } + public bool Response { get; set; } + + + public void ComputeFlags() { - get - { - return -1291540959; - } } - public long file_id {get;set;} - public int file_part {get;set;} - public byte[] bytes {get;set;} - public bool Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { file_id = br.ReadInt64(); -file_part = br.ReadInt32(); -bytes = BytesUtil.Deserialize(br); - + file_part = br.ReadInt32(); + bytes = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); bw.Write(file_id); -bw.Write(file_part); -BytesUtil.Serialize(bytes,bw); - + bw.Write(file_part); + BytesUtil.Serialize(bytes, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = BoolUtil.Deserialize(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs b/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs index da2e0d6..b6eb63e 100644 --- a/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs +++ b/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Users { - [TLObject(-902781519)] + [TLObject(-902781519)] public class TLRequestGetFullUser : TLMethod { - public override int Constructor + public override int Constructor => -902781519; + + public TLAbsInputUser id { get; set; } + public TLUserFull Response { get; set; } + + + public void ComputeFlags() { - get - { - return -902781519; - } } - public TLAbsInputUser id {get;set;} - public TLUserFull Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - + id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLUserFull)ObjectUtils.DeserializeObject(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = (TLUserFull) ObjectUtils.DeserializeObject(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs b/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs index 4679594..d0793a5 100644 --- a/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs +++ b/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs @@ -1,48 +1,34 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; + namespace TeleSharp.TL.Users { - [TLObject(227648840)] + [TLObject(227648840)] public class TLRequestGetUsers : TLMethod { - public override int Constructor + public override int Constructor => 227648840; + + public TLVector id { get; set; } + public TLVector Response { get; set; } + + + public void ComputeFlags() { - get - { - return 227648840; - } } - public TLVector id {get;set;} - public TLVector Response{ get; set;} - - - public void ComputeFlags() - { - - } - public override void DeserializeBody(BinaryReader br) { - id = (TLVector)ObjectUtils.DeserializeVector(br); - + id = ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); - ObjectUtils.SerializeObject(id,bw); - + bw.Write(Constructor); + ObjectUtils.SerializeObject(id, bw); } - public override void deserializeResponse(BinaryReader br) - { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - } + public override void deserializeResponse(BinaryReader br) + { + Response = ObjectUtils.DeserializeVector(br); + } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TLContext.cs b/TeleSharp.TL/TLContext.cs index db686aa..da78df2 100644 --- a/TeleSharp.TL/TLContext.cs +++ b/TeleSharp.TL/TLContext.cs @@ -2,10 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public static class TLContext @@ -16,15 +13,17 @@ namespace TeleSharp.TL { Types = new Dictionary(); Types = (from t in Assembly.GetExecutingAssembly().GetTypes() - where t.IsClass && t.Namespace.StartsWith("TeleSharp.TL") - where t.IsSubclassOf(typeof(TLObject)) - where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null - select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); + where t.IsClass && t.Namespace.StartsWith("TeleSharp.TL") + where t.IsSubclassOf(typeof(TLObject)) + where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null + select t).ToDictionary( + x => ((TLObjectAttribute) x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); Types.Add(481674261, typeof(TLVector<>)); } + public static Type getType(int Constructor) { return Types[Constructor]; } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TLMethod.cs b/TeleSharp.TL/TLMethod.cs index 7a44933..5bd6824 100644 --- a/TeleSharp.TL/TLMethod.cs +++ b/TeleSharp.TL/TLMethod.cs @@ -1,18 +1,14 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public abstract class TLMethod : TLObject { - public abstract void deserializeResponse(BinaryReader stream); + #region MTPROTO + public long MessageId { get; set; } public int Sequence { get; set; } public bool Dirty { get; set; } @@ -33,14 +29,9 @@ namespace TeleSharp.TL ConfirmReceived = true; } - public bool NeedResend - { - get - { - return Dirty || (Confirmed && !ConfirmReceived && DateTime.Now - SendTime > TimeSpan.FromSeconds(3)); - } - } - #endregion + public bool NeedResend => Dirty || Confirmed && !ConfirmReceived && + DateTime.Now - SendTime > TimeSpan.FromSeconds(3); + #endregion } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TLObject.cs b/TeleSharp.TL/TLObject.cs index 3bc1476..0d9ad8e 100644 --- a/TeleSharp.TL/TLObject.cs +++ b/TeleSharp.TL/TLObject.cs @@ -1,21 +1,16 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; namespace TeleSharp.TL { public class TLObjectAttribute : Attribute { - public int Constructor { get; private set; } - public TLObjectAttribute(int Constructor) { this.Constructor = Constructor; } + + public int Constructor { get; } } public abstract class TLObject @@ -23,10 +18,11 @@ namespace TeleSharp.TL public abstract int Constructor { get; } public abstract void SerializeBody(BinaryWriter bw); public abstract void DeserializeBody(BinaryReader br); + public byte[] Serialize() { - using (MemoryStream m = new MemoryStream()) - using (BinaryWriter bw = new BinaryWriter(m)) + using (var m = new MemoryStream()) + using (var bw = new BinaryWriter(m)) { Serialize(bw); bw.Close(); @@ -34,17 +30,19 @@ namespace TeleSharp.TL return m.GetBuffer(); } } + public void Serialize(BinaryWriter writer) { writer.Write(Constructor); SerializeBody(writer); } + public void Deserialize(BinaryReader reader) { - int constructorId = reader.ReadInt32(); + var constructorId = reader.ReadInt32(); if (constructorId != Constructor) throw new InvalidDataException("Constructor Invalid"); DeserializeBody(reader); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TLUtils.cs b/TeleSharp.TL/TLUtils.cs index f4c285b..0f7b04c 100644 --- a/TeleSharp.TL/TLUtils.cs +++ b/TeleSharp.TL/TLUtils.cs @@ -1,44 +1,41 @@ -using BigMath; -using BigMath.Utils; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; +using System.IO; using System.Text; -using System.Threading.Tasks; +using BigMath; +using BigMath.Utils; -using TeleSharp.TL; namespace TeleSharp.TL { - public class IntegerUtil + public class IntegerUtil { public static int Deserialize(BinaryReader reader) { return reader.ReadInt32(); } - public static void Serialize(int src,BinaryWriter writer) + public static void Serialize(int src, BinaryWriter writer) { writer.Write(src); } } + public class BytesUtil { private static byte[] read(BinaryReader binaryReader) { - byte firstByte = binaryReader.ReadByte(); + var firstByte = binaryReader.ReadByte(); int len, padding; if (firstByte == 254) { len = binaryReader.ReadByte() | (binaryReader.ReadByte() << 8) | (binaryReader.ReadByte() << 16); padding = len % 4; } - else { + else + { len = firstByte; padding = (len + 1) % 4; } - byte[] data = binaryReader.ReadBytes(len); + var data = binaryReader.ReadBytes(len); if (padding > 0) { padding = 4 - padding; @@ -55,35 +52,31 @@ namespace TeleSharp.TL { padding = (data.Length + 1) % 4; if (padding != 0) - { padding = 4 - padding; - } - binaryWriter.Write((byte)data.Length); + binaryWriter.Write((byte) data.Length); binaryWriter.Write(data); } - else { - padding = (data.Length) % 4; - if (padding != 0) - { - padding = 4 - padding; - } - - binaryWriter.Write((byte)254); - binaryWriter.Write((byte)(data.Length)); - binaryWriter.Write((byte)(data.Length >> 8)); - binaryWriter.Write((byte)(data.Length >> 16)); - binaryWriter.Write(data); - } - - - for (int i = 0; i < padding; i++) + else { - binaryWriter.Write((byte)0); + padding = data.Length % 4; + if (padding != 0) + padding = 4 - padding; + + binaryWriter.Write((byte) 254); + binaryWriter.Write((byte) data.Length); + binaryWriter.Write((byte) (data.Length >> 8)); + binaryWriter.Write((byte) (data.Length >> 16)); + binaryWriter.Write(data); } + + for (var i = 0; i < padding; i++) + binaryWriter.Write((byte) 0); + return binaryWriter; } + public static byte[] Deserialize(BinaryReader reader) { return read(reader); @@ -91,21 +84,24 @@ namespace TeleSharp.TL public static void Serialize(byte[] src, BinaryWriter writer) { - write(writer,src); + write(writer, src); } } + public class StringUtil { public static string Deserialize(BinaryReader reader) { - byte[] data = BytesUtil.Deserialize(reader); + var data = BytesUtil.Deserialize(reader); return Encoding.UTF8.GetString(data, 0, data.Length); } - public static void Serialize(string src,BinaryWriter writer) + + public static void Serialize(string src, BinaryWriter writer) { BytesUtil.Serialize(Encoding.UTF8.GetBytes(src), writer); } } + public class BoolUtil { public static bool Deserialize(BinaryReader reader) @@ -114,68 +110,80 @@ namespace TeleSharp.TL var TrueCNumber = -1720552011; var readed = reader.ReadInt32(); if (readed == FalseCNumber) return false; - else if (readed == TrueCNumber) return true; - else throw new InvalidDataException(String.Format("Invalid Boolean Data : {0}", readed.ToString())); + if (readed == TrueCNumber) return true; + throw new InvalidDataException(string.Format("Invalid Boolean Data : {0}", readed)); } + public static void Serialize(bool src, BinaryWriter writer) { var FalseCNumber = -1132882121; var TrueCNumber = -1720552011; - writer.Write(src ? TrueCNumber:FalseCNumber); + writer.Write(src ? TrueCNumber : FalseCNumber); } } + public class UIntUtil { public static uint Deserialize(BinaryReader reader) { return reader.ReadUInt32(); } + public static void Serialize(uint src, BinaryWriter writer) { writer.Write(src); } } - public class DoubleUtil { + + public class DoubleUtil + { public static double Deserialize(BinaryReader reader) { return reader.ReadDouble(); } + public static void Serialize(double src, BinaryWriter writer) { writer.Write(src); } } + public class LongUtil { public static long Deserialize(BinaryReader reader) { return reader.ReadInt64(); } + public static void Serialize(long src, BinaryWriter writer) { writer.Write(src); } } + public class Int128Util { public static Int128 Deserialize(BinaryReader reader) { - return reader.ReadBytes(16).ToInt128(0,true); + return reader.ReadBytes(16).ToInt128(0, true); } + public static void Serialize(Int128 src, BinaryWriter writer) { writer.Write(src.ToBytes(true)); } } + public class Int256Util { public static Int256 Deserialize(BinaryReader reader) { return reader.ReadBytes(32).ToInt256(0, true); } + public static void Serialize(Int256 src, BinaryWriter writer) { writer.Write(src.ToBytes(true)); } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/TLVector.cs b/TeleSharp.TL/TLVector.cs index 08e8ae5..12df823 100644 --- a/TeleSharp.TL/TLVector.cs +++ b/TeleSharp.TL/TLVector.cs @@ -2,53 +2,43 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace TeleSharp.TL { public class TLVector : TLObject { - [TLObject(481674261)] - public List lists = new List(); - public override int Constructor - { - get - { - return 481674261; - } - } + [TLObject(481674261)] public List lists = new List(); + + public override int Constructor => 481674261; public override void DeserializeBody(BinaryReader br) { - int count = br.ReadInt32(); + var count = br.ReadInt32(); for (var i = 0; i < count; i++) - { if (typeof(T) == typeof(int)) { - lists.Add((T)Convert.ChangeType(br.ReadInt32(), typeof(T))); + lists.Add((T) Convert.ChangeType(br.ReadInt32(), typeof(T))); } else if (typeof(T) == typeof(long)) { - lists.Add((T)Convert.ChangeType(br.ReadInt64(), typeof(T))); + lists.Add((T) Convert.ChangeType(br.ReadInt64(), typeof(T))); } else if (typeof(T) == typeof(string)) { - lists.Add((T)Convert.ChangeType(StringUtil.Deserialize(br), typeof(T))); + lists.Add((T) Convert.ChangeType(StringUtil.Deserialize(br), typeof(T))); } else if (typeof(T) == typeof(double)) { - lists.Add((T)Convert.ChangeType(br.ReadDouble(), typeof(T))); + lists.Add((T) Convert.ChangeType(br.ReadDouble(), typeof(T))); } else if (typeof(T).BaseType == typeof(TLObject)) { - int constructor = br.ReadInt32(); - Type type = TLContext.getType(constructor); - object obj = Activator.CreateInstance(type); - type.GetMethod("DeserializeBody").Invoke(obj, new object[] { br }); - lists.Add((T)Convert.ChangeType(obj, type)); + var constructor = br.ReadInt32(); + var type = TLContext.getType(constructor); + var obj = Activator.CreateInstance(type); + type.GetMethod("DeserializeBody").Invoke(obj, new object[] {br}); + lists.Add((T) Convert.ChangeType(obj, type)); } - } } public override void SerializeBody(BinaryWriter bw) @@ -57,34 +47,32 @@ namespace TeleSharp.TL bw.Write(lists.Count()); foreach (var item in lists) - { if (typeof(T) == typeof(int)) { - var res = (int)Convert.ChangeType(item, typeof(int)); + var res = (int) Convert.ChangeType(item, typeof(int)); bw.Write(res); } else if (typeof(T) == typeof(long)) { - var res = (long)Convert.ChangeType(item, typeof(long)); + var res = (long) Convert.ChangeType(item, typeof(long)); bw.Write(res); } else if (typeof(T) == typeof(string)) { - var res = (string)(Convert.ChangeType(item, typeof(string))); + var res = (string) Convert.ChangeType(item, typeof(string)); StringUtil.Serialize(res, bw); } else if (typeof(T) == typeof(double)) { - var res = (double)Convert.ChangeType(item, typeof(double)); + var res = (double) Convert.ChangeType(item, typeof(double)); bw.Write(res); } else if (typeof(T).BaseType == typeof(TLObject)) { - var res = (TLObject)(object)item; + var res = (TLObject) (object) item; res.SerializeBody(bw); } - } } } -} +} \ No newline at end of file diff --git a/TeleSharp.TL/packages.config b/TeleSharp.TL/packages.config index cde6ccb..3fa590b 100644 --- a/TeleSharp.TL/packages.config +++ b/TeleSharp.TL/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file From d4b9c88866d66808615c1064bd322afc5874e8c5 Mon Sep 17 00:00:00 2001 From: Viktor Borisov Date: Thu, 13 Apr 2017 13:48:29 +0700 Subject: [PATCH 2/3] remove unused dependency BigMath --- TeleSharp.TL/TLUtils.cs | 28 ---------------------------- TeleSharp.TL/TeleSharp.TL.csproj | 7 ------- TeleSharp.TL/packages.config | 5 ----- 3 files changed, 40 deletions(-) delete mode 100644 TeleSharp.TL/packages.config diff --git a/TeleSharp.TL/TLUtils.cs b/TeleSharp.TL/TLUtils.cs index 0f7b04c..7853e04 100644 --- a/TeleSharp.TL/TLUtils.cs +++ b/TeleSharp.TL/TLUtils.cs @@ -1,7 +1,5 @@ using System.IO; using System.Text; -using BigMath; -using BigMath.Utils; namespace TeleSharp.TL { @@ -160,30 +158,4 @@ namespace TeleSharp.TL writer.Write(src); } } - - public class Int128Util - { - public static Int128 Deserialize(BinaryReader reader) - { - return reader.ReadBytes(16).ToInt128(0, true); - } - - public static void Serialize(Int128 src, BinaryWriter writer) - { - writer.Write(src.ToBytes(true)); - } - } - - public class Int256Util - { - public static Int256 Deserialize(BinaryReader reader) - { - return reader.ReadBytes(32).ToInt256(0, true); - } - - public static void Serialize(Int256 src, BinaryWriter writer) - { - writer.Write(src.ToBytes(true)); - } - } } \ No newline at end of file diff --git a/TeleSharp.TL/TeleSharp.TL.csproj b/TeleSharp.TL/TeleSharp.TL.csproj index 65252c2..023492d 100644 --- a/TeleSharp.TL/TeleSharp.TL.csproj +++ b/TeleSharp.TL/TeleSharp.TL.csproj @@ -30,10 +30,6 @@ 4 - - ..\packages\BigMath.0.5.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\BigMath.dll - True - @@ -782,9 +778,6 @@ - - -