diff --git a/.github/workflows/nugetUpload.yml b/.github/workflows/nugetUpload.yml index b98bab6..578c388 100644 --- a/.github/workflows/nugetUpload.yml +++ b/.github/workflows/nugetUpload.yml @@ -28,7 +28,7 @@ jobs: $version = $Env:GITHUB_REF.Substring($tagPrefix.Length) } Else { - $baseVersion = "0.1.1" + $baseVersion = "0.3.1" $version = "$baseVersion--date$date.git-$hash" } diff --git a/README.md b/README.md index 62b17ff..17ba97c 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,6 @@ TgSharp provides two wrappers for sending photo and document: await client.SendUploadedPhoto(new TLInputPeerUser() { UserId = user.Id }, fileResult, "kitty"); await client.SendUploadedDocument(new TLInputPeerUser() { UserId = user.Id }, fileResult, - "some zips", //caption "application/zip", //mime-type //document attributes, such as file name @@ -138,7 +137,8 @@ To download a file you should call the **GetFile** method: { AccessHash = document.AccessHash, Id = document.Id, - Version = document.Version + FileReference = document.FileReference, + ThumbSize = "250x250" }, //size of fileChunk you want to retrieve @@ -152,10 +152,8 @@ You can see the Full code at [DownloadFileFromContactTest](https://github.com/nb For your convenience TgSharp have wrappers for several Telegram API methods. You could add your own, see details below. -1. IsPhoneRegisteredAsync 1. SendCodeRequestAsync 1. MakeAuthAsync -1. SignUpAsync 1. GetContactsAsync 1. SendMessageAsync 1. SendTypingAsync @@ -187,15 +185,14 @@ Don't panic. You can call any method with help of `SendRequestAsync` function. F **Where can you find a list of requests and its parameters?** -The only way is [Telegram API docs](https://core.telegram.org/methods). Yes, it's outdated. But there is no other source. -Latest scheme in JSON format you can find [here](https://gist.github.com/aarani/b22b7cda024973dff68e1672794b0298) +The only way is [Telegram API docs](https://core.telegram.org/methods). Yes, it's no longer outdated. +Latest scheme in JSON format you can find [here](https://core.telegram.org/schema/json) ## What things can I help on (Project Roadmap)? * Add Updates handling via events (WIP PR: https://github.com/sochix/TLSharp/pull/892 ) * GithubActions CI job for running tests -* Update to latest Layer (WIP PR: https://github.com/nblockchain/TgSharp/pull/5 ). * Upgrade to .NETStandard 2.0. @@ -203,7 +200,7 @@ Latest scheme in JSON format you can find [here](https://gist.github.com/aarani/ #### What API layer is supported? -Layer 66. Thanks to Afshin Arani for his TLGenerator +Layer 108. Thanks to Afshin Arani for his TLGenerator #### I get a xxxMigrationException or a MIGRATE_X error! diff --git a/src/TeleSharp.Generator/Models/TlSchema.cs b/src/TeleSharp.Generator/Models/TlSchema.cs deleted file mode 100644 index ca1d82e..0000000 --- a/src/TeleSharp.Generator/Models/TlSchema.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Newtonsoft.Json; - -namespace TeleSharp.Generator.Models -{ - internal class TlSchema - { - [JsonProperty("constructors")] - public List Constructors { get; set; } - - [JsonProperty("methods")] - public List Methods { get; set; } - } -} \ No newline at end of file diff --git a/src/TeleSharp.TL/TL/Account/TLPassword.cs b/src/TeleSharp.TL/TL/Account/TLPassword.cs deleted file mode 100644 index 8748aa4..0000000 --- a/src/TeleSharp.TL/TL/Account/TLPassword.cs +++ /dev/null @@ -1,54 +0,0 @@ -using 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)] - public class TLPassword : TLAbsPassword - { - public override int Constructor - { - get - { - return 2081952796; - } - } - - public byte[] CurrentSalt { get; set; } - public byte[] NewSalt { get; set; } - public string Hint { get; set; } - public bool HasRecovery { get; set; } - public string EmailUnconfirmedPattern { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - CurrentSalt = BytesUtil.Deserialize(br); - NewSalt = BytesUtil.Deserialize(br); - Hint = StringUtil.Deserialize(br); - HasRecovery = BoolUtil.Deserialize(br); - EmailUnconfirmedPattern = StringUtil.Deserialize(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - BytesUtil.Serialize(CurrentSalt, bw); - BytesUtil.Serialize(NewSalt, bw); - StringUtil.Serialize(Hint, bw); - BoolUtil.Serialize(HasRecovery, bw); - StringUtil.Serialize(EmailUnconfirmedPattern, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/Contacts/TLLink.cs b/src/TeleSharp.TL/TL/Contacts/TLLink.cs deleted file mode 100644 index 0d956e7..0000000 --- a/src/TeleSharp.TL/TL/Contacts/TLLink.cs +++ /dev/null @@ -1,48 +0,0 @@ -using 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)] - public class TLLink : TLObject - { - public override int Constructor - { - get - { - return 986597452; - } - } - - public TLAbsContactLink MyLink { get; set; } - public TLAbsContactLink ForeignLink { get; set; } - public TLAbsUser User { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - MyLink = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); - ForeignLink = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); - User = (TLAbsUser)ObjectUtils.DeserializeObject(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ObjectUtils.SerializeObject(MyLink, bw); - ObjectUtils.SerializeObject(ForeignLink, bw); - ObjectUtils.SerializeObject(User, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs b/src/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs deleted file mode 100644 index 82b06b1..0000000 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestImportCard.cs +++ /dev/null @@ -1,48 +0,0 @@ -using 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)] - public class TLRequestImportCard : TLMethod - { - public override int Constructor - { - get - { - return 1340184318; - } - } - - public TLVector ExportCard { get; set; } - public TLAbsUser Response { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - ExportCard = (TLVector)ObjectUtils.DeserializeVector(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ObjectUtils.SerializeObject(ExportCard, bw); - - } - public override void DeserializeResponse(BinaryReader br) - { - Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - - } - } -} diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs b/src/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs deleted file mode 100644 index db90934..0000000 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetTermsOfService.cs +++ /dev/null @@ -1,45 +0,0 @@ -using 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)] - public class TLRequestGetTermsOfService : TLMethod - { - public override int Constructor - { - 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); - - } - public override void DeserializeResponse(BinaryReader br) - { - Response = (Help.TLTermsOfService)ObjectUtils.DeserializeObject(br); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs b/src/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs deleted file mode 100644 index 7266e4f..0000000 --- a/src/TeleSharp.TL/TL/TLAbsInputPeerNotifyEvents.cs +++ /dev/null @@ -1,13 +0,0 @@ -using 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 - { - } -} diff --git a/src/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs b/src/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs deleted file mode 100644 index b0df9f6..0000000 --- a/src/TeleSharp.TL/TL/TLAbsPeerNotifyEvents.cs +++ /dev/null @@ -1,13 +0,0 @@ -using 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 - { - } -} diff --git a/src/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs b/src/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs deleted file mode 100644 index 57c5087..0000000 --- a/src/TeleSharp.TL/TL/TLAbsPeerNotifySettings.cs +++ /dev/null @@ -1,13 +0,0 @@ -using 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 - { - } -} diff --git a/src/TeleSharp.TL/TL/TLBotInlineResult.cs b/src/TeleSharp.TL/TL/TLBotInlineResult.cs deleted file mode 100644 index 574f7c9..0000000 --- a/src/TeleSharp.TL/TL/TLBotInlineResult.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -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)] - public class TLBotInlineResult : TLAbsBotInlineResult - { - public override int Constructor - { - get - { - return -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 ThumbUrl { get; set; } - public string ContentUrl { get; set; } - public string ContentType { get; set; } - public int? W { get; set; } - public int? H { get; set; } - public int? Duration { get; set; } - public TLAbsBotInlineMessage SendMessage { 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 = ThumbUrl != null ? (Flags | 16) : (Flags & ~16); - Flags = ContentUrl != null ? (Flags | 32) : (Flags & ~32); - Flags = ContentType != 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; - - if ((Flags & 4) != 0) - Description = StringUtil.Deserialize(br); - else - Description = null; - - if ((Flags & 8) != 0) - Url = StringUtil.Deserialize(br); - else - Url = null; - - if ((Flags & 16) != 0) - ThumbUrl = StringUtil.Deserialize(br); - else - ThumbUrl = null; - - if ((Flags & 32) != 0) - ContentUrl = StringUtil.Deserialize(br); - else - ContentUrl = null; - - if ((Flags & 32) != 0) - ContentType = StringUtil.Deserialize(br); - else - ContentType = null; - - if ((Flags & 64) != 0) - W = br.ReadInt32(); - else - W = null; - - if ((Flags & 64) != 0) - H = br.ReadInt32(); - else - H = null; - - if ((Flags & 128) != 0) - Duration = br.ReadInt32(); - else - Duration = null; - - SendMessage = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - 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(ThumbUrl, bw); - if ((Flags & 32) != 0) - StringUtil.Serialize(ContentUrl, bw); - if ((Flags & 32) != 0) - StringUtil.Serialize(ContentType, 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(SendMessage, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLChatFull.cs b/src/TeleSharp.TL/TL/TLChatFull.cs deleted file mode 100644 index c948f70..0000000 --- a/src/TeleSharp.TL/TL/TLChatFull.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -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)] - public class TLChatFull : TLAbsChatFull - { - public override int Constructor - { - get - { - return 771925524; - } - } - - public int Id { get; set; } - public TLAbsChatParticipants Participants { get; set; } - public TLAbsPhoto ChatPhoto { get; set; } - public TLAbsPeerNotifySettings NotifySettings { get; set; } - public TLAbsExportedChatInvite ExportedInvite { get; set; } - public TLVector BotInfo { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - Id = br.ReadInt32(); - Participants = (TLAbsChatParticipants)ObjectUtils.DeserializeObject(br); - ChatPhoto = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); - NotifySettings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); - ExportedInvite = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); - BotInfo = (TLVector)ObjectUtils.DeserializeVector(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - bw.Write(Id); - ObjectUtils.SerializeObject(Participants, bw); - ObjectUtils.SerializeObject(ChatPhoto, bw); - ObjectUtils.SerializeObject(NotifySettings, bw); - ObjectUtils.SerializeObject(ExportedInvite, bw); - ObjectUtils.SerializeObject(BotInfo, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLChatPhoto.cs b/src/TeleSharp.TL/TL/TLChatPhoto.cs deleted file mode 100644 index 03e4c29..0000000 --- a/src/TeleSharp.TL/TL/TLChatPhoto.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -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)] - public class TLChatPhoto : TLAbsChatPhoto - { - public override int Constructor - { - get - { - return 1632839530; - } - } - - public TLAbsFileLocation PhotoSmall { get; set; } - public TLAbsFileLocation PhotoBig { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - PhotoSmall = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); - PhotoBig = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ObjectUtils.SerializeObject(PhotoSmall, bw); - ObjectUtils.SerializeObject(PhotoBig, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLContactLinkContact.cs b/src/TeleSharp.TL/TL/TLContactLinkContact.cs deleted file mode 100644 index 3c3b673..0000000 --- a/src/TeleSharp.TL/TL/TLContactLinkContact.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLContactLinkContact : TLAbsContactLink - { - public override int Constructor - { - get - { - return -721239344; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLContactLinkHasPhone.cs b/src/TeleSharp.TL/TL/TLContactLinkHasPhone.cs deleted file mode 100644 index 6ac2fd4..0000000 --- a/src/TeleSharp.TL/TL/TLContactLinkHasPhone.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLContactLinkHasPhone : TLAbsContactLink - { - public override int Constructor - { - get - { - return 646922073; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLContactLinkNone.cs b/src/TeleSharp.TL/TL/TLContactLinkNone.cs deleted file mode 100644 index 66a0bd9..0000000 --- a/src/TeleSharp.TL/TL/TLContactLinkNone.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLContactLinkNone : TLAbsContactLink - { - public override int Constructor - { - get - { - return -17968211; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLContactLinkUnknown.cs b/src/TeleSharp.TL/TL/TLContactLinkUnknown.cs deleted file mode 100644 index a4a4cd6..0000000 --- a/src/TeleSharp.TL/TL/TLContactLinkUnknown.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLContactLinkUnknown : TLAbsContactLink - { - public override int Constructor - { - get - { - return 1599050311; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLDisabledFeature.cs b/src/TeleSharp.TL/TL/TLDisabledFeature.cs deleted file mode 100644 index ce1d8de..0000000 --- a/src/TeleSharp.TL/TL/TLDisabledFeature.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -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)] - public class TLDisabledFeature : TLObject - { - public override int Constructor - { - 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); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - StringUtil.Serialize(Feature, bw); - StringUtil.Serialize(Description, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs b/src/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs deleted file mode 100644 index aab0341..0000000 --- a/src/TeleSharp.TL/TL/TLInputMediaUploadedThumbDocument.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -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)] - public class TLInputMediaUploadedThumbDocument : TLAbsInputMedia - { - public override int Constructor - { - get - { - return 1356369070; - } - } - - public int Flags { get; set; } - public TLAbsInputFile File { get; set; } - public TLAbsInputFile Thumb { get; set; } - public string MimeType { 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); - MimeType = StringUtil.Deserialize(br); - Attributes = (TLVector)ObjectUtils.DeserializeVector(br); - Caption = StringUtil.Deserialize(br); - if ((Flags & 1) != 0) - Stickers = (TLVector)ObjectUtils.DeserializeVector(br); - else - Stickers = null; - - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); - ObjectUtils.SerializeObject(File, bw); - ObjectUtils.SerializeObject(Thumb, bw); - StringUtil.Serialize(MimeType, bw); - ObjectUtils.SerializeObject(Attributes, bw); - StringUtil.Serialize(Caption, bw); - if ((Flags & 1) != 0) - ObjectUtils.SerializeObject(Stickers, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs b/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs deleted file mode 100644 index 5b1c262..0000000 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideoDocuments.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLInputMessagesFilterPhotoVideoDocuments : TLAbsMessagesFilter - { - public override int Constructor - { - get - { - return -648121413; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLInputNotifyAll.cs b/src/TeleSharp.TL/TL/TLInputNotifyAll.cs deleted file mode 100644 index d8651fa..0000000 --- a/src/TeleSharp.TL/TL/TLInputNotifyAll.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLInputNotifyAll : TLAbsInputNotifyPeer - { - public override int Constructor - { - get - { - return -1540769658; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs b/src/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs deleted file mode 100644 index 35df4ed..0000000 --- a/src/TeleSharp.TL/TL/TLInputPeerNotifyEventsAll.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLInputPeerNotifyEventsAll : TLAbsInputPeerNotifyEvents - { - public override int Constructor - { - get - { - return -395694988; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs b/src/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs deleted file mode 100644 index f913a8a..0000000 --- a/src/TeleSharp.TL/TL/TLInputPeerNotifyEventsEmpty.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLInputPeerNotifyEventsEmpty : TLAbsInputPeerNotifyEvents - { - public override int Constructor - { - get - { - return -265263912; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs b/src/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs deleted file mode 100644 index 4e580b7..0000000 --- a/src/TeleSharp.TL/TL/TLInputPeerNotifySettings.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -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)] - public class TLInputPeerNotifySettings : TLObject - { - public override int Constructor - { - get - { - return 949182130; - } - } - - public int Flags { get; set; } - public bool ShowPreviews { get; set; } - public bool Silent { get; set; } - public int MuteUntil { get; set; } - public string Sound { get; set; } - - - public void ComputeFlags() - { - Flags = 0; - Flags = ShowPreviews ? (Flags | 1) : (Flags & ~1); - Flags = Silent ? (Flags | 2) : (Flags & ~2); - - } - - public override void DeserializeBody(BinaryReader br) - { - Flags = br.ReadInt32(); - ShowPreviews = (Flags & 1) != 0; - Silent = (Flags & 2) != 0; - MuteUntil = br.ReadInt32(); - Sound = StringUtil.Deserialize(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); - - - bw.Write(MuteUntil); - StringUtil.Serialize(Sound, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLMessageMediaPhoto.cs b/src/TeleSharp.TL/TL/TLMessageMediaPhoto.cs deleted file mode 100644 index a62ac89..0000000 --- a/src/TeleSharp.TL/TL/TLMessageMediaPhoto.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -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)] - public class TLMessageMediaPhoto : TLAbsMessageMedia - { - public override int Constructor - { - 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); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ObjectUtils.SerializeObject(Photo, bw); - StringUtil.Serialize(Caption, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLNotifyAll.cs b/src/TeleSharp.TL/TL/TLNotifyAll.cs deleted file mode 100644 index 47d2946..0000000 --- a/src/TeleSharp.TL/TL/TLNotifyAll.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLNotifyAll : TLAbsNotifyPeer - { - public override int Constructor - { - get - { - return 1959820384; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs b/src/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs deleted file mode 100644 index 6d829fd..0000000 --- a/src/TeleSharp.TL/TL/TLPeerNotifyEventsAll.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLPeerNotifyEventsAll : TLAbsPeerNotifyEvents - { - public override int Constructor - { - get - { - return 1830677896; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs b/src/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs deleted file mode 100644 index 3e3b952..0000000 --- a/src/TeleSharp.TL/TL/TLPeerNotifyEventsEmpty.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLPeerNotifyEventsEmpty : TLAbsPeerNotifyEvents - { - public override int Constructor - { - get - { - return -1378534221; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLPeerNotifySettings.cs b/src/TeleSharp.TL/TL/TLPeerNotifySettings.cs deleted file mode 100644 index 412a4b7..0000000 --- a/src/TeleSharp.TL/TL/TLPeerNotifySettings.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -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)] - public class TLPeerNotifySettings : TLAbsPeerNotifySettings - { - public override int Constructor - { - get - { - return -1697798976; - } - } - - public int Flags { get; set; } - public bool ShowPreviews { get; set; } - public bool Silent { get; set; } - public int MuteUntil { get; set; } - public string Sound { get; set; } - - - public void ComputeFlags() - { - Flags = 0; - Flags = ShowPreviews ? (Flags | 1) : (Flags & ~1); - Flags = Silent ? (Flags | 2) : (Flags & ~2); - - } - - public override void DeserializeBody(BinaryReader br) - { - Flags = br.ReadInt32(); - ShowPreviews = (Flags & 1) != 0; - Silent = (Flags & 2) != 0; - MuteUntil = br.ReadInt32(); - Sound = StringUtil.Deserialize(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); - - - bw.Write(MuteUntil); - StringUtil.Serialize(Sound, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs b/src/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs deleted file mode 100644 index d3e028f..0000000 --- a/src/TeleSharp.TL/TL/TLPeerNotifySettingsEmpty.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -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)] - public class TLPeerNotifySettingsEmpty : TLAbsPeerNotifySettings - { - public override int Constructor - { - get - { - return 1889961234; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLUpdateContactLink.cs b/src/TeleSharp.TL/TL/TLUpdateContactLink.cs deleted file mode 100644 index bba7e0b..0000000 --- a/src/TeleSharp.TL/TL/TLUpdateContactLink.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -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)] - public class TLUpdateContactLink : TLAbsUpdate - { - public override int Constructor - { - get - { - return -1657903163; - } - } - - public int UserId { get; set; } - public TLAbsContactLink MyLink { get; set; } - public TLAbsContactLink ForeignLink { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - UserId = br.ReadInt32(); - MyLink = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); - ForeignLink = (TLAbsContactLink)ObjectUtils.DeserializeObject(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - bw.Write(UserId); - ObjectUtils.SerializeObject(MyLink, bw); - ObjectUtils.SerializeObject(ForeignLink, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLUpdateContactRegistered.cs b/src/TeleSharp.TL/TL/TLUpdateContactRegistered.cs deleted file mode 100644 index 5cc83f7..0000000 --- a/src/TeleSharp.TL/TL/TLUpdateContactRegistered.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -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)] - public class TLUpdateContactRegistered : TLAbsUpdate - { - public override int Constructor - { - get - { - return 628472761; - } - } - - public int UserId { get; set; } - public int Date { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - UserId = br.ReadInt32(); - Date = br.ReadInt32(); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - bw.Write(UserId); - bw.Write(Date); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs b/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs deleted file mode 100644 index a6a774e..0000000 --- a/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -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)] - public class TLUserProfilePhoto : TLAbsUserProfilePhoto - { - public override int Constructor - { - get - { - return -715532088; - } - } - - public long PhotoId { get; set; } - public TLAbsFileLocation PhotoSmall { get; set; } - public TLAbsFileLocation PhotoBig { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - PhotoId = br.ReadInt64(); - PhotoSmall = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); - PhotoBig = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - bw.Write(PhotoId); - ObjectUtils.SerializeObject(PhotoSmall, bw); - ObjectUtils.SerializeObject(PhotoBig, bw); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLVector.cs b/src/TeleSharp.TL/TL/TLVector.cs deleted file mode 100644 index 562ceb0..0000000 --- a/src/TeleSharp.TL/TL/TLVector.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL -{ - [TLObject(481674261)] - public class TLVector : TLObject - { - public override int Constructor - { - get - { - return 481674261; - } - } - - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLWallPaper.cs b/src/TeleSharp.TL/TL/TLWallPaper.cs deleted file mode 100644 index ece244d..0000000 --- a/src/TeleSharp.TL/TL/TLWallPaper.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -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)] - public class TLWallPaper : TLAbsWallPaper - { - public override int Constructor - { - 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(); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - bw.Write(Id); - StringUtil.Serialize(Title, bw); - ObjectUtils.SerializeObject(Sizes, bw); - bw.Write(Color); - - } - } -} diff --git a/src/TeleSharp.TL/TL/TLWallPaperSolid.cs b/src/TeleSharp.TL/TL/TLWallPaperSolid.cs deleted file mode 100644 index 3ddfda0..0000000 --- a/src/TeleSharp.TL/TL/TLWallPaperSolid.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -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)] - public class TLWallPaperSolid : TLAbsWallPaper - { - public override int Constructor - { - get - { - return 1662091044; - } - } - - public int Id { get; set; } - public string Title { get; set; } - public int BgColor { get; set; } - public int Color { get; set; } - - - public void ComputeFlags() - { - - } - - public override void DeserializeBody(BinaryReader br) - { - Id = br.ReadInt32(); - Title = StringUtil.Deserialize(br); - BgColor = br.ReadInt32(); - Color = br.ReadInt32(); - - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - bw.Write(Id); - StringUtil.Serialize(Title, bw); - bw.Write(BgColor); - bw.Write(Color); - - } - } -} diff --git a/src/TgSharp.Core/Network/MtProtoSender.cs b/src/TgSharp.Core/Network/MtProtoSender.cs index 54da05b..4a27da5 100644 --- a/src/TgSharp.Core/Network/MtProtoSender.cs +++ b/src/TgSharp.Core/Network/MtProtoSender.cs @@ -7,7 +7,8 @@ using System.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using TeleSharp.TL; + +using TgSharp.TL; using TgSharp.Core.Exceptions; using TgSharp.Core.MTProto; using TgSharp.Core.MTProto.Crypto; @@ -37,7 +38,7 @@ namespace TgSharp.Core.Network return confirmed ? session.Sequence++ * 2 + 1 : session.Sequence * 2; } - public async Task Send(TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken)) + public async Task Send(TLMethod request, CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); @@ -65,7 +66,7 @@ namespace TgSharp.Core.Network session.Save(); } - public async Task Send(byte[] packet, TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken)) + public async Task Send(byte[] packet, TLMethod request, CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); @@ -134,7 +135,7 @@ namespace TgSharp.Core.Network return new Tuple(message, remoteMessageId, remoteSequence); } - public async Task Receive(TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken)) + public async Task Receive(TLMethod request, CancellationToken token = default(CancellationToken)) { while (!request.ConfirmReceived) { @@ -270,7 +271,7 @@ namespace TgSharp.Core.Network return true; } - private bool HandleRpcResult(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) + private bool HandleRpcResult(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) { uint code = messageReader.ReadUInt32(); ulong requestId = messageReader.ReadUInt64(); @@ -492,7 +493,7 @@ namespace TgSharp.Core.Network return true; } - private bool HandlePong(ulong messageId, int sequence, BinaryReader messageReader, TeleSharp.TL.TLMethod request) + private bool HandlePong(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request) { uint code = messageReader.ReadUInt32(); ulong msgId = messageReader.ReadUInt64(); diff --git a/src/TgSharp.Core/Network/Requests/AckRequest.cs b/src/TgSharp.Core/Network/Requests/AckRequest.cs index 3a2a6dc..c45e49c 100644 --- a/src/TgSharp.Core/Network/Requests/AckRequest.cs +++ b/src/TgSharp.Core/Network/Requests/AckRequest.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; using System.IO; -using TeleSharp.TL; + +using TgSharp.TL; namespace TgSharp.Core.Network.Requests { diff --git a/src/TgSharp.Core/Network/Requests/PingRequest.cs b/src/TgSharp.Core/Network/Requests/PingRequest.cs index ae4385d..fe5d468 100644 --- a/src/TgSharp.Core/Network/Requests/PingRequest.cs +++ b/src/TgSharp.Core/Network/Requests/PingRequest.cs @@ -1,6 +1,7 @@ using System; using System.IO; -using TeleSharp.TL; + +using TgSharp.TL; using TgSharp.Core.Utils; namespace TgSharp.Core.Network.Requests diff --git a/src/TgSharp.Core/Session.cs b/src/TgSharp.Core/Session.cs index 1d6d3f0..9e19ad9 100644 --- a/src/TgSharp.Core/Session.cs +++ b/src/TgSharp.Core/Session.cs @@ -1,6 +1,7 @@ using System; using System.IO; -using TeleSharp.TL; + +using TgSharp.TL; using TgSharp.Core.MTProto; using TgSharp.Core.MTProto.Crypto; diff --git a/src/TgSharp.Core/TelegramClient.cs b/src/TgSharp.Core/TelegramClient.cs index b078ada..8dec139 100644 --- a/src/TgSharp.Core/TelegramClient.cs +++ b/src/TgSharp.Core/TelegramClient.cs @@ -5,20 +5,21 @@ using System.Security.Cryptography; using System.Text; using System.Threading; using System.Threading.Tasks; -using TeleSharp.TL; -using TeleSharp.TL.Account; -using TeleSharp.TL.Auth; -using TeleSharp.TL.Contacts; -using TeleSharp.TL.Help; -using TeleSharp.TL.Messages; -using TeleSharp.TL.Upload; + +using TgSharp.TL; +using TgSharp.TL.Account; +using TgSharp.TL.Auth; +using TgSharp.TL.Contacts; +using TgSharp.TL.Help; +using TgSharp.TL.Messages; +using TgSharp.TL.Upload; using TgSharp.Core.Auth; using TgSharp.Core.Exceptions; using TgSharp.Core.MTProto.Crypto; using TgSharp.Core.Network; using TgSharp.Core.Network.Exceptions; using TgSharp.Core.Utils; -using TLAuthorization = TeleSharp.TL.Auth.TLAuthorization; +using TLAuthorization = TgSharp.TL.Auth.TLAuthorization; namespace TgSharp.Core { @@ -100,9 +101,11 @@ namespace TgSharp.Core DeviceModel = "PC", LangCode = "en", Query = config, - SystemVersion = "Win 10.0" + SystemVersion = "Win 10.0", + SystemLangCode = "en", + LangPack = "" }; - var invokewithLayer = new TLRequestInvokeWithLayer() { Layer = 66, Query = request }; + var invokewithLayer = new TLRequestInvokeWithLayer() { Layer = 108, Query = request }; await sender.Send(invokewithLayer, token).ConfigureAwait(false); await sender.Receive(invokewithLayer, token).ConfigureAwait(false); @@ -164,7 +167,7 @@ namespace TgSharp.Core throw new InvalidOperationException("Not connected!"); var completed = false; - while(!completed) + while (!completed) { try { @@ -172,7 +175,7 @@ namespace TgSharp.Core await sender.Receive(request, token).ConfigureAwait(false); completed = true; } - catch(DataCenterMigrationException e) + catch (DataCenterMigrationException e) { if (session.DataCenter.DataCenterId.HasValue && session.DataCenter.DataCenterId.Value == e.DC) @@ -192,31 +195,19 @@ namespace TgSharp.Core return session.TLUser != null; } - public async Task IsPhoneRegisteredAsync(string phoneNumber, CancellationToken token = default(CancellationToken)) - { - if (String.IsNullOrWhiteSpace(phoneNumber)) - throw new ArgumentNullException(nameof(phoneNumber)); - - var authCheckPhoneRequest = new TLRequestCheckPhone() { PhoneNumber = phoneNumber }; - - await RequestWithDcMigration(authCheckPhoneRequest, token).ConfigureAwait(false); - - return authCheckPhoneRequest.Response.PhoneRegistered; - } - public async Task SendCodeRequestAsync(string phoneNumber, CancellationToken token = default(CancellationToken)) { if (String.IsNullOrWhiteSpace(phoneNumber)) throw new ArgumentNullException(nameof(phoneNumber)); - var request = new TLRequestSendCode() { PhoneNumber = phoneNumber, ApiId = apiId, ApiHash = apiHash }; + var request = new TLRequestSendCode() { PhoneNumber = phoneNumber, ApiId = apiId, ApiHash = apiHash, Settings = new TLCodeSettings { } }; await RequestWithDcMigration(request, token).ConfigureAwait(false); return request.Response.PhoneCodeHash; } - public async Task MakeAuthAsync(string phoneNumber, string phoneCodeHash, string code, CancellationToken token = default(CancellationToken)) + public async Task MakeAuthAsync(string phoneNumber, string phoneCodeHash, string code, string firstName = "", string lastName = "", CancellationToken token = default(CancellationToken)) { if (String.IsNullOrWhiteSpace(phoneNumber)) throw new ArgumentNullException(nameof(phoneNumber)); @@ -226,53 +217,23 @@ namespace TgSharp.Core if (String.IsNullOrWhiteSpace(code)) throw new ArgumentNullException(nameof(code)); - + var request = new TLRequestSignIn() { PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash, PhoneCode = code }; await RequestWithDcMigration(request, token).ConfigureAwait(false); - OnUserAuthenticated(((TLUser)request.Response.User)); - - return ((TLUser)request.Response.User); - } - - public async Task GetPasswordSetting(CancellationToken token = default(CancellationToken)) - { - var request = new TLRequestGetPassword(); - - await RequestWithDcMigration(request, token).ConfigureAwait(false); - - return (TLPassword)request.Response; - } - - public async Task MakeAuthWithPasswordAsync(TLPassword password, string password_str, CancellationToken token = default(CancellationToken)) - { - token.ThrowIfCancellationRequested(); - - byte[] password_Bytes = Encoding.UTF8.GetBytes(password_str); - IEnumerable rv = password.CurrentSalt.Concat(password_Bytes).Concat(password.CurrentSalt); - - SHA256Managed hashstring = new SHA256Managed(); - var password_hash = hashstring.ComputeHash(rv.ToArray()); - - var request = new TLRequestCheckPassword() { PasswordHash = password_hash }; - - await RequestWithDcMigration(request, token).ConfigureAwait(false); - - OnUserAuthenticated((TLUser)request.Response.User); - - return (TLUser)request.Response.User; - } - - public async Task SignUpAsync(string phoneNumber, string phoneCodeHash, string code, string firstName, string lastName, CancellationToken token = default(CancellationToken)) - { - var request = new TLRequestSignUp() { PhoneNumber = phoneNumber, PhoneCode = code, PhoneCodeHash = phoneCodeHash, FirstName = firstName, LastName = lastName }; - - await RequestWithDcMigration(request, token).ConfigureAwait(false); - - OnUserAuthenticated((TLUser)request.Response.User); - - return (TLUser)request.Response.User; + if (request.Response is TLAuthorization) + { + OnUserAuthenticated(((TLUser)((TLAuthorization)request.Response).User)); + return ((TLUser)((TLAuthorization)request.Response).User); + } + else + { + var signUpRequest = new TLRequestSignUp() { PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash, FirstName = firstName, LastName = lastName }; + await RequestWithDcMigration(signUpRequest, token).ConfigureAwait(false); + OnUserAuthenticated((TLUser)signUpRequest.Response.User); + return (TLUser)signUpRequest.Response.User; + } } public async Task SendRequestAsync(TLMethod methodToExecute, CancellationToken token = default(CancellationToken)) @@ -284,7 +245,7 @@ namespace TgSharp.Core return (T)result; } - internal async Task SendAuthenticatedRequestAsync (TLMethod methodToExecute, CancellationToken token = default(CancellationToken)) + internal async Task SendAuthenticatedRequestAsync(TLMethod methodToExecute, CancellationToken token = default(CancellationToken)) { if (!IsUserAuthorized()) throw new InvalidOperationException("Authorize user first!"); @@ -311,7 +272,7 @@ namespace TgSharp.Core public async Task ImportContactsAsync(IReadOnlyList contacts, CancellationToken token = default(CancellationToken)) { - var req = new TLRequestImportContacts { Contacts = new TLVector(contacts)}; + var req = new TLRequestImportContacts { Contacts = new TLVector(contacts) }; return await SendAuthenticatedRequestAsync(req, token) .ConfigureAwait(false); @@ -319,23 +280,15 @@ namespace TgSharp.Core public async Task DeleteContactsAsync(IReadOnlyList users, CancellationToken token = default(CancellationToken)) { - var req = new TLRequestDeleteContacts {Id = new TLVector(users)}; + var req = new TLRequestDeleteContacts { Id = new TLVector(users) }; return await SendAuthenticatedRequestAsync(req, token) .ConfigureAwait(false); } - public async Task DeleteContactAsync(TLAbsInputUser user, CancellationToken token = default(CancellationToken)) - { - var req = new TLRequestDeleteContact {Id = user}; - - return await SendAuthenticatedRequestAsync(req, token) - .ConfigureAwait(false); - } - public async Task GetContactsAsync(CancellationToken token = default(CancellationToken)) { - var req = new TLRequestGetContacts() { Hash = "" }; + var req = new TLRequestGetContacts() { Hash = 0 }; return await SendAuthenticatedRequestAsync(req, token) .ConfigureAwait(false); @@ -370,57 +323,56 @@ namespace TgSharp.Core offsetPeer = new TLInputPeerSelf(); var req = new TLRequestGetDialogs() - { - OffsetDate = offsetDate, - OffsetId = offsetId, - OffsetPeer = offsetPeer, + { + OffsetDate = offsetDate, + OffsetId = offsetId, + OffsetPeer = offsetPeer, Limit = limit }; return await SendAuthenticatedRequestAsync(req, token) .ConfigureAwait(false); } - public async Task SendUploadedPhoto(TLAbsInputPeer peer, TLAbsInputFile file, string caption, CancellationToken token = default(CancellationToken)) + public async Task SendUploadedPhoto(TLAbsInputPeer peer, TLAbsInputFile file, CancellationToken token = default(CancellationToken)) { return await SendAuthenticatedRequestAsync(new TLRequestSendMedia() - { - RandomId = Helpers.GenerateRandomLong(), - Background = false, - ClearDraft = false, - Media = new TLInputMediaUploadedPhoto() { File = file, Caption = caption }, - Peer = peer - }, token) + { + RandomId = Helpers.GenerateRandomLong(), + Background = false, + ClearDraft = false, + Media = new TLInputMediaUploadedPhoto() { File = file }, + Peer = peer + }, token) .ConfigureAwait(false); } public async Task SendUploadedDocument( - TLAbsInputPeer peer, TLAbsInputFile file, string caption, string mimeType, TLVector attributes, CancellationToken token = default(CancellationToken)) + TLAbsInputPeer peer, TLAbsInputFile file, string mimeType, TLVector attributes, CancellationToken token = default(CancellationToken)) { return await SendAuthenticatedRequestAsync(new TLRequestSendMedia() + { + RandomId = Helpers.GenerateRandomLong(), + Background = false, + ClearDraft = false, + Media = new TLInputMediaUploadedDocument() { - RandomId = Helpers.GenerateRandomLong(), - Background = false, - ClearDraft = false, - Media = new TLInputMediaUploadedDocument() - { - File = file, - Caption = caption, - MimeType = mimeType, - Attributes = attributes - }, - Peer = peer - }, token) + File = file, + MimeType = mimeType, + Attributes = attributes + }, + Peer = peer + }, token) .ConfigureAwait(false); } public async Task GetFile(TLAbsInputFileLocation location, int filePartSize, int offset = 0, CancellationToken token = default(CancellationToken)) { TLFile result = await SendAuthenticatedRequestAsync(new TLRequestGetFile - { - Location = location, - Limit = filePartSize, - Offset = offset - }, token) + { + Location = location, + Limit = filePartSize, + Offset = offset + }, token) .ConfigureAwait(false); return result; } @@ -455,7 +407,7 @@ namespace TgSharp.Core /// public async Task SearchUserAsync(string q, int limit = 10, CancellationToken token = default(CancellationToken)) { - var r = new TeleSharp.TL.Contacts.TLRequestSearch + var r = new TL.Contacts.TLRequestSearch { Q = q, Limit = limit diff --git a/src/TgSharp.Core/TgSharp.Core.csproj b/src/TgSharp.Core/TgSharp.Core.csproj index da7dd3f..18d23a7 100644 --- a/src/TgSharp.Core/TgSharp.Core.csproj +++ b/src/TgSharp.Core/TgSharp.Core.csproj @@ -81,7 +81,7 @@ - + {d6144517-91d2-4880-86df-e9ff5d7f383a} TeleSharp.TL diff --git a/src/TgSharp.Core/TgSharp.Core.nuspec b/src/TgSharp.Core/TgSharp.Core.nuspec index 62e7d62..6116666 100644 --- a/src/TgSharp.Core/TgSharp.Core.nuspec +++ b/src/TgSharp.Core/TgSharp.Core.nuspec @@ -15,6 +15,6 @@ It's a perfect fit for any developer who would like to send data directly to Tel Copyright 2015-2020 - + diff --git a/src/TgSharp.Core/Utils/UploadHelper.cs b/src/TgSharp.Core/Utils/UploadHelper.cs index d317ed1..6969ccc 100644 --- a/src/TgSharp.Core/Utils/UploadHelper.cs +++ b/src/TgSharp.Core/Utils/UploadHelper.cs @@ -6,8 +6,9 @@ using System.Security.Cryptography; using System.Text; using System.Threading; using System.Threading.Tasks; -using TeleSharp.TL; -using TeleSharp.TL.Upload; + +using TgSharp.TL; +using TgSharp.TL.Upload; namespace TgSharp.Core.Utils { diff --git a/src/TeleSharp.Generator/App.config b/src/TgSharp.Generator/App.config similarity index 100% rename from src/TeleSharp.Generator/App.config rename to src/TgSharp.Generator/App.config diff --git a/src/TeleSharp.Generator/Constructor.tmp b/src/TgSharp.Generator/Constructor.tmp similarity index 78% rename from src/TeleSharp.Generator/Constructor.tmp rename to src/TgSharp.Generator/Constructor.tmp index 73bf205..a8d85c3 100644 --- a/src/TeleSharp.Generator/Constructor.tmp +++ b/src/TgSharp.Generator/Constructor.tmp @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; + +using TgSharp.TL; + namespace /* NAMESPACE */ { - [TLObject(/*Constructor*/)] + [TLObject(/*Constructor*/)] public class /* NAME */ : /* PARENT */ { public override int Constructor @@ -20,10 +22,10 @@ namespace /* NAMESPACE */ /* PARAMS */ - public void ComputeFlags() - { - /* COMPUTE */ - } + public void ComputeFlags() + { + /* COMPUTE */ + } public override void DeserializeBody(BinaryReader br) { @@ -32,7 +34,7 @@ namespace /* NAMESPACE */ public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); /* SERIALIZE */ } } diff --git a/src/TeleSharp.Generator/ConstructorAbs.tmp b/src/TgSharp.Generator/ConstructorAbs.tmp similarity index 91% rename from src/TeleSharp.Generator/ConstructorAbs.tmp rename to src/TgSharp.Generator/ConstructorAbs.tmp index 8a6dd2c..7e1b12c 100644 --- a/src/TeleSharp.Generator/ConstructorAbs.tmp +++ b/src/TgSharp.Generator/ConstructorAbs.tmp @@ -4,7 +4,9 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; + +using TgSharp.TL; + namespace /* NAMESPACE */ { public abstract class /* NAME */ : TLObject diff --git a/src/TeleSharp.Generator/Method.tmp b/src/TgSharp.Generator/Method.tmp similarity index 67% rename from src/TeleSharp.Generator/Method.tmp rename to src/TgSharp.Generator/Method.tmp index d370dd1..0065ff5 100644 --- a/src/TeleSharp.Generator/Method.tmp +++ b/src/TgSharp.Generator/Method.tmp @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; + +using TgSharp.TL; + namespace /* NAMESPACE */ { - [TLObject(/*Constructor*/)] + [TLObject(/*Constructor*/)] public class /* NAME */ : /* PARENT */ { public override int Constructor @@ -20,10 +22,10 @@ namespace /* NAMESPACE */ /* PARAMS */ - public void ComputeFlags() - { - /* COMPUTE */ - } + public void ComputeFlags() + { + /* COMPUTE */ + } public override void DeserializeBody(BinaryReader br) { @@ -32,12 +34,13 @@ namespace /* NAMESPACE */ public override void SerializeBody(BinaryWriter bw) { - bw.Write(Constructor); + bw.Write(Constructor); /* SERIALIZE */ } - public override void DeserializeResponse(BinaryReader br) - { - /* DESERIALIZEResp */ - } + + public override void DeserializeResponse(BinaryReader br) + { + /* DESERIALIZEResp */ + } } } diff --git a/src/TeleSharp.Generator/Models/TlConstructor.cs b/src/TgSharp.Generator/Models/Constructor.cs similarity index 73% rename from src/TeleSharp.Generator/Models/TlConstructor.cs rename to src/TgSharp.Generator/Models/Constructor.cs index 9c0ee4e..f1b8058 100644 --- a/src/TeleSharp.Generator/Models/TlConstructor.cs +++ b/src/TgSharp.Generator/Models/Constructor.cs @@ -1,9 +1,10 @@ using System.Collections.Generic; + using Newtonsoft.Json; -namespace TeleSharp.Generator.Models +namespace TgSharp.Generator.Models { - internal class TlConstructor + internal class Constructor { [JsonProperty("id")] public int Id { get; set; } @@ -12,7 +13,7 @@ namespace TeleSharp.Generator.Models public string Predicate { get; set; } [JsonProperty("params")] - public List Params { get; set; } + public List Params { get; set; } [JsonProperty("type")] public string Type { get; set; } diff --git a/src/TeleSharp.Generator/Models/TlMethod.cs b/src/TgSharp.Generator/Models/Function.cs similarity index 63% rename from src/TeleSharp.Generator/Models/TlMethod.cs rename to src/TgSharp.Generator/Models/Function.cs index a1e4b66..64588a4 100644 --- a/src/TeleSharp.Generator/Models/TlMethod.cs +++ b/src/TgSharp.Generator/Models/Function.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; + using Newtonsoft.Json; -namespace TeleSharp.Generator.Models +namespace TgSharp.Generator.Models { - internal class TlMethod + //called 'Function' because C# compiler doesn't let a property name == class + internal class Function { [JsonProperty("id")] public int Id { get; set; } @@ -12,7 +14,7 @@ namespace TeleSharp.Generator.Models public string Method { get; set; } [JsonProperty("params")] - public List Params { get; set; } + public List Params { get; set; } [JsonProperty("type")] public string Type { get; set; } diff --git a/src/TeleSharp.Generator/Models/TlParam.cs b/src/TgSharp.Generator/Models/Param.cs similarity index 74% rename from src/TeleSharp.Generator/Models/TlParam.cs rename to src/TgSharp.Generator/Models/Param.cs index 8cae783..a919935 100644 --- a/src/TeleSharp.Generator/Models/TlParam.cs +++ b/src/TgSharp.Generator/Models/Param.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace TeleSharp.Generator.Models +namespace TgSharp.Generator.Models { - internal class TlParam + internal class Param { [JsonProperty("name")] public string Name { get; set; } diff --git a/src/TgSharp.Generator/Models/Schema.cs b/src/TgSharp.Generator/Models/Schema.cs new file mode 100644 index 0000000..f21431c --- /dev/null +++ b/src/TgSharp.Generator/Models/Schema.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace TgSharp.Generator.Models +{ + internal class Schema + { + [JsonProperty("constructors")] + public List Constructors { get; set; } + + [JsonProperty("methods")] + public List Methods { get; set; } + } +} \ No newline at end of file diff --git a/src/TeleSharp.Generator/Program.cs b/src/TgSharp.Generator/Program.cs similarity index 78% rename from src/TeleSharp.Generator/Program.cs rename to src/TgSharp.Generator/Program.cs index 426566a..278d4ce 100644 --- a/src/TeleSharp.Generator/Program.cs +++ b/src/TgSharp.Generator/Program.cs @@ -3,9 +3,10 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using TeleSharp.Generator.Models; -namespace TeleSharp.Generator +using TgSharp.Generator.Models; + +namespace TgSharp.Generator { class Program { @@ -17,6 +18,8 @@ namespace TeleSharp.Generator static string constructorTemplate = "Constructor.tmp"; static string methodTemplate = "Method.tmp"; + static string rootNamespace = "TgSharp"; + static List templateFiles = new List (new [] { constructorAbsTemplate, constructorTemplate, @@ -88,7 +91,7 @@ namespace TeleSharp.Generator } FileStream file = File.OpenWrite("Result.cs"); StreamWriter sw = new StreamWriter(file); - TlSchema schema = JsonConvert.DeserializeObject(Json); + Schema schema = JsonConvert.DeserializeObject(Json); foreach (var c in schema.Constructors) { interfacesList.Add(c.Type); @@ -101,7 +104,7 @@ namespace TeleSharp.Generator { string path = (GetNameSpace(c.Type) - .Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar) + .Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar) .Replace(".", "") + Path.DirectorySeparatorChar + GetNameofClass(c.Type, true) + ".cs") .Replace("\\\\", Path.DirectorySeparatorChar.ToString()); @@ -110,13 +113,13 @@ namespace TeleSharp.Generator { string nspace = (GetNameSpace(c.Type) - .Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar) + .Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar) .Replace(".", "")) .Replace("\\\\", Path.DirectorySeparatorChar.ToString()) .Replace(Path.DirectorySeparatorChar, '.'); if (nspace.EndsWith(".")) nspace = nspace.Remove(nspace.Length - 1, 1); - string temp = absStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); + string temp = absStyle.Replace("/* NAMESPACE */", rootNamespace + "." + nspace); temp = temp.Replace("/* NAME */", GetNameofClass(c.Type, true)); writer.Write(temp); writer.Close(); @@ -133,7 +136,7 @@ namespace TeleSharp.Generator { string path = (GetNameSpace(c.Predicate) - .Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar) + .Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar) .Replace(".", "") + Path.DirectorySeparatorChar + GetNameofClass(c.Predicate, false) + ".cs") .Replace("\\\\", Path.DirectorySeparatorChar.ToString()); @@ -143,27 +146,35 @@ namespace TeleSharp.Generator #region About Class string nspace = (GetNameSpace(c.Predicate) - .Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar) + .Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar) .Replace(".", "")) .Replace("\\\\", Path.DirectorySeparatorChar.ToString()) .Replace(Path.DirectorySeparatorChar, '.'); if (nspace.EndsWith(".")) nspace = nspace.Remove(nspace.Length - 1, 1); - string temp = normalStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); + string temp = normalStyle.Replace("/* NAMESPACE */", rootNamespace + "." + 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 = ""; + string fields = String.Empty; + bool first = true; foreach (var tmp in c.Params) { - fields += $" public {CheckForFlagBase(tmp.Type, GetTypeName(tmp.Type))} {CheckForKeywordAndPascalCase(tmp.Name)} " + "{get;set;}" + Environment.NewLine; + if (!first) { + fields += Environment.NewLine + " "; + } else { + first = false; + } + fields += $"public {CheckForFlagBase (tmp.Type, GetTypeName (tmp.Type))} {CheckForKeywordAndPascalCase (tmp.Name)}" + " { get; set; }"; } + if (fields == String.Empty) + fields = "// no fields"; 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 */", "// do nothing"); else { var compute = "Flags = 0;" + Environment.NewLine; @@ -182,22 +193,45 @@ namespace TeleSharp.Generator } #endregion #region SerializeFunc - var serialize = ""; - - if (c.Params.Any(x => x.Name == "Flags")) serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(Flags);" + Environment.NewLine; + var serialize = String.Empty; + first = true; + if (c.Params.Any (x => x.Name == "Flags")) { + serialize += "ComputeFlags();" + + Environment.NewLine + " " + + "bw.Write(Flags);"; + first = false; + } foreach (var p in c.Params.Where(x => x.Name != "Flags")) { - serialize += WriteWriteCode(p) + Environment.NewLine; + var code = WriteWriteCode (p); + if (String.IsNullOrEmpty(code)) + continue; + + if (!first) { + serialize += Environment.NewLine + " "; + } else { + first = false; + } + serialize += code; } + if (serialize == String.Empty) + serialize = "// do nothing"; temp = temp.Replace("/* SERIALIZE */", serialize); #endregion #region DeSerializeFunc - var deserialize = ""; - + var deserialize = String.Empty; + first = true; foreach (var p in c.Params) { - deserialize += WriteReadCode(p) + Environment.NewLine; + if (!first) { + deserialize += Environment.NewLine + " "; + } else { + first = false; + } + deserialize += WriteReadCode(p); } + if (deserialize == String.Empty) + deserialize = "// do nothing"; temp = temp.Replace("/* DESERIALIZE */", deserialize); #endregion writer.Write(temp); @@ -209,7 +243,7 @@ namespace TeleSharp.Generator { string path = (GetNameSpace(c.Method) - .Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar) + .Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar) .Replace(".", "") + Path.DirectorySeparatorChar + GetNameofClass(c.Method, false, true) + ".cs") .Replace("\\\\", Path.DirectorySeparatorChar.ToString()); @@ -219,28 +253,39 @@ namespace TeleSharp.Generator #region About Class string nspace = (GetNameSpace(c.Method) - .Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar) + .Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar) .Replace(".", "")) .Replace("\\\\", Path.DirectorySeparatorChar.ToString()) .Replace(Path.DirectorySeparatorChar, '.'); if (nspace.EndsWith(".")) nspace = nspace.Remove(nspace.Length - 1, 1); - string temp = methodStyle.Replace("/* NAMESPACE */", "TeleSharp." + nspace); + string temp = methodStyle.Replace("/* NAMESPACE */", rootNamespace + "." + 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 = ""; + bool first = true; foreach (var tmp in c.Params) { - fields += $" public {CheckForFlagBase(tmp.Type, GetTypeName(tmp.Type))} {CheckForKeywordAndPascalCase(tmp.Name)} " + "{get;set;}" + Environment.NewLine; + if (!first) { + fields += Environment.NewLine + " "; + } else { + first = false; + } + fields += $"public {CheckForFlagBase(tmp.Type, GetTypeName(tmp.Type))} {CheckForKeywordAndPascalCase(tmp.Name)}" + " { get; set; }"; } - fields += $" public {CheckForFlagBase(c.Type, GetTypeName(c.Type))} Response" + "{ get; set;}" + Environment.NewLine; + if (!first) { + fields += Environment.NewLine + " "; + } else { + first = false; + } + fields += $"public {CheckForFlagBase(c.Type, GetTypeName(c.Type))} Response" + " { get; set; }"; 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 */", "// do nothing"); else { var compute = "Flags = 0;" + Environment.NewLine; @@ -259,28 +304,50 @@ namespace TeleSharp.Generator } #endregion #region SerializeFunc - var serialize = ""; - - if (c.Params.Any(x => x.Name == "Flags")) serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(Flags);" + Environment.NewLine; + var serialize = String.Empty; + first = true; + if (c.Params.Any (x => x.Name == "Flags")) { + serialize += "ComputeFlags();" + Environment.NewLine + + " " + "bw.Write(Flags);"; + first = false; + } foreach (var p in c.Params.Where(x => x.Name != "Flags")) { - serialize += WriteWriteCode(p) + Environment.NewLine; + var code = WriteWriteCode (p); + if (String.IsNullOrEmpty (code)) + continue; + + if (!first) { + serialize += Environment.NewLine + " "; + } else { + first = false; + } + serialize += code; } + if (serialize == String.Empty) + serialize = "// do nothing else"; temp = temp.Replace("/* SERIALIZE */", serialize); #endregion #region DeSerializeFunc - var deserialize = ""; - + var deserialize = String.Empty; + first = true; foreach (var p in c.Params) { - deserialize += WriteReadCode(p) + Environment.NewLine; + if (!first) { + deserialize += Environment.NewLine + " "; + } else { + first = false; + } + deserialize += WriteReadCode (p); } + if (deserialize == String.Empty) + deserialize = "// do nothing"; temp = temp.Replace("/* DESERIALIZE */", deserialize); #endregion #region DeSerializeRespFunc var deserializeResp = ""; - TlParam p2 = new TlParam() { Name = "Response", Type = c.Type }; - deserializeResp += WriteReadCode(p2) + Environment.NewLine; + var p2 = new Param() { Name = "Response", Type = c.Type }; + deserializeResp += WriteReadCode(p2); temp = temp.Replace("/* DESERIALIZEResp */", deserializeResp); #endregion writer.Write(temp); @@ -289,6 +356,7 @@ namespace TeleSharp.Generator } } } + public static string FormatName(string input) { if (string.IsNullOrEmpty(input)) @@ -305,6 +373,7 @@ namespace TeleSharp.Generator } return input.First().ToString().ToUpper() + input.Substring(1); } + public static string CheckForKeywordAndPascalCase(string name) { name = name.Replace("_", " "); @@ -314,6 +383,7 @@ namespace TeleSharp.Generator if (keywords.Contains(name)) return "@" + name; return name; } + public static string GetNameofClass(string type, bool isinterface = false, bool ismethod = false) { if (!ismethod) @@ -335,25 +405,31 @@ namespace TeleSharp.Generator 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])); } + private static bool IsTrueFlag(string type) { return type.Split('?')[1] == "true"; } + public static string GetNameSpace(string type) { + var baseNamespace = rootNamespace + ".TL"; if (type.IndexOf('.') != -1) - return "TeleSharp.TL" + FormatName(type.Split('.')[0]); + return baseNamespace + FormatName(type.Split('.')[0]); else - return "TeleSharp.TL"; + return baseNamespace; } + public static string CheckForFlagBase(string type, string result) { if (type.IndexOf('?') == -1) @@ -366,6 +442,7 @@ namespace TeleSharp.Generator else return result; } } + public static string GetTypeName(string type) { switch (type.ToLower()) @@ -401,7 +478,6 @@ namespace TeleSharp.Generator if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1) { - 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())) @@ -422,9 +498,8 @@ namespace TeleSharp.Generator { return GetTypeName(type.Split('?')[1]); } - - } + public static string LookTypeInLists(string src) { if (interfacesList.Any(x => x.ToLower() == src.ToLower())) @@ -434,7 +509,8 @@ namespace TeleSharp.Generator else return src; } - public static string WriteWriteCode(TlParam p, bool flag = false) + + public static string WriteWriteCode(Param p, bool flag = false) { switch (p.Type.ToLower()) { @@ -444,32 +520,33 @@ namespace TeleSharp.Generator case "long": return flag ? $"bw.Write({CheckForKeywordAndPascalCase(p.Name)}.Value);" : $"bw.Write({CheckForKeywordAndPascalCase(p.Name)});"; case "string": - return $"StringUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)},bw);"; + return $"StringUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)}, bw);"; case "bool": - return flag ? $"BoolUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)}.Value,bw);" : $"BoolUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)},bw);"; + return flag ? $"BoolUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)}.Value, bw);" : $"BoolUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)}, bw);"; case "true": - return $"BoolUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)},bw);"; + return $"BoolUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)}, bw);"; case "bytes": - return $"BytesUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)},bw);"; + return $"BytesUtil.Serialize({CheckForKeywordAndPascalCase(p.Name)}, bw);"; case "double": return flag ? $"bw.Write({CheckForKeywordAndPascalCase(p.Name)}.Value);" : $"bw.Write({CheckForKeywordAndPascalCase(p.Name)});"; default: if (!IsFlagBase(p.Type)) - return $"ObjectUtils.SerializeObject({CheckForKeywordAndPascalCase(p.Name)},bw);"; + return $"ObjectUtils.SerializeObject({CheckForKeywordAndPascalCase(p.Name)}, bw);"; else { if (IsTrueFlag(p.Type)) return $""; else { - TlParam p2 = new TlParam() { Name = p.Name, Type = p.Type.Split('?')[1] }; - return $"if ((Flags & {GetBitMask(p.Type).ToString()}) != 0)" + Environment.NewLine + + 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); } } } } - public static string WriteReadCode(TlParam p) + public static string WriteReadCode(Param p) { switch (p.Type.ToLower()) { @@ -502,10 +579,11 @@ namespace TeleSharp.Generator return $"{CheckForKeywordAndPascalCase(p.Name)} = (Flags & {GetBitMask(p.Type).ToString()}) != 0;"; else { - TlParam p2 = new TlParam() { 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 + + 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 + " " + $"{CheckForKeywordAndPascalCase(p.Name)} = null;" + Environment.NewLine; } } diff --git a/src/TeleSharp.Generator/Properties/AssemblyInfo.cs b/src/TgSharp.Generator/Properties/AssemblyInfo.cs similarity index 92% rename from src/TeleSharp.Generator/Properties/AssemblyInfo.cs rename to src/TgSharp.Generator/Properties/AssemblyInfo.cs index 7c4146a..57c37c7 100644 --- a/src/TeleSharp.Generator/Properties/AssemblyInfo.cs +++ b/src/TgSharp.Generator/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("TeleSharp.Generator")] +[assembly: AssemblyTitle("TgSharp.Generator")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TeleSharp.Generator")] +[assembly: AssemblyProduct("TgSharp.Generator")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/TeleSharp.Generator/TeleSharp.Generator.csproj b/src/TgSharp.Generator/TgSharp.Generator.csproj similarity index 91% rename from src/TeleSharp.Generator/TeleSharp.Generator.csproj rename to src/TgSharp.Generator/TgSharp.Generator.csproj index ec8fd85..1d651a5 100644 --- a/src/TeleSharp.Generator/TeleSharp.Generator.csproj +++ b/src/TgSharp.Generator/TgSharp.Generator.csproj @@ -7,8 +7,8 @@ {9BE3B9D4-9FF6-4DC8-B9CC-EB2E3F390129} Exe Properties - TeleSharp.Generator - TeleSharp.Generator + TgSharp.Generator + TgSharp.Generator v4.6 512 true @@ -48,12 +48,12 @@ - + - - - + + + diff --git a/src/TeleSharp.Generator/packages.config b/src/TgSharp.Generator/packages.config similarity index 100% rename from src/TeleSharp.Generator/packages.config rename to src/TgSharp.Generator/packages.config diff --git a/src/TeleSharp.TL/ObjectDeserializer.cs b/src/TgSharp.TL/ObjectDeserializer.cs similarity index 97% rename from src/TeleSharp.TL/ObjectDeserializer.cs rename to src/TgSharp.TL/ObjectDeserializer.cs index 524f72a..08d7b2b 100644 --- a/src/TeleSharp.TL/ObjectDeserializer.cs +++ b/src/TgSharp.TL/ObjectDeserializer.cs @@ -5,8 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL +namespace TgSharp.TL { public class ObjectUtils { diff --git a/src/TeleSharp.TL/Properties/AssemblyInfo.cs b/src/TgSharp.TL/Properties/AssemblyInfo.cs similarity index 93% rename from src/TeleSharp.TL/Properties/AssemblyInfo.cs rename to src/TgSharp.TL/Properties/AssemblyInfo.cs index 3ff3c97..b690d86 100644 --- a/src/TeleSharp.TL/Properties/AssemblyInfo.cs +++ b/src/TgSharp.TL/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("TeleSharp.TL")] +[assembly: AssemblyTitle("TgSharp.TL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TeleSharp.TL")] +[assembly: AssemblyProduct("TgSharp.TL")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/TeleSharp.TL/TL/TLAbsFileLocation.cs b/src/TgSharp.TL/TL/Account/TLAbsThemes.cs similarity index 60% rename from src/TeleSharp.TL/TL/TLAbsFileLocation.cs rename to src/TgSharp.TL/TL/Account/TLAbsThemes.cs index c813e5e..aee796b 100644 --- a/src/TeleSharp.TL/TL/TLAbsFileLocation.cs +++ b/src/TgSharp.TL/TL/Account/TLAbsThemes.cs @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - public abstract class TLAbsFileLocation : TLObject + public abstract class TLAbsThemes : TLObject { } } diff --git a/src/TeleSharp.TL/TL/Account/TLAbsPassword.cs b/src/TgSharp.TL/TL/Account/TLAbsWallPapers.cs similarity index 59% rename from src/TeleSharp.TL/TL/Account/TLAbsPassword.cs rename to src/TgSharp.TL/TL/Account/TLAbsWallPapers.cs index 9bfacaf..ba96ece 100644 --- a/src/TeleSharp.TL/TL/Account/TLAbsPassword.cs +++ b/src/TgSharp.TL/TL/Account/TLAbsWallPapers.cs @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - public abstract class TLAbsPassword : TLObject + public abstract class TLAbsWallPapers : TLObject { } } diff --git a/src/TgSharp.TL/TL/Account/TLAuthorizationForm.cs b/src/TgSharp.TL/TL/Account/TLAuthorizationForm.cs new file mode 100644 index 0000000..4c516e8 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLAuthorizationForm.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1389486888)] + public class TLAuthorizationForm : TLObject + { + public override int Constructor + { + get + { + return -1389486888; + } + } + + public int Flags { get; set; } + public TLVector RequiredTypes { get; set; } + public TLVector Values { get; set; } + public TLVector Errors { get; set; } + public TLVector Users { get; set; } + public string PrivacyPolicyUrl { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + RequiredTypes = (TLVector)ObjectUtils.DeserializeVector(br); + Values = (TLVector)ObjectUtils.DeserializeVector(br); + Errors = (TLVector)ObjectUtils.DeserializeVector(br); + Users = (TLVector)ObjectUtils.DeserializeVector(br); + if ((Flags & 1) != 0) + PrivacyPolicyUrl = StringUtil.Deserialize(br); + else + PrivacyPolicyUrl = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(RequiredTypes, bw); + ObjectUtils.SerializeObject(Values, bw); + ObjectUtils.SerializeObject(Errors, bw); + ObjectUtils.SerializeObject(Users, bw); + if ((Flags & 1) != 0) + StringUtil.Serialize(PrivacyPolicyUrl, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLAuthorizations.cs b/src/TgSharp.TL/TL/Account/TLAuthorizations.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLAuthorizations.cs rename to src/TgSharp.TL/TL/Account/TLAuthorizations.cs index 113f6bc..af03f69 100644 --- a/src/TeleSharp.TL/TL/Account/TLAuthorizations.cs +++ b/src/TgSharp.TL/TL/Account/TLAuthorizations.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(307276766)] public class TLAuthorizations : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Account public TLVector Authorizations { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Authorizations = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Authorizations, bw); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLAutoDownloadSettings.cs b/src/TgSharp.TL/TL/Account/TLAutoDownloadSettings.cs new file mode 100644 index 0000000..b4fcced --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLAutoDownloadSettings.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1674235686)] + public class TLAutoDownloadSettings : TLObject + { + public override int Constructor + { + get + { + return 1674235686; + } + } + + public TLAutoDownloadSettings Low { get; set; } + public TLAutoDownloadSettings Medium { get; set; } + public TLAutoDownloadSettings High { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Low = (TLAutoDownloadSettings)ObjectUtils.DeserializeObject(br); + Medium = (TLAutoDownloadSettings)ObjectUtils.DeserializeObject(br); + High = (TLAutoDownloadSettings)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Low, bw); + ObjectUtils.SerializeObject(Medium, bw); + ObjectUtils.SerializeObject(High, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPeerSettings.cs b/src/TgSharp.TL/TL/Account/TLContentSettings.cs similarity index 61% rename from src/TeleSharp.TL/TL/TLPeerSettings.cs rename to src/TgSharp.TL/TL/Account/TLContentSettings.cs index 05647c9..ad32276 100644 --- a/src/TeleSharp.TL/TL/TLPeerSettings.cs +++ b/src/TgSharp.TL/TL/Account/TLContentSettings.cs @@ -4,45 +4,42 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(-2122045747)] - public class TLPeerSettings : TLObject + [TLObject(1474462241)] + public class TLContentSettings : TLObject { public override int Constructor { get { - return -2122045747; + return 1474462241; } } public int Flags { get; set; } - public bool ReportSpam { get; set; } - + public bool SensitiveEnabled { get; set; } + public bool SensitiveCanChange { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = ReportSpam ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); - ReportSpam = (Flags & 1) != 0; - + SensitiveEnabled = (Flags & 1) != 0; + SensitiveCanChange = (Flags & 2) != 0; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - } } } diff --git a/src/TgSharp.TL/TL/Account/TLPassword.cs b/src/TgSharp.TL/TL/Account/TLPassword.cs new file mode 100644 index 0000000..7fe7ecb --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLPassword.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1390001672)] + public class TLPassword : TLObject + { + public override int Constructor + { + get + { + return -1390001672; + } + } + + public int Flags { get; set; } + public bool HasRecovery { get; set; } + public bool HasSecureValues { get; set; } + public bool HasPassword { get; set; } + public TLAbsPasswordKdfAlgo CurrentAlgo { get; set; } + public byte[] SrpB { get; set; } + public long? SrpId { get; set; } + public string Hint { get; set; } + public string EmailUnconfirmedPattern { get; set; } + public TLAbsPasswordKdfAlgo NewAlgo { get; set; } + public TLAbsSecurePasswordKdfAlgo NewSecureAlgo { get; set; } + public byte[] SecureRandom { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + HasRecovery = (Flags & 1) != 0; + HasSecureValues = (Flags & 2) != 0; + HasPassword = (Flags & 4) != 0; + if ((Flags & 4) != 0) + CurrentAlgo = (TLAbsPasswordKdfAlgo)ObjectUtils.DeserializeObject(br); + else + CurrentAlgo = null; + + if ((Flags & 4) != 0) + SrpB = BytesUtil.Deserialize(br); + else + SrpB = null; + + if ((Flags & 4) != 0) + SrpId = br.ReadInt64(); + else + SrpId = null; + + if ((Flags & 8) != 0) + Hint = StringUtil.Deserialize(br); + else + Hint = null; + + if ((Flags & 16) != 0) + EmailUnconfirmedPattern = StringUtil.Deserialize(br); + else + EmailUnconfirmedPattern = null; + + NewAlgo = (TLAbsPasswordKdfAlgo)ObjectUtils.DeserializeObject(br); + NewSecureAlgo = (TLAbsSecurePasswordKdfAlgo)ObjectUtils.DeserializeObject(br); + SecureRandom = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(CurrentAlgo, bw); + if ((Flags & 4) != 0) + BytesUtil.Serialize(SrpB, bw); + if ((Flags & 4) != 0) + bw.Write(SrpId.Value); + if ((Flags & 8) != 0) + StringUtil.Serialize(Hint, bw); + if ((Flags & 16) != 0) + StringUtil.Serialize(EmailUnconfirmedPattern, bw); + ObjectUtils.SerializeObject(NewAlgo, bw); + ObjectUtils.SerializeObject(NewSecureAlgo, bw); + BytesUtil.Serialize(SecureRandom, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs b/src/TgSharp.TL/TL/Account/TLPasswordInputSettings.cs similarity index 68% rename from src/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs rename to src/TgSharp.TL/TL/Account/TLPasswordInputSettings.cs index d7368a3..f65c7aa 100644 --- a/src/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs +++ b/src/TgSharp.TL/TL/Account/TLPasswordInputSettings.cs @@ -4,44 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(-2037289493)] + [TLObject(-1036572727)] public class TLPasswordInputSettings : TLObject { public override int Constructor { get { - return -2037289493; + return -1036572727; } } public int Flags { get; set; } - public byte[] NewSalt { get; set; } + public TLAbsPasswordKdfAlgo NewAlgo { get; set; } public byte[] NewPasswordHash { get; set; } public string Hint { get; set; } public string Email { get; set; } - + public TLSecureSecretSettings NewSecureSettings { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = NewSalt != null ? (Flags | 1) : (Flags & ~1); - Flags = NewPasswordHash != null ? (Flags | 1) : (Flags & ~1); - Flags = Hint != null ? (Flags | 1) : (Flags & ~1); - Flags = Email != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); if ((Flags & 1) != 0) - NewSalt = BytesUtil.Deserialize(br); + NewAlgo = (TLAbsPasswordKdfAlgo)ObjectUtils.DeserializeObject(br); else - NewSalt = null; + NewAlgo = null; if ((Flags & 1) != 0) NewPasswordHash = BytesUtil.Deserialize(br); @@ -58,23 +55,27 @@ namespace TeleSharp.TL.Account else Email = null; + if ((Flags & 4) != 0) + NewSecureSettings = (TLSecureSecretSettings)ObjectUtils.DeserializeObject(br); + else + NewSecureSettings = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 1) != 0) - BytesUtil.Serialize(NewSalt, bw); + ObjectUtils.SerializeObject(NewAlgo, bw); if ((Flags & 1) != 0) BytesUtil.Serialize(NewPasswordHash, bw); if ((Flags & 1) != 0) StringUtil.Serialize(Hint, bw); if ((Flags & 2) != 0) StringUtil.Serialize(Email, bw); - + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(NewSecureSettings, bw); } } } diff --git a/src/TgSharp.TL/TL/Account/TLPasswordSettings.cs b/src/TgSharp.TL/TL/Account/TLPasswordSettings.cs new file mode 100644 index 0000000..88ee463 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLPasswordSettings.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1705233435)] + public class TLPasswordSettings : TLObject + { + public override int Constructor + { + get + { + return -1705233435; + } + } + + public int Flags { get; set; } + public string Email { get; set; } + public TLSecureSecretSettings SecureSettings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + Email = StringUtil.Deserialize(br); + else + Email = null; + + if ((Flags & 2) != 0) + SecureSettings = (TLSecureSecretSettings)ObjectUtils.DeserializeObject(br); + else + SecureSettings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + StringUtil.Serialize(Email, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(SecureSettings, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLPrivacyRules.cs b/src/TgSharp.TL/TL/Account/TLPrivacyRules.cs similarity index 74% rename from src/TeleSharp.TL/TL/Account/TLPrivacyRules.cs rename to src/TgSharp.TL/TL/Account/TLPrivacyRules.cs index cc31cb0..99f1d4f 100644 --- a/src/TeleSharp.TL/TL/Account/TLPrivacyRules.cs +++ b/src/TgSharp.TL/TL/Account/TLPrivacyRules.cs @@ -4,42 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(1430961007)] + [TLObject(1352683077)] public class TLPrivacyRules : TLObject { public override int Constructor { get { - return 1430961007; + return 1352683077; } } public TLVector Rules { get; set; } + public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Rules = (TLVector)ObjectUtils.DeserializeVector(br); + Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Rules, bw); + ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestAcceptAuthorization.cs b/src/TgSharp.TL/TL/Account/TLRequestAcceptAuthorization.cs new file mode 100644 index 0000000..8aec9af --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestAcceptAuthorization.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-419267436)] + public class TLRequestAcceptAuthorization : TLMethod + { + public override int Constructor + { + get + { + return -419267436; + } + } + + public int BotId { get; set; } + public string Scope { get; set; } + public string PublicKey { get; set; } + public TLVector ValueHashes { get; set; } + public TLSecureCredentialsEncrypted Credentials { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + BotId = br.ReadInt32(); + Scope = StringUtil.Deserialize(br); + PublicKey = StringUtil.Deserialize(br); + ValueHashes = (TLVector)ObjectUtils.DeserializeVector(br); + Credentials = (TLSecureCredentialsEncrypted)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(BotId); + StringUtil.Serialize(Scope, bw); + StringUtil.Serialize(PublicKey, bw); + ObjectUtils.SerializeObject(ValueHashes, bw); + ObjectUtils.SerializeObject(Credentials, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestCancelPasswordEmail.cs b/src/TgSharp.TL/TL/Account/TLRequestCancelPasswordEmail.cs new file mode 100644 index 0000000..0e1f563 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestCancelPasswordEmail.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1043606090)] + public class TLRequestCancelPasswordEmail : TLMethod + { + public override int Constructor + { + get + { + return -1043606090; + } + } + + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs b/src/TgSharp.TL/TL/Account/TLRequestChangePhone.cs similarity index 94% rename from src/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs rename to src/TgSharp.TL/TL/Account/TLRequestChangePhone.cs index ebe2693..90e4692 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestChangePhone.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestChangePhone.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(1891839707)] public class TLRequestChangePhone : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Account public string PhoneCode { get; set; } public TLAbsUser Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Account PhoneNumber = StringUtil.Deserialize(br); PhoneCodeHash = StringUtil.Deserialize(br); PhoneCode = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Account StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(PhoneCodeHash, bw); StringUtil.Serialize(PhoneCode, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs b/src/TgSharp.TL/TL/Account/TLRequestCheckUsername.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs rename to src/TgSharp.TL/TL/Account/TLRequestCheckUsername.cs index 51e4d83..b17f9a3 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestCheckUsername.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestCheckUsername.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(655677548)] public class TLRequestCheckUsername : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public string Username { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Username, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs b/src/TgSharp.TL/TL/Account/TLRequestConfirmPasswordEmail.cs similarity index 62% rename from src/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs rename to src/TgSharp.TL/TL/Account/TLRequestConfirmPasswordEmail.cs index c912b44..28a1b07 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestRegisterDevice.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestConfirmPasswordEmail.cs @@ -4,48 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(1669245048)] - public class TLRequestRegisterDevice : TLMethod + [TLObject(-1881204448)] + public class TLRequestConfirmPasswordEmail : TLMethod { public override int Constructor { get { - return 1669245048; + return -1881204448; } } - public int TokenType { get; set; } - public string Token { get; set; } + public string Code { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - TokenType = br.ReadInt32(); - Token = StringUtil.Deserialize(br); - + Code = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(TokenType); - StringUtil.Serialize(Token, bw); - + StringUtil.Serialize(Code, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs b/src/TgSharp.TL/TL/Account/TLRequestConfirmPhone.cs similarity index 93% rename from src/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs rename to src/TgSharp.TL/TL/Account/TLRequestConfirmPhone.cs index 3a4f1d8..a288b7a 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestConfirmPhone.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestConfirmPhone.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(1596029123)] public class TLRequestConfirmPhone : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Account public string PhoneCode { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneCodeHash = StringUtil.Deserialize(br); PhoneCode = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Account bw.Write(Constructor); StringUtil.Serialize(PhoneCodeHash, bw); StringUtil.Serialize(PhoneCode, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestCreateTheme.cs b/src/TgSharp.TL/TL/Account/TLRequestCreateTheme.cs new file mode 100644 index 0000000..12ea9c5 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestCreateTheme.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-2077048289)] + public class TLRequestCreateTheme : TLMethod + { + public override int Constructor + { + get + { + return -2077048289; + } + } + + public int Flags { get; set; } + public string Slug { get; set; } + public string Title { get; set; } + public TLAbsInputDocument Document { get; set; } + public TLInputThemeSettings Settings { get; set; } + public TLTheme Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Slug = StringUtil.Deserialize(br); + Title = StringUtil.Deserialize(br); + if ((Flags & 4) != 0) + Document = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); + else + Document = null; + + if ((Flags & 8) != 0) + Settings = (TLInputThemeSettings)ObjectUtils.DeserializeObject(br); + else + Settings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Slug, bw); + StringUtil.Serialize(Title, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(Document, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Settings, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLTheme)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs b/src/TgSharp.TL/TL/Account/TLRequestDeleteAccount.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs rename to src/TgSharp.TL/TL/Account/TLRequestDeleteAccount.cs index dac0121..c40f45a 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestDeleteAccount.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestDeleteAccount.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(1099779595)] public class TLRequestDeleteAccount : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public string Reason { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Reason = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Reason, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestDeleteSecureValue.cs b/src/TgSharp.TL/TL/Account/TLRequestDeleteSecureValue.cs new file mode 100644 index 0000000..88d317e --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestDeleteSecureValue.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1199522741)] + public class TLRequestDeleteSecureValue : TLMethod + { + public override int Constructor + { + get + { + return -1199522741; + } + } + + public TLVector Types { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Types = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Types, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestFinishTakeoutSession.cs b/src/TgSharp.TL/TL/Account/TLRequestFinishTakeoutSession.cs new file mode 100644 index 0000000..17727ac --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestFinishTakeoutSession.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(489050862)] + public class TLRequestFinishTakeoutSession : TLMethod + { + public override int Constructor + { + get + { + return 489050862; + } + } + + public int Flags { get; set; } + public bool Success { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Success = (Flags & 1) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs b/src/TgSharp.TL/TL/Account/TLRequestGetAccountTTL.cs similarity index 86% rename from src/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetAccountTTL.cs index 835f270..0560438 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetAccountTTL.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetAccountTTL.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(150761757)] public class TLRequestGetAccountTTL : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Account public TLAccountDaysTTL Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAccountDaysTTL)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetAllSecureValues.cs b/src/TgSharp.TL/TL/Account/TLRequestGetAllSecureValues.cs new file mode 100644 index 0000000..1a29e4a --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetAllSecureValues.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1299661699)] + public class TLRequestGetAllSecureValues : TLMethod + { + public override int Constructor + { + get + { + return -1299661699; + } + } + + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetAuthorizationForm.cs b/src/TgSharp.TL/TL/Account/TLRequestGetAuthorizationForm.cs new file mode 100644 index 0000000..c0894a9 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetAuthorizationForm.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1200903967)] + public class TLRequestGetAuthorizationForm : TLMethod + { + public override int Constructor + { + get + { + return -1200903967; + } + } + + public int BotId { get; set; } + public string Scope { get; set; } + public string PublicKey { get; set; } + public Account.TLAuthorizationForm Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + BotId = br.ReadInt32(); + Scope = StringUtil.Deserialize(br); + PublicKey = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(BotId); + StringUtil.Serialize(Scope, bw); + StringUtil.Serialize(PublicKey, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLAuthorizationForm)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs b/src/TgSharp.TL/TL/Account/TLRequestGetAuthorizations.cs similarity index 86% rename from src/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetAuthorizations.cs index b7e7414..38a745f 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetAuthorizations.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetAuthorizations.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-484392616)] public class TLRequestGetAuthorizations : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Account public Account.TLAuthorizations Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Account.TLAuthorizations)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetAutoDownloadSettings.cs b/src/TgSharp.TL/TL/Account/TLRequestGetAutoDownloadSettings.cs new file mode 100644 index 0000000..e614ea6 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetAutoDownloadSettings.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1457130303)] + public class TLRequestGetAutoDownloadSettings : TLMethod + { + public override int Constructor + { + get + { + return 1457130303; + } + } + + public Account.TLAutoDownloadSettings Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLAutoDownloadSettings)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetContactSignUpNotification.cs b/src/TgSharp.TL/TL/Account/TLRequestGetContactSignUpNotification.cs new file mode 100644 index 0000000..1ca6ee7 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetContactSignUpNotification.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1626880216)] + public class TLRequestGetContactSignUpNotification : TLMethod + { + public override int Constructor + { + get + { + return -1626880216; + } + } + + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetContentSettings.cs b/src/TgSharp.TL/TL/Account/TLRequestGetContentSettings.cs new file mode 100644 index 0000000..afb05d4 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetContentSettings.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1952756306)] + public class TLRequestGetContentSettings : TLMethod + { + public override int Constructor + { + get + { + return -1952756306; + } + } + + public Account.TLContentSettings Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLContentSettings)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetMultiWallPapers.cs b/src/TgSharp.TL/TL/Account/TLRequestGetMultiWallPapers.cs new file mode 100644 index 0000000..7271f94 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetMultiWallPapers.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1705865692)] + public class TLRequestGetMultiWallPapers : TLMethod + { + public override int Constructor + { + get + { + return 1705865692; + } + } + + public TLVector Wallpapers { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Wallpapers = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Wallpapers, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetNotifyExceptions.cs b/src/TgSharp.TL/TL/Account/TLRequestGetNotifyExceptions.cs new file mode 100644 index 0000000..67b38b8 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetNotifyExceptions.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1398240377)] + public class TLRequestGetNotifyExceptions : TLMethod + { + public override int Constructor + { + get + { + return 1398240377; + } + } + + public int Flags { get; set; } + public bool CompareSound { get; set; } + public TLAbsInputNotifyPeer Peer { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + CompareSound = (Flags & 2) != 0; + if ((Flags & 1) != 0) + Peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br); + else + Peer = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Peer, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs b/src/TgSharp.TL/TL/Account/TLRequestGetNotifySettings.cs similarity index 80% rename from src/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetNotifySettings.cs index 87f42d4..1dc2535 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetNotifySettings.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetNotifySettings.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(313765169)] public class TLRequestGetNotifySettings : TLMethod @@ -19,30 +21,27 @@ namespace TeleSharp.TL.Account } public TLAbsInputNotifyPeer Peer { get; set; } - public TLAbsPeerNotifySettings Response { get; set; } - + public TLPeerNotifySettings Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); - + Response = (TLPeerNotifySettings)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs b/src/TgSharp.TL/TL/Account/TLRequestGetPassword.cs similarity index 72% rename from src/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetPassword.cs index 27b3b52..dd70671 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetPassword.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetPassword.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(1418342645)] public class TLRequestGetPassword : TLMethod @@ -18,28 +20,27 @@ namespace TeleSharp.TL.Account } } - public Account.TLAbsPassword Response { get; set; } - + public Account.TLPassword Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { - Response = (Account.TLAbsPassword)ObjectUtils.DeserializeObject(br); - + Response = (Account.TLPassword)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs b/src/TgSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs similarity index 70% rename from src/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs index 4e22bbb..d577463 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetPasswordSettings.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(-1131605573)] + [TLObject(-1663767815)] public class TLRequestGetPasswordSettings : TLMethod { public override int Constructor { get { - return -1131605573; + return -1663767815; } } - public byte[] CurrentPasswordHash { get; set; } + public TLAbsInputCheckPasswordSRP Password { get; set; } public Account.TLPasswordSettings Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - CurrentPasswordHash = BytesUtil.Deserialize(br); - + Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BytesUtil.Serialize(CurrentPasswordHash, bw); - + ObjectUtils.SerializeObject(Password, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (Account.TLPasswordSettings)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs b/src/TgSharp.TL/TL/Account/TLRequestGetPrivacy.cs similarity index 93% rename from src/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetPrivacy.cs index 7bd2938..1ae312f 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetPrivacy.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetPrivacy.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-623130288)] public class TLRequestGetPrivacy : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public TLAbsInputPrivacyKey Key { get; set; } public Account.TLPrivacyRules Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Key = (TLAbsInputPrivacyKey)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Key, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Account.TLPrivacyRules)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetSecureValue.cs b/src/TgSharp.TL/TL/Account/TLRequestGetSecureValue.cs new file mode 100644 index 0000000..805a743 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetSecureValue.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1936088002)] + public class TLRequestGetSecureValue : TLMethod + { + public override int Constructor + { + get + { + return 1936088002; + } + } + + public TLVector Types { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Types = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Types, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetTheme.cs b/src/TgSharp.TL/TL/Account/TLRequestGetTheme.cs new file mode 100644 index 0000000..57de3ea --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetTheme.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1919060949)] + public class TLRequestGetTheme : TLMethod + { + public override int Constructor + { + get + { + return -1919060949; + } + } + + public string Format { get; set; } + public TLAbsInputTheme Theme { get; set; } + public long DocumentId { get; set; } + public TLTheme Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Format = StringUtil.Deserialize(br); + Theme = (TLAbsInputTheme)ObjectUtils.DeserializeObject(br); + DocumentId = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Format, bw); + ObjectUtils.SerializeObject(Theme, bw); + bw.Write(DocumentId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLTheme)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetThemes.cs b/src/TgSharp.TL/TL/Account/TLRequestGetThemes.cs new file mode 100644 index 0000000..8729a50 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetThemes.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(676939512)] + public class TLRequestGetThemes : TLMethod + { + public override int Constructor + { + get + { + return 676939512; + } + } + + public string Format { get; set; } + public int Hash { get; set; } + public Account.TLAbsThemes Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Format = StringUtil.Deserialize(br); + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Format, bw); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLAbsThemes)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetTmpPassword.cs b/src/TgSharp.TL/TL/Account/TLRequestGetTmpPassword.cs similarity index 72% rename from src/TeleSharp.TL/TL/Account/TLRequestGetTmpPassword.cs rename to src/TgSharp.TL/TL/Account/TLRequestGetTmpPassword.cs index 566914c..b8fba96 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetTmpPassword.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestGetTmpPassword.cs @@ -4,48 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(1250046590)] + [TLObject(1151208273)] public class TLRequestGetTmpPassword : TLMethod { public override int Constructor { get { - return 1250046590; + return 1151208273; } } - public byte[] PasswordHash { get; set; } + public TLAbsInputCheckPasswordSRP Password { get; set; } public int Period { get; set; } public Account.TLTmpPassword Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - PasswordHash = BytesUtil.Deserialize(br); + Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br); Period = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BytesUtil.Serialize(PasswordHash, bw); + ObjectUtils.SerializeObject(Password, bw); bw.Write(Period); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Account.TLTmpPassword)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetWallPaper.cs b/src/TgSharp.TL/TL/Account/TLRequestGetWallPaper.cs new file mode 100644 index 0000000..3b9b52b --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetWallPaper.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-57811990)] + public class TLRequestGetWallPaper : TLMethod + { + public override int Constructor + { + get + { + return -57811990; + } + } + + public TLAbsInputWallPaper Wallpaper { get; set; } + public TLAbsWallPaper Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Wallpaper = (TLAbsInputWallPaper)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Wallpaper, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsWallPaper)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetWallPapers.cs b/src/TgSharp.TL/TL/Account/TLRequestGetWallPapers.cs new file mode 100644 index 0000000..3f23655 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetWallPapers.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1430579357)] + public class TLRequestGetWallPapers : TLMethod + { + public override int Constructor + { + get + { + return -1430579357; + } + } + + public int Hash { get; set; } + public Account.TLAbsWallPapers Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLAbsWallPapers)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestGetWebAuthorizations.cs b/src/TgSharp.TL/TL/Account/TLRequestGetWebAuthorizations.cs new file mode 100644 index 0000000..34a0397 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestGetWebAuthorizations.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(405695855)] + public class TLRequestGetWebAuthorizations : TLMethod + { + public override int Constructor + { + get + { + return 405695855; + } + } + + public Account.TLWebAuthorizations Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLWebAuthorizations)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestInitTakeoutSession.cs b/src/TgSharp.TL/TL/Account/TLRequestInitTakeoutSession.cs new file mode 100644 index 0000000..13608d9 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestInitTakeoutSession.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-262453244)] + public class TLRequestInitTakeoutSession : TLMethod + { + public override int Constructor + { + get + { + return -262453244; + } + } + + public int Flags { get; set; } + public bool Contacts { get; set; } + public bool MessageUsers { get; set; } + public bool MessageChats { get; set; } + public bool MessageMegagroups { get; set; } + public bool MessageChannels { get; set; } + public bool Files { get; set; } + public int? FileMaxSize { get; set; } + public Account.TLTakeout Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Contacts = (Flags & 1) != 0; + MessageUsers = (Flags & 2) != 0; + MessageChats = (Flags & 4) != 0; + MessageMegagroups = (Flags & 8) != 0; + MessageChannels = (Flags & 16) != 0; + Files = (Flags & 32) != 0; + if ((Flags & 32) != 0) + FileMaxSize = br.ReadInt32(); + else + FileMaxSize = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 32) != 0) + bw.Write(FileMaxSize.Value); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLTakeout)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestInstallTheme.cs b/src/TgSharp.TL/TL/Account/TLRequestInstallTheme.cs new file mode 100644 index 0000000..e178c5a --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestInstallTheme.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(2061776695)] + public class TLRequestInstallTheme : TLMethod + { + public override int Constructor + { + get + { + return 2061776695; + } + } + + public int Flags { get; set; } + public bool Dark { get; set; } + public string Format { get; set; } + public TLAbsInputTheme Theme { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Dark = (Flags & 1) != 0; + if ((Flags & 2) != 0) + Format = StringUtil.Deserialize(br); + else + Format = null; + + if ((Flags & 2) != 0) + Theme = (TLAbsInputTheme)ObjectUtils.DeserializeObject(br); + else + Theme = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 2) != 0) + StringUtil.Serialize(Format, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Theme, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestInstallWallPaper.cs b/src/TgSharp.TL/TL/Account/TLRequestInstallWallPaper.cs new file mode 100644 index 0000000..c223c87 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestInstallWallPaper.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-18000023)] + public class TLRequestInstallWallPaper : TLMethod + { + public override int Constructor + { + get + { + return -18000023; + } + } + + public TLAbsInputWallPaper Wallpaper { get; set; } + public TLWallPaperSettings Settings { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Wallpaper = (TLAbsInputWallPaper)ObjectUtils.DeserializeObject(br); + Settings = (TLWallPaperSettings)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Wallpaper, bw); + ObjectUtils.SerializeObject(Settings, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestRegisterDevice.cs b/src/TgSharp.TL/TL/Account/TLRequestRegisterDevice.cs new file mode 100644 index 0000000..75d2496 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestRegisterDevice.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1754754159)] + public class TLRequestRegisterDevice : TLMethod + { + public override int Constructor + { + get + { + return 1754754159; + } + } + + public int Flags { get; set; } + public bool NoMuted { get; set; } + public int TokenType { get; set; } + public string Token { get; set; } + public bool AppSandbox { get; set; } + public byte[] Secret { get; set; } + public TLVector OtherUids { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + NoMuted = (Flags & 1) != 0; + TokenType = br.ReadInt32(); + Token = StringUtil.Deserialize(br); + AppSandbox = BoolUtil.Deserialize(br); + Secret = BytesUtil.Deserialize(br); + OtherUids = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(TokenType); + StringUtil.Serialize(Token, bw); + BoolUtil.Serialize(AppSandbox, bw); + BytesUtil.Serialize(Secret, bw); + ObjectUtils.SerializeObject(OtherUids, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs b/src/TgSharp.TL/TL/Account/TLRequestReportPeer.cs similarity index 94% rename from src/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs rename to src/TgSharp.TL/TL/Account/TLRequestReportPeer.cs index c5583bd..ba0bc97 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestReportPeer.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestReportPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-1374118561)] public class TLRequestReportPeer : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Account public TLAbsReportReason Reason { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Reason = (TLAbsReportReason)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Account bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Reason, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestResendPasswordEmail.cs b/src/TgSharp.TL/TL/Account/TLRequestResendPasswordEmail.cs new file mode 100644 index 0000000..2f9850b --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestResendPasswordEmail.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(2055154197)] + public class TLRequestResendPasswordEmail : TLMethod + { + public override int Constructor + { + get + { + return 2055154197; + } + } + + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs b/src/TgSharp.TL/TL/Account/TLRequestResetAuthorization.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs rename to src/TgSharp.TL/TL/Account/TLRequestResetAuthorization.cs index 923cfef..1549e3d 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestResetAuthorization.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestResetAuthorization.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-545786948)] public class TLRequestResetAuthorization : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public long Hash { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs b/src/TgSharp.TL/TL/Account/TLRequestResetNotifySettings.cs similarity index 86% rename from src/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs rename to src/TgSharp.TL/TL/Account/TLRequestResetNotifySettings.cs index 358ec42..10dac59 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestResetNotifySettings.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestResetNotifySettings.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-612493497)] public class TLRequestResetNotifySettings : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Account public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestResetWallPapers.cs b/src/TgSharp.TL/TL/Account/TLRequestResetWallPapers.cs new file mode 100644 index 0000000..522ad3e --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestResetWallPapers.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1153722364)] + public class TLRequestResetWallPapers : TLMethod + { + public override int Constructor + { + get + { + return -1153722364; + } + } + + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestResetWebAuthorization.cs b/src/TgSharp.TL/TL/Account/TLRequestResetWebAuthorization.cs new file mode 100644 index 0000000..b801593 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestResetWebAuthorization.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(755087855)] + public class TLRequestResetWebAuthorization : TLMethod + { + public override int Constructor + { + get + { + return 755087855; + } + } + + public long Hash { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestResetWebAuthorizations.cs b/src/TgSharp.TL/TL/Account/TLRequestResetWebAuthorizations.cs new file mode 100644 index 0000000..86eed9a --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestResetWebAuthorizations.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1747789204)] + public class TLRequestResetWebAuthorizations : TLMethod + { + public override int Constructor + { + get + { + return 1747789204; + } + } + + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestSaveAutoDownloadSettings.cs b/src/TgSharp.TL/TL/Account/TLRequestSaveAutoDownloadSettings.cs new file mode 100644 index 0000000..5418b0b --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSaveAutoDownloadSettings.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1995661875)] + public class TLRequestSaveAutoDownloadSettings : TLMethod + { + public override int Constructor + { + get + { + return 1995661875; + } + } + + public int Flags { get; set; } + public bool Low { get; set; } + public bool High { get; set; } + public TLAutoDownloadSettings Settings { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Low = (Flags & 1) != 0; + High = (Flags & 2) != 0; + Settings = (TLAutoDownloadSettings)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Settings, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestSaveSecureValue.cs b/src/TgSharp.TL/TL/Account/TLRequestSaveSecureValue.cs new file mode 100644 index 0000000..3068134 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSaveSecureValue.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1986010339)] + public class TLRequestSaveSecureValue : TLMethod + { + public override int Constructor + { + get + { + return -1986010339; + } + } + + public TLInputSecureValue Value { get; set; } + public long SecureSecretId { get; set; } + public TLSecureValue Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Value = (TLInputSecureValue)ObjectUtils.DeserializeObject(br); + SecureSecretId = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Value, bw); + bw.Write(SecureSecretId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLSecureValue)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestSaveTheme.cs b/src/TgSharp.TL/TL/Account/TLRequestSaveTheme.cs new file mode 100644 index 0000000..71e67ab --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSaveTheme.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-229175188)] + public class TLRequestSaveTheme : TLMethod + { + public override int Constructor + { + get + { + return -229175188; + } + } + + public TLAbsInputTheme Theme { get; set; } + public bool Unsave { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Theme = (TLAbsInputTheme)ObjectUtils.DeserializeObject(br); + Unsave = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Theme, bw); + BoolUtil.Serialize(Unsave, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestSaveWallPaper.cs b/src/TgSharp.TL/TL/Account/TLRequestSaveWallPaper.cs new file mode 100644 index 0000000..1c00b83 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSaveWallPaper.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1817860919)] + public class TLRequestSaveWallPaper : TLMethod + { + public override int Constructor + { + get + { + return 1817860919; + } + } + + public TLAbsInputWallPaper Wallpaper { get; set; } + public bool Unsave { get; set; } + public TLWallPaperSettings Settings { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Wallpaper = (TLAbsInputWallPaper)ObjectUtils.DeserializeObject(br); + Unsave = BoolUtil.Deserialize(br); + Settings = (TLWallPaperSettings)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Wallpaper, bw); + BoolUtil.Serialize(Unsave, bw); + ObjectUtils.SerializeObject(Settings, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs b/src/TgSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs similarity index 59% rename from src/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs rename to src/TgSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs index f7ea4c3..9f61c73 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestCheckPhone.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs @@ -4,45 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(1877286395)] - public class TLRequestCheckPhone : TLMethod + [TLObject(-2108208411)] + public class TLRequestSendChangePhoneCode : TLMethod { public override int Constructor { get { - return 1877286395; + return -2108208411; } } public string PhoneNumber { get; set; } - public Auth.TLCheckedPhone Response { get; set; } - + public TLCodeSettings Settings { get; set; } + public Auth.TLSentCode Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneNumber = StringUtil.Deserialize(br); - + Settings = (TLCodeSettings)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(PhoneNumber, bw); - + ObjectUtils.SerializeObject(Settings, bw); } + public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLCheckedPhone)ObjectUtils.DeserializeObject(br); - + Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs b/src/TgSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs similarity index 53% rename from src/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs rename to src/TgSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs index ad6f9fb..2ae7e4d 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestSendConfirmPhoneCode.cs @@ -4,63 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(353818557)] + [TLObject(457157256)] public class TLRequestSendConfirmPhoneCode : TLMethod { public override int Constructor { get { - return 353818557; + return 457157256; } } - public int Flags { get; set; } - public bool AllowFlashcall { get; set; } public string Hash { get; set; } - public bool? CurrentNumber { get; set; } + public TLCodeSettings Settings { get; set; } public Auth.TLSentCode Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = AllowFlashcall ? (Flags | 1) : (Flags & ~1); - Flags = CurrentNumber != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Flags = br.ReadInt32(); - AllowFlashcall = (Flags & 1) != 0; Hash = StringUtil.Deserialize(br); - if ((Flags & 1) != 0) - CurrentNumber = BoolUtil.Deserialize(br); - else - CurrentNumber = null; - - + Settings = (TLCodeSettings)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); - StringUtil.Serialize(Hash, bw); - if ((Flags & 1) != 0) - BoolUtil.Serialize(CurrentNumber.Value, bw); - + ObjectUtils.SerializeObject(Settings, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestSendVerifyEmailCode.cs b/src/TgSharp.TL/TL/Account/TLRequestSendVerifyEmailCode.cs new file mode 100644 index 0000000..31e9356 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSendVerifyEmailCode.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1880182943)] + public class TLRequestSendVerifyEmailCode : TLMethod + { + public override int Constructor + { + get + { + return 1880182943; + } + } + + public string Email { get; set; } + public Account.TLSentEmailCode Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Email = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Email, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Account.TLSentEmailCode)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs b/src/TgSharp.TL/TL/Account/TLRequestSendVerifyPhoneCode.cs similarity index 50% rename from src/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs rename to src/TgSharp.TL/TL/Account/TLRequestSendVerifyPhoneCode.cs index b78d568..51134b5 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestSendVerifyPhoneCode.cs @@ -4,63 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(149257707)] - public class TLRequestSendChangePhoneCode : TLMethod + [TLObject(-1516022023)] + public class TLRequestSendVerifyPhoneCode : TLMethod { public override int Constructor { get { - return 149257707; + return -1516022023; } } - public int Flags { get; set; } - public bool AllowFlashcall { get; set; } public string PhoneNumber { get; set; } - public bool? CurrentNumber { get; set; } + public TLCodeSettings Settings { get; set; } public Auth.TLSentCode Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = AllowFlashcall ? (Flags | 1) : (Flags & ~1); - Flags = CurrentNumber != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Flags = br.ReadInt32(); - AllowFlashcall = (Flags & 1) != 0; PhoneNumber = StringUtil.Deserialize(br); - if ((Flags & 1) != 0) - CurrentNumber = BoolUtil.Deserialize(br); - else - CurrentNumber = null; - - + Settings = (TLCodeSettings)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); - StringUtil.Serialize(PhoneNumber, bw); - if ((Flags & 1) != 0) - BoolUtil.Serialize(CurrentNumber.Value, bw); - + ObjectUtils.SerializeObject(Settings, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs b/src/TgSharp.TL/TL/Account/TLRequestSetAccountTTL.cs similarity index 93% rename from src/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs rename to src/TgSharp.TL/TL/Account/TLRequestSetAccountTTL.cs index 83840e8..677e1f6 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestSetAccountTTL.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestSetAccountTTL.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(608323678)] public class TLRequestSetAccountTTL : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public TLAccountDaysTTL Ttl { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Ttl = (TLAccountDaysTTL)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Ttl, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestSetContactSignUpNotification.cs b/src/TgSharp.TL/TL/Account/TLRequestSetContactSignUpNotification.cs new file mode 100644 index 0000000..7d8f819 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSetContactSignUpNotification.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-806076575)] + public class TLRequestSetContactSignUpNotification : TLMethod + { + public override int Constructor + { + get + { + return -806076575; + } + } + + public bool Silent { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Silent = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BoolUtil.Serialize(Silent, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestSetContentSettings.cs b/src/TgSharp.TL/TL/Account/TLRequestSetContentSettings.cs new file mode 100644 index 0000000..c27fdbf --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestSetContentSettings.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-1250643605)] + public class TLRequestSetContentSettings : TLMethod + { + public override int Constructor + { + get + { + return -1250643605; + } + } + + public int Flags { get; set; } + public bool SensitiveEnabled { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + SensitiveEnabled = (Flags & 1) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs b/src/TgSharp.TL/TL/Account/TLRequestSetPrivacy.cs similarity index 94% rename from src/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs rename to src/TgSharp.TL/TL/Account/TLRequestSetPrivacy.cs index fd055b1..7f76158 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestSetPrivacy.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestSetPrivacy.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-906486552)] public class TLRequestSetPrivacy : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Account public TLVector Rules { get; set; } public Account.TLPrivacyRules Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Key = (TLAbsInputPrivacyKey)ObjectUtils.DeserializeObject(br); Rules = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Account bw.Write(Constructor); ObjectUtils.SerializeObject(Key, bw); ObjectUtils.SerializeObject(Rules, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Account.TLPrivacyRules)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs b/src/TgSharp.TL/TL/Account/TLRequestUnregisterDevice.cs similarity index 75% rename from src/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs rename to src/TgSharp.TL/TL/Account/TLRequestUnregisterDevice.cs index 3fb2fb2..7a9db6e 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUnregisterDevice.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUnregisterDevice.cs @@ -4,35 +4,37 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(1707432768)] + [TLObject(813089983)] public class TLRequestUnregisterDevice : TLMethod { public override int Constructor { get { - return 1707432768; + return 813089983; } } public int TokenType { get; set; } public string Token { get; set; } + public TLVector OtherUids { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { TokenType = br.ReadInt32(); Token = StringUtil.Deserialize(br); - + OtherUids = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +42,12 @@ namespace TeleSharp.TL.Account bw.Write(Constructor); bw.Write(TokenType); StringUtil.Serialize(Token, bw); - + ObjectUtils.SerializeObject(OtherUids, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs rename to src/TgSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs index cc4a2f1..c1ff5db 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdateDeviceLocked.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(954152242)] public class TLRequestUpdateDeviceLocked : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public int Period { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Period = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Period); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs similarity index 94% rename from src/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs rename to src/TgSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs index b457dc1..a54268a 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdateNotifySettings.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-2067899501)] public class TLRequestUpdateNotifySettings : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Account public TLInputPeerNotifySettings Settings { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br); Settings = (TLInputPeerNotifySettings)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Account bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Settings, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs similarity index 74% rename from src/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs rename to src/TgSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs index 67b01d0..c370135 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdatePasswordSettings.cs @@ -4,48 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { - [TLObject(-92517498)] + [TLObject(-1516564433)] public class TLRequestUpdatePasswordSettings : TLMethod { public override int Constructor { get { - return -92517498; + return -1516564433; } } - public byte[] CurrentPasswordHash { get; set; } + public TLAbsInputCheckPasswordSRP Password { get; set; } public Account.TLPasswordInputSettings NewSettings { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - CurrentPasswordHash = BytesUtil.Deserialize(br); + Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br); NewSettings = (Account.TLPasswordInputSettings)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BytesUtil.Serialize(CurrentPasswordHash, bw); + ObjectUtils.SerializeObject(Password, bw); ObjectUtils.SerializeObject(NewSettings, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdateProfile.cs similarity index 85% rename from src/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs rename to src/TgSharp.TL/TL/Account/TLRequestUpdateProfile.cs index 776c008..a5af369 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdateProfile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(2018596725)] public class TLRequestUpdateProfile : TLMethod @@ -24,14 +26,9 @@ namespace TeleSharp.TL.Account public string About { get; set; } public TLAbsUser Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = FirstName != null ? (Flags | 1) : (Flags & ~1); - Flags = LastName != null ? (Flags | 2) : (Flags & ~2); - Flags = About != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -52,13 +49,11 @@ namespace TeleSharp.TL.Account else About = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 1) != 0) StringUtil.Serialize(FirstName, bw); @@ -66,12 +61,11 @@ namespace TeleSharp.TL.Account StringUtil.Serialize(LastName, bw); if ((Flags & 4) != 0) StringUtil.Serialize(About, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdateStatus.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs rename to src/TgSharp.TL/TL/Account/TLRequestUpdateStatus.cs index eaf98c7..941e4a7 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUpdateStatus.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdateStatus.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(1713919532)] public class TLRequestUpdateStatus : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public bool Offline { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offline = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); BoolUtil.Serialize(Offline, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestUpdateTheme.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdateTheme.cs new file mode 100644 index 0000000..477f438 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdateTheme.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1555261397)] + public class TLRequestUpdateTheme : TLMethod + { + public override int Constructor + { + get + { + return 1555261397; + } + } + + public int Flags { get; set; } + public string Format { get; set; } + public TLAbsInputTheme Theme { get; set; } + public string Slug { get; set; } + public string Title { get; set; } + public TLAbsInputDocument Document { get; set; } + public TLInputThemeSettings Settings { get; set; } + public TLTheme Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Format = StringUtil.Deserialize(br); + Theme = (TLAbsInputTheme)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + Slug = StringUtil.Deserialize(br); + else + Slug = null; + + if ((Flags & 2) != 0) + Title = StringUtil.Deserialize(br); + else + Title = null; + + if ((Flags & 4) != 0) + Document = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); + else + Document = null; + + if ((Flags & 8) != 0) + Settings = (TLInputThemeSettings)ObjectUtils.DeserializeObject(br); + else + Settings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Format, bw); + ObjectUtils.SerializeObject(Theme, bw); + if ((Flags & 1) != 0) + StringUtil.Serialize(Slug, bw); + if ((Flags & 2) != 0) + StringUtil.Serialize(Title, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(Document, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Settings, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLTheme)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs b/src/TgSharp.TL/TL/Account/TLRequestUpdateUsername.cs similarity index 93% rename from src/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs rename to src/TgSharp.TL/TL/Account/TLRequestUpdateUsername.cs index fe82919..1a5c9cd 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestUpdateUsername.cs +++ b/src/TgSharp.TL/TL/Account/TLRequestUpdateUsername.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(1040964988)] public class TLRequestUpdateUsername : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account public string Username { get; set; } public TLAbsUser Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Username, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLRequestUploadTheme.cs b/src/TgSharp.TL/TL/Account/TLRequestUploadTheme.cs new file mode 100644 index 0000000..b68ec30 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestUploadTheme.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(473805619)] + public class TLRequestUploadTheme : TLMethod + { + public override int Constructor + { + get + { + return 473805619; + } + } + + public int Flags { get; set; } + public TLAbsInputFile File { get; set; } + public TLAbsInputFile Thumb { get; set; } + public string FileName { get; set; } + public string MimeType { get; set; } + public TLAbsDocument Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + File = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + Thumb = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); + else + Thumb = null; + + FileName = StringUtil.Deserialize(br); + MimeType = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(File, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Thumb, bw); + StringUtil.Serialize(FileName, bw); + StringUtil.Serialize(MimeType, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsDocument)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestUploadWallPaper.cs b/src/TgSharp.TL/TL/Account/TLRequestUploadWallPaper.cs new file mode 100644 index 0000000..aa00eb7 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestUploadWallPaper.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-578472351)] + public class TLRequestUploadWallPaper : TLMethod + { + public override int Constructor + { + get + { + return -578472351; + } + } + + public TLAbsInputFile File { get; set; } + public string MimeType { get; set; } + public TLWallPaperSettings Settings { get; set; } + public TLAbsWallPaper Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + File = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); + MimeType = StringUtil.Deserialize(br); + Settings = (TLWallPaperSettings)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(File, bw); + StringUtil.Serialize(MimeType, bw); + ObjectUtils.SerializeObject(Settings, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsWallPaper)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestVerifyEmail.cs b/src/TgSharp.TL/TL/Account/TLRequestVerifyEmail.cs new file mode 100644 index 0000000..1a4e159 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestVerifyEmail.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-323339813)] + public class TLRequestVerifyEmail : TLMethod + { + public override int Constructor + { + get + { + return -323339813; + } + } + + public string Email { get; set; } + public string Code { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Email = StringUtil.Deserialize(br); + Code = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Email, bw); + StringUtil.Serialize(Code, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLRequestVerifyPhone.cs b/src/TgSharp.TL/TL/Account/TLRequestVerifyPhone.cs new file mode 100644 index 0000000..9307826 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLRequestVerifyPhone.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1305716726)] + public class TLRequestVerifyPhone : TLMethod + { + public override int Constructor + { + get + { + return 1305716726; + } + } + + public string PhoneNumber { get; set; } + public string PhoneCodeHash { get; set; } + public string PhoneCode { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PhoneNumber = StringUtil.Deserialize(br); + PhoneCodeHash = StringUtil.Deserialize(br); + PhoneCode = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(PhoneNumber, bw); + StringUtil.Serialize(PhoneCodeHash, bw); + StringUtil.Serialize(PhoneCode, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLSentEmailCode.cs b/src/TgSharp.TL/TL/Account/TLSentEmailCode.cs new file mode 100644 index 0000000..df79640 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLSentEmailCode.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-2128640689)] + public class TLSentEmailCode : TLObject + { + public override int Constructor + { + get + { + return -2128640689; + } + } + + public string EmailPattern { get; set; } + public int Length { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + EmailPattern = StringUtil.Deserialize(br); + Length = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(EmailPattern, bw); + bw.Write(Length); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLTakeout.cs b/src/TgSharp.TL/TL/Account/TLTakeout.cs new file mode 100644 index 0000000..3eb954e --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLTakeout.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1304052993)] + public class TLTakeout : TLObject + { + public override int Constructor + { + get + { + return 1304052993; + } + } + + public long Id { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLThemes.cs b/src/TgSharp.TL/TL/Account/TLThemes.cs new file mode 100644 index 0000000..f64f416 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLThemes.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(2137482273)] + public class TLThemes : TLAbsThemes + { + public override int Constructor + { + get + { + return 2137482273; + } + } + + public int Hash { get; set; } + public TLVector Themes { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + Themes = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + ObjectUtils.SerializeObject(Themes, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLThemesNotModified.cs b/src/TgSharp.TL/TL/Account/TLThemesNotModified.cs new file mode 100644 index 0000000..caa4f91 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLThemesNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-199313886)] + public class TLThemesNotModified : TLAbsThemes + { + public override int Constructor + { + get + { + return -199313886; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLTmpPassword.cs b/src/TgSharp.TL/TL/Account/TLTmpPassword.cs similarity index 92% rename from src/TeleSharp.TL/TL/Account/TLTmpPassword.cs rename to src/TgSharp.TL/TL/Account/TLTmpPassword.cs index 2d6fcfc..ea22ca5 100644 --- a/src/TeleSharp.TL/TL/Account/TLTmpPassword.cs +++ b/src/TgSharp.TL/TL/Account/TLTmpPassword.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Account { [TLObject(-614138572)] public class TLTmpPassword : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Account public byte[] TmpPassword { get; set; } public int ValidUntil { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { TmpPassword = BytesUtil.Deserialize(br); ValidUntil = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Account bw.Write(Constructor); BytesUtil.Serialize(TmpPassword, bw); bw.Write(ValidUntil); - } } } diff --git a/src/TgSharp.TL/TL/Account/TLWallPapers.cs b/src/TgSharp.TL/TL/Account/TLWallPapers.cs new file mode 100644 index 0000000..25e0a6a --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLWallPapers.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(1881892265)] + public class TLWallPapers : TLAbsWallPapers + { + public override int Constructor + { + get + { + return 1881892265; + } + } + + public int Hash { get; set; } + public TLVector Wallpapers { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + Wallpapers = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + ObjectUtils.SerializeObject(Wallpapers, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLWallPapersNotModified.cs b/src/TgSharp.TL/TL/Account/TLWallPapersNotModified.cs new file mode 100644 index 0000000..f060d6b --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLWallPapersNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(471437699)] + public class TLWallPapersNotModified : TLAbsWallPapers + { + public override int Constructor + { + get + { + return 471437699; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/Account/TLWebAuthorizations.cs b/src/TgSharp.TL/TL/Account/TLWebAuthorizations.cs new file mode 100644 index 0000000..38c55a9 --- /dev/null +++ b/src/TgSharp.TL/TL/Account/TLWebAuthorizations.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Account +{ + [TLObject(-313079300)] + public class TLWebAuthorizations : TLObject + { + public override int Constructor + { + get + { + return -313079300; + } + } + + public TLVector Authorizations { get; set; } + public TLVector Users { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Authorizations = (TLVector)ObjectUtils.DeserializeVector(br); + Users = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Authorizations, bw); + ObjectUtils.SerializeObject(Users, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Auth/TLAbsAuthorization.cs b/src/TgSharp.TL/TL/Auth/TLAbsAuthorization.cs new file mode 100644 index 0000000..6b48acf --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLAbsAuthorization.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + public abstract class TLAbsAuthorization : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs b/src/TgSharp.TL/TL/Auth/TLAbsCodeType.cs similarity index 80% rename from src/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs rename to src/TgSharp.TL/TL/Auth/TLAbsCodeType.cs index fa01532..d5cf8ce 100644 --- a/src/TeleSharp.TL/TL/Auth/TLAbsCodeType.cs +++ b/src/TgSharp.TL/TL/Auth/TLAbsCodeType.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { public abstract class TLAbsCodeType : TLObject { diff --git a/src/TgSharp.TL/TL/Auth/TLAbsLoginToken.cs b/src/TgSharp.TL/TL/Auth/TLAbsLoginToken.cs new file mode 100644 index 0000000..ef40ff0 --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLAbsLoginToken.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + public abstract class TLAbsLoginToken : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs b/src/TgSharp.TL/TL/Auth/TLAbsSentCodeType.cs similarity index 80% rename from src/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs rename to src/TgSharp.TL/TL/Auth/TLAbsSentCodeType.cs index c77d063..302a2b7 100644 --- a/src/TeleSharp.TL/TL/Auth/TLAbsSentCodeType.cs +++ b/src/TgSharp.TL/TL/Auth/TLAbsSentCodeType.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { public abstract class TLAbsSentCodeType : TLObject { diff --git a/src/TeleSharp.TL/TL/Auth/TLAuthorization.cs b/src/TgSharp.TL/TL/Auth/TLAuthorization.cs similarity index 83% rename from src/TeleSharp.TL/TL/Auth/TLAuthorization.cs rename to src/TgSharp.TL/TL/Auth/TLAuthorization.cs index 12c17e3..f53839b 100644 --- a/src/TeleSharp.TL/TL/Auth/TLAuthorization.cs +++ b/src/TgSharp.TL/TL/Auth/TLAuthorization.cs @@ -4,11 +4,13 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-855308010)] - public class TLAuthorization : TLObject + public class TLAuthorization : TLAbsAuthorization { public override int Constructor { @@ -22,12 +24,9 @@ namespace TeleSharp.TL.Auth public int? TmpSessions { get; set; } public TLAbsUser User { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = TmpSessions != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,18 +38,15 @@ namespace TeleSharp.TL.Auth TmpSessions = null; User = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 1) != 0) bw.Write(TmpSessions.Value); ObjectUtils.SerializeObject(User, bw); - } } } diff --git a/src/TgSharp.TL/TL/Auth/TLAuthorizationSignUpRequired.cs b/src/TgSharp.TL/TL/Auth/TLAuthorizationSignUpRequired.cs new file mode 100644 index 0000000..63ac859 --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLAuthorizationSignUpRequired.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(1148485274)] + public class TLAuthorizationSignUpRequired : TLAbsAuthorization + { + public override int Constructor + { + get + { + return 1148485274; + } + } + + public int Flags { get; set; } + public Help.TLTermsOfService TermsOfService { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + TermsOfService = (Help.TLTermsOfService)ObjectUtils.DeserializeObject(br); + else + TermsOfService = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(TermsOfService, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs b/src/TgSharp.TL/TL/Auth/TLCodeTypeCall.cs similarity index 81% rename from src/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs rename to src/TgSharp.TL/TL/Auth/TLCodeTypeCall.cs index 2c7e702..28c3719 100644 --- a/src/TeleSharp.TL/TL/Auth/TLCodeTypeCall.cs +++ b/src/TgSharp.TL/TL/Auth/TLCodeTypeCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1948046307)] public class TLCodeTypeCall : TLAbsCodeType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Auth } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs b/src/TgSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs similarity index 81% rename from src/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs rename to src/TgSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs index 8a08af4..e7c115e 100644 --- a/src/TeleSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs +++ b/src/TgSharp.TL/TL/Auth/TLCodeTypeFlashCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(577556219)] public class TLCodeTypeFlashCall : TLAbsCodeType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Auth } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs b/src/TgSharp.TL/TL/Auth/TLCodeTypeSms.cs similarity index 81% rename from src/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs rename to src/TgSharp.TL/TL/Auth/TLCodeTypeSms.cs index c7279cd..2fbed24 100644 --- a/src/TeleSharp.TL/TL/Auth/TLCodeTypeSms.cs +++ b/src/TgSharp.TL/TL/Auth/TLCodeTypeSms.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1923290508)] public class TLCodeTypeSms : TLAbsCodeType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Auth } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs b/src/TgSharp.TL/TL/Auth/TLExportedAuthorization.cs similarity index 92% rename from src/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs rename to src/TgSharp.TL/TL/Auth/TLExportedAuthorization.cs index 0870e0c..51c6a5d 100644 --- a/src/TeleSharp.TL/TL/Auth/TLExportedAuthorization.cs +++ b/src/TgSharp.TL/TL/Auth/TLExportedAuthorization.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-543777747)] public class TLExportedAuthorization : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Auth public int Id { get; set; } public byte[] Bytes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Auth bw.Write(Constructor); bw.Write(Id); BytesUtil.Serialize(Bytes, bw); - } } } diff --git a/src/TgSharp.TL/TL/Auth/TLLoginToken.cs b/src/TgSharp.TL/TL/Auth/TLLoginToken.cs new file mode 100644 index 0000000..4834d49 --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLLoginToken.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(1654593920)] + public class TLLoginToken : TLAbsLoginToken + { + public override int Constructor + { + get + { + return 1654593920; + } + } + + public int Expires { get; set; } + public byte[] Token { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Expires = br.ReadInt32(); + Token = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Expires); + BytesUtil.Serialize(Token, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Auth/TLLoginTokenMigrateTo.cs b/src/TgSharp.TL/TL/Auth/TLLoginTokenMigrateTo.cs new file mode 100644 index 0000000..480f5fa --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLLoginTokenMigrateTo.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(110008598)] + public class TLLoginTokenMigrateTo : TLAbsLoginToken + { + public override int Constructor + { + get + { + return 110008598; + } + } + + public int DcId { get; set; } + public byte[] Token { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + DcId = br.ReadInt32(); + Token = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(DcId); + BytesUtil.Serialize(Token, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Auth/TLLoginTokenSuccess.cs b/src/TgSharp.TL/TL/Auth/TLLoginTokenSuccess.cs new file mode 100644 index 0000000..cf34520 --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLLoginTokenSuccess.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(957176926)] + public class TLLoginTokenSuccess : TLAbsLoginToken + { + public override int Constructor + { + get + { + return 957176926; + } + } + + public Auth.TLAbsAuthorization Authorization { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Authorization = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Authorization, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs b/src/TgSharp.TL/TL/Auth/TLPasswordRecovery.cs similarity index 91% rename from src/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs rename to src/TgSharp.TL/TL/Auth/TLPasswordRecovery.cs index 4beccff..57eec55 100644 --- a/src/TeleSharp.TL/TL/Auth/TLPasswordRecovery.cs +++ b/src/TgSharp.TL/TL/Auth/TLPasswordRecovery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(326715557)] public class TLPasswordRecovery : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Auth public string EmailPattern { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { EmailPattern = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(EmailPattern, bw); - } } } diff --git a/src/TgSharp.TL/TL/Auth/TLRequestAcceptLoginToken.cs b/src/TgSharp.TL/TL/Auth/TLRequestAcceptLoginToken.cs new file mode 100644 index 0000000..5f5b789 --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLRequestAcceptLoginToken.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(-392909491)] + public class TLRequestAcceptLoginToken : TLMethod + { + public override int Constructor + { + get + { + return -392909491; + } + } + + public byte[] Token { get; set; } + public TLAuthorization Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Token = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(Token, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAuthorization)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs b/src/TgSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs similarity index 94% rename from src/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs rename to src/TgSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs index fe236b3..74829a8 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestBindTempAuthKey.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-841733627)] public class TLRequestBindTempAuthKey : TLMethod @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Auth public byte[] EncryptedMessage { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +37,6 @@ namespace TeleSharp.TL.Auth Nonce = br.ReadInt64(); ExpiresAt = br.ReadInt32(); EncryptedMessage = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +46,11 @@ namespace TeleSharp.TL.Auth bw.Write(Nonce); bw.Write(ExpiresAt); BytesUtil.Serialize(EncryptedMessage, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs b/src/TgSharp.TL/TL/Auth/TLRequestCancelCode.cs similarity index 94% rename from src/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs rename to src/TgSharp.TL/TL/Auth/TLRequestCancelCode.cs index 5220040..3064cde 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestCancelCode.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestCancelCode.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(520357240)] public class TLRequestCancelCode : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Auth public string PhoneCodeHash { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneNumber = StringUtil.Deserialize(br); PhoneCodeHash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Auth bw.Write(Constructor); StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(PhoneCodeHash, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Auth/TLRequestCheckPassword.cs b/src/TgSharp.TL/TL/Auth/TLRequestCheckPassword.cs new file mode 100644 index 0000000..357bcfd --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLRequestCheckPassword.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(-779399914)] + public class TLRequestCheckPassword : TLMethod + { + public override int Constructor + { + get + { + return -779399914; + } + } + + public TLAbsInputCheckPasswordSRP Password { get; set; } + public Auth.TLAbsAuthorization Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Password, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs b/src/TgSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs similarity index 93% rename from src/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs rename to src/TgSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs index aa50caa..6eb8eea 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestDropTempAuthKeys.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-1907842680)] public class TLRequestDropTempAuthKeys : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Auth public TLVector ExceptAuthKeys { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ExceptAuthKeys = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(ExceptAuthKeys, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs b/src/TgSharp.TL/TL/Auth/TLRequestExportAuthorization.cs similarity index 93% rename from src/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs rename to src/TgSharp.TL/TL/Auth/TLRequestExportAuthorization.cs index 8911d2c..aa0029a 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestExportAuthorization.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestExportAuthorization.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-440401971)] public class TLRequestExportAuthorization : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Auth public int DcId { get; set; } public Auth.TLExportedAuthorization Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { DcId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(DcId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Auth.TLExportedAuthorization)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Auth/TLRequestExportLoginToken.cs b/src/TgSharp.TL/TL/Auth/TLRequestExportLoginToken.cs new file mode 100644 index 0000000..460b0e0 --- /dev/null +++ b/src/TgSharp.TL/TL/Auth/TLRequestExportLoginToken.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Auth +{ + [TLObject(-1313598185)] + public class TLRequestExportLoginToken : TLMethod + { + public override int Constructor + { + get + { + return -1313598185; + } + } + + public int ApiId { get; set; } + public string ApiHash { get; set; } + public TLVector ExceptIds { get; set; } + public Auth.TLAbsLoginToken Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + ApiId = br.ReadInt32(); + ApiHash = StringUtil.Deserialize(br); + ExceptIds = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(ApiId); + StringUtil.Serialize(ApiHash, bw); + ObjectUtils.SerializeObject(ExceptIds, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Auth.TLAbsLoginToken)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs b/src/TgSharp.TL/TL/Auth/TLRequestImportAuthorization.cs similarity index 81% rename from src/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs rename to src/TgSharp.TL/TL/Auth/TLRequestImportAuthorization.cs index 9b6041d..3eb7dde 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestImportAuthorization.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestImportAuthorization.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-470837741)] public class TLRequestImportAuthorization : TLMethod @@ -20,19 +22,17 @@ namespace TeleSharp.TL.Auth public int Id { get; set; } public byte[] Bytes { get; set; } - public Auth.TLAuthorization Response { get; set; } - + public Auth.TLAbsAuthorization Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Auth bw.Write(Constructor); bw.Write(Id); BytesUtil.Serialize(Bytes, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - + Response = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs b/src/TgSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs similarity index 83% rename from src/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs rename to src/TgSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs index 732ffba..e097b98 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestImportBotAuthorization.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1738800940)] public class TLRequestImportBotAuthorization : TLMethod @@ -22,13 +24,11 @@ namespace TeleSharp.TL.Auth public int ApiId { get; set; } public string ApiHash { get; set; } public string BotAuthToken { get; set; } - public Auth.TLAuthorization Response { get; set; } - + public Auth.TLAbsAuthorization Response { get; set; } public void ComputeFlags() { - Flags = 0; - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,23 +37,20 @@ namespace TeleSharp.TL.Auth ApiId = br.ReadInt32(); ApiHash = StringUtil.Deserialize(br); BotAuthToken = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(ApiId); StringUtil.Serialize(ApiHash, bw); StringUtil.Serialize(BotAuthToken, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - + Response = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs b/src/TgSharp.TL/TL/Auth/TLRequestImportLoginToken.cs similarity index 58% rename from src/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs rename to src/TgSharp.TL/TL/Auth/TLRequestImportLoginToken.cs index dd7c6fc..882aec6 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestCheckPassword.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestImportLoginToken.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { - [TLObject(174260510)] - public class TLRequestCheckPassword : TLMethod + [TLObject(-1783866140)] + public class TLRequestImportLoginToken : TLMethod { public override int Constructor { get { - return 174260510; + return -1783866140; } } - public byte[] PasswordHash { get; set; } - public Auth.TLAuthorization Response { get; set; } - + public byte[] Token { get; set; } + public Auth.TLAbsLoginToken Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - PasswordHash = BytesUtil.Deserialize(br); - + Token = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BytesUtil.Serialize(PasswordHash, bw); - + BytesUtil.Serialize(Token, bw); } + public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - + Response = (Auth.TLAbsLoginToken)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs b/src/TgSharp.TL/TL/Auth/TLRequestLogOut.cs similarity index 86% rename from src/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs rename to src/TgSharp.TL/TL/Auth/TLRequestLogOut.cs index 3d207ae..ac189af 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestLogOut.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestLogOut.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1461180992)] public class TLRequestLogOut : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Auth public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs b/src/TgSharp.TL/TL/Auth/TLRequestRecoverPassword.cs similarity index 79% rename from src/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs rename to src/TgSharp.TL/TL/Auth/TLRequestRecoverPassword.cs index 7ebfe41..7db0596 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestRecoverPassword.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestRecoverPassword.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1319464594)] public class TLRequestRecoverPassword : TLMethod @@ -19,30 +21,27 @@ namespace TeleSharp.TL.Auth } public string Code { get; set; } - public Auth.TLAuthorization Response { get; set; } - + public Auth.TLAbsAuthorization Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Code = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Code, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - + Response = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs b/src/TgSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs similarity index 87% rename from src/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs rename to src/TgSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs index 05a240d..b784f6b 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestRequestPasswordRecovery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-661144474)] public class TLRequestRequestPasswordRecovery : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Auth public Auth.TLPasswordRecovery Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Auth.TLPasswordRecovery)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs b/src/TgSharp.TL/TL/Auth/TLRequestResendCode.cs similarity index 94% rename from src/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs rename to src/TgSharp.TL/TL/Auth/TLRequestResendCode.cs index 6ca3d44..bbab800 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestResendCode.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestResendCode.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1056025023)] public class TLRequestResendCode : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Auth public string PhoneCodeHash { get; set; } public Auth.TLSentCode Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneNumber = StringUtil.Deserialize(br); PhoneCodeHash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Auth bw.Write(Constructor); StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(PhoneCodeHash, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs b/src/TgSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs similarity index 86% rename from src/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs rename to src/TgSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs index 7c2aad5..6dd5d46 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestResetAuthorizations.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-1616179942)] public class TLRequestResetAuthorizations : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Auth public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs b/src/TgSharp.TL/TL/Auth/TLRequestSendCode.cs similarity index 59% rename from src/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs rename to src/TgSharp.TL/TL/Auth/TLRequestSendCode.cs index 74950a6..62122ca 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestSendCode.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestSendCode.cs @@ -4,69 +4,53 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { - [TLObject(-2035355412)] + [TLObject(-1502141361)] public class TLRequestSendCode : TLMethod { public override int Constructor { get { - return -2035355412; + return -1502141361; } } - public int Flags { get; set; } - public bool AllowFlashcall { get; set; } public string PhoneNumber { get; set; } - public bool? CurrentNumber { get; set; } public int ApiId { get; set; } public string ApiHash { get; set; } + public TLCodeSettings Settings { get; set; } public Auth.TLSentCode Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = AllowFlashcall ? (Flags | 1) : (Flags & ~1); - Flags = CurrentNumber != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Flags = br.ReadInt32(); - AllowFlashcall = (Flags & 1) != 0; PhoneNumber = StringUtil.Deserialize(br); - if ((Flags & 1) != 0) - CurrentNumber = BoolUtil.Deserialize(br); - else - CurrentNumber = null; - ApiId = br.ReadInt32(); ApiHash = StringUtil.Deserialize(br); - + Settings = (TLCodeSettings)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); - StringUtil.Serialize(PhoneNumber, bw); - if ((Flags & 1) != 0) - BoolUtil.Serialize(CurrentNumber.Value, bw); bw.Write(ApiId); StringUtil.Serialize(ApiHash, bw); - + ObjectUtils.SerializeObject(Settings, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs b/src/TgSharp.TL/TL/Auth/TLRequestSignIn.cs similarity index 84% rename from src/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs rename to src/TgSharp.TL/TL/Auth/TLRequestSignIn.cs index 5f6ee13..afd19f2 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestSignIn.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestSignIn.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-1126886015)] public class TLRequestSignIn : TLMethod @@ -21,12 +23,11 @@ namespace TeleSharp.TL.Auth public string PhoneNumber { get; set; } public string PhoneCodeHash { get; set; } public string PhoneCode { get; set; } - public Auth.TLAuthorization Response { get; set; } - + public Auth.TLAbsAuthorization Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Auth PhoneNumber = StringUtil.Deserialize(br); PhoneCodeHash = StringUtil.Deserialize(br); PhoneCode = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Auth StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(PhoneCodeHash, bw); StringUtil.Serialize(PhoneCode, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - + Response = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs b/src/TgSharp.TL/TL/Auth/TLRequestSignUp.cs similarity index 84% rename from src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs rename to src/TgSharp.TL/TL/Auth/TLRequestSignUp.cs index 2e5ee69..fcea434 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs +++ b/src/TgSharp.TL/TL/Auth/TLRequestSignUp.cs @@ -4,41 +4,40 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { - [TLObject(453408308)] + [TLObject(-2131827673)] public class TLRequestSignUp : TLMethod { public override int Constructor { get { - return 453408308; + return -2131827673; } } public string PhoneNumber { get; set; } public string PhoneCodeHash { get; set; } - public string PhoneCode { get; set; } public string FirstName { get; set; } public string LastName { get; set; } + // manual edit: TLAbsAuthorization->TLAuthorization public Auth.TLAuthorization Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneNumber = StringUtil.Deserialize(br); PhoneCodeHash = StringUtil.Deserialize(br); - PhoneCode = StringUtil.Deserialize(br); FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -46,15 +45,14 @@ namespace TeleSharp.TL.Auth bw.Write(Constructor); StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(PhoneCodeHash, bw); - StringUtil.Serialize(PhoneCode, bw); StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); - } + public override void DeserializeResponse(BinaryReader br) { + // manual edit: TLAbsAuthorization->TLAuthorization Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLSentCode.cs b/src/TgSharp.TL/TL/Auth/TLSentCode.cs similarity index 80% rename from src/TeleSharp.TL/TL/Auth/TLSentCode.cs rename to src/TgSharp.TL/TL/Auth/TLSentCode.cs index 4bf93e0..79a5dd3 100644 --- a/src/TeleSharp.TL/TL/Auth/TLSentCode.cs +++ b/src/TgSharp.TL/TL/Auth/TLSentCode.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1577067778)] public class TLSentCode : TLObject @@ -19,26 +21,19 @@ namespace TeleSharp.TL.Auth } public int Flags { get; set; } - public bool PhoneRegistered { get; set; } public Auth.TLAbsSentCodeType Type { get; set; } public string PhoneCodeHash { get; set; } public Auth.TLAbsCodeType NextType { get; set; } public int? Timeout { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = PhoneRegistered ? (Flags | 1) : (Flags & ~1); - Flags = NextType != null ? (Flags | 2) : (Flags & ~2); - Flags = Timeout != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); - PhoneRegistered = (Flags & 1) != 0; Type = (Auth.TLAbsSentCodeType)ObjectUtils.DeserializeObject(br); PhoneCodeHash = StringUtil.Deserialize(br); if ((Flags & 2) != 0) @@ -51,22 +46,18 @@ namespace TeleSharp.TL.Auth else Timeout = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Type, bw); StringUtil.Serialize(PhoneCodeHash, bw); if ((Flags & 2) != 0) ObjectUtils.SerializeObject(NextType, bw); if ((Flags & 4) != 0) bw.Write(Timeout.Value); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeApp.cs similarity index 91% rename from src/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs rename to src/TgSharp.TL/TL/Auth/TLSentCodeTypeApp.cs index 5a0bb4f..9ea40ae 100644 --- a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeApp.cs +++ b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeApp.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1035688326)] public class TLSentCodeTypeApp : TLAbsSentCodeType @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Auth public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeCall.cs similarity index 91% rename from src/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs rename to src/TgSharp.TL/TL/Auth/TLSentCodeTypeCall.cs index bc54ddb..6a1ea06 100644 --- a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeCall.cs +++ b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(1398007207)] public class TLSentCodeTypeCall : TLAbsSentCodeType @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Auth public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs similarity index 91% rename from src/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs rename to src/TgSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs index bb64cb6..5051656 100644 --- a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs +++ b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeFlashCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-1425815847)] public class TLSentCodeTypeFlashCall : TLAbsSentCodeType @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Auth public string Pattern { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Pattern = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Pattern, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeSms.cs similarity index 91% rename from src/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs rename to src/TgSharp.TL/TL/Auth/TLSentCodeTypeSms.cs index 4acd129..eb092ac 100644 --- a/src/TeleSharp.TL/TL/Auth/TLSentCodeTypeSms.cs +++ b/src/TgSharp.TL/TL/Auth/TLSentCodeTypeSms.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Auth { [TLObject(-1073693790)] public class TLSentCodeTypeSms : TLAbsSentCodeType @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Auth public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/Bots/TLRequestAnswerWebhookJSONQuery.cs b/src/TgSharp.TL/TL/Bots/TLRequestAnswerWebhookJSONQuery.cs similarity index 93% rename from src/TeleSharp.TL/TL/Bots/TLRequestAnswerWebhookJSONQuery.cs rename to src/TgSharp.TL/TL/Bots/TLRequestAnswerWebhookJSONQuery.cs index 7ca0f93..67fa061 100644 --- a/src/TeleSharp.TL/TL/Bots/TLRequestAnswerWebhookJSONQuery.cs +++ b/src/TgSharp.TL/TL/Bots/TLRequestAnswerWebhookJSONQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Bots + +using TgSharp.TL; + +namespace TgSharp.TL.Bots { [TLObject(-434028723)] public class TLRequestAnswerWebhookJSONQuery : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Bots public TLDataJSON Data { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { QueryId = br.ReadInt64(); Data = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Bots bw.Write(Constructor); bw.Write(QueryId); ObjectUtils.SerializeObject(Data, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Bots/TLRequestSendCustomRequest.cs b/src/TgSharp.TL/TL/Bots/TLRequestSendCustomRequest.cs similarity index 94% rename from src/TeleSharp.TL/TL/Bots/TLRequestSendCustomRequest.cs rename to src/TgSharp.TL/TL/Bots/TLRequestSendCustomRequest.cs index 8da3fb8..8b86227 100644 --- a/src/TeleSharp.TL/TL/Bots/TLRequestSendCustomRequest.cs +++ b/src/TgSharp.TL/TL/Bots/TLRequestSendCustomRequest.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Bots + +using TgSharp.TL; + +namespace TgSharp.TL.Bots { [TLObject(-1440257555)] public class TLRequestSendCustomRequest : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Bots public TLDataJSON Params { get; set; } public TLDataJSON Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { CustomMethod = StringUtil.Deserialize(br); Params = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Bots bw.Write(Constructor); StringUtil.Serialize(CustomMethod, bw); ObjectUtils.SerializeObject(Params, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLAbsChannelParticipants.cs b/src/TgSharp.TL/TL/Channels/TLAbsChannelParticipants.cs new file mode 100644 index 0000000..8b5edfa --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLAbsChannelParticipants.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + public abstract class TLAbsChannelParticipants : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/Channels/TLAdminLogResults.cs b/src/TgSharp.TL/TL/Channels/TLAdminLogResults.cs new file mode 100644 index 0000000..3d8eebb --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLAdminLogResults.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-309659827)] + public class TLAdminLogResults : TLObject + { + public override int Constructor + { + get + { + return -309659827; + } + } + + public TLVector Events { get; set; } + public TLVector Chats { get; set; } + public TLVector Users { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Events = (TLVector)ObjectUtils.DeserializeVector(br); + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + Users = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Events, bw); + ObjectUtils.SerializeObject(Chats, bw); + ObjectUtils.SerializeObject(Users, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs b/src/TgSharp.TL/TL/Channels/TLChannelParticipant.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs rename to src/TgSharp.TL/TL/Channels/TLChannelParticipant.cs index bd9045d..8038163 100644 --- a/src/TeleSharp.TL/TL/Channels/TLChannelParticipant.cs +++ b/src/TgSharp.TL/TL/Channels/TLChannelParticipant.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-791039645)] public class TLChannelParticipant : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Channels public TLAbsChannelParticipant Participant { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Participant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Participant, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs b/src/TgSharp.TL/TL/Channels/TLChannelParticipants.cs similarity index 88% rename from src/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs rename to src/TgSharp.TL/TL/Channels/TLChannelParticipants.cs index ac6650f..918033e 100644 --- a/src/TeleSharp.TL/TL/Channels/TLChannelParticipants.cs +++ b/src/TgSharp.TL/TL/Channels/TLChannelParticipants.cs @@ -4,11 +4,13 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-177282392)] - public class TLChannelParticipants : TLObject + public class TLChannelParticipants : TLAbsChannelParticipants { public override int Constructor { @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Channels public TLVector Participants { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Channels Count = br.ReadInt32(); Participants = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Channels bw.Write(Count); ObjectUtils.SerializeObject(Participants, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLChannelParticipantsNotModified.cs b/src/TgSharp.TL/TL/Channels/TLChannelParticipantsNotModified.cs new file mode 100644 index 0000000..0a7b5b9 --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLChannelParticipantsNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-266911767)] + public class TLChannelParticipantsNotModified : TLAbsChannelParticipants + { + public override int Constructor + { + get + { + return -266911767; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs b/src/TgSharp.TL/TL/Channels/TLRequestCheckUsername.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs rename to src/TgSharp.TL/TL/Channels/TLRequestCheckUsername.cs index e22d5e1..f7a9e7a 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestCheckUsername.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestCheckUsername.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(283557164)] public class TLRequestCheckUsername : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public string Username { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); StringUtil.Serialize(Username, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestCreateChannel.cs similarity index 64% rename from src/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestCreateChannel.cs index ccd557d..bdf3e6d 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestCreateChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestCreateChannel.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-192332417)] + [TLObject(1029681423)] public class TLRequestCreateChannel : TLMethod { public override int Constructor { get { - return -192332417; + return 1029681423; } } @@ -23,15 +25,13 @@ namespace TeleSharp.TL.Channels public bool Megagroup { get; set; } public string Title { get; set; } public string About { get; set; } + public TLAbsInputGeoPoint GeoPoint { get; set; } + public string Address { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Broadcast ? (Flags | 1) : (Flags & ~1); - Flags = Megagroup ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,24 +41,33 @@ namespace TeleSharp.TL.Channels Megagroup = (Flags & 2) != 0; Title = StringUtil.Deserialize(br); About = StringUtil.Deserialize(br); + if ((Flags & 4) != 0) + GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); + else + GeoPoint = null; + + if ((Flags & 4) != 0) + Address = StringUtil.Deserialize(br); + else + Address = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - StringUtil.Serialize(Title, bw); StringUtil.Serialize(About, bw); - + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(GeoPoint, bw); + if ((Flags & 4) != 0) + StringUtil.Serialize(Address, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestDeleteChannel.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestDeleteChannel.cs index 13687c3..c98f7c2 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestDeleteChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestDeleteChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-1072619549)] public class TLRequestDeleteChannel : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Channels public TLAbsInputChannel Channel { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs b/src/TgSharp.TL/TL/Channels/TLRequestDeleteHistory.cs similarity index 74% rename from src/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs rename to src/TgSharp.TL/TL/Channels/TLRequestDeleteHistory.cs index 77b480a..d3db0f7 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestEditAbout.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestDeleteHistory.cs @@ -4,48 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(333610782)] - public class TLRequestEditAbout : TLMethod + [TLObject(-1355375294)] + public class TLRequestDeleteHistory : TLMethod { public override int Constructor { get { - return 333610782; + return -1355375294; } } public TLAbsInputChannel Channel { get; set; } - public string About { get; set; } + public int MaxId { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - About = StringUtil.Deserialize(br); - + MaxId = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - StringUtil.Serialize(About, bw); - + bw.Write(MaxId); } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs b/src/TgSharp.TL/TL/Channels/TLRequestDeleteMessages.cs similarity index 94% rename from src/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs rename to src/TgSharp.TL/TL/Channels/TLRequestDeleteMessages.cs index bdc4cb9..c8a654e 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestDeleteMessages.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestDeleteMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-2067661490)] public class TLRequestDeleteMessages : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public TLVector Id { get; set; } public Messages.TLAffectedMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs b/src/TgSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs similarity index 94% rename from src/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs rename to src/TgSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs index f1c9ece..49979ad 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestDeleteUserHistory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-787622117)] public class TLRequestDeleteUserHistory : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public TLAbsInputUser UserId { get; set; } public Messages.TLAffectedHistory Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(UserId, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAffectedHistory)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLRequestEditAdmin.cs b/src/TgSharp.TL/TL/Channels/TLRequestEditAdmin.cs new file mode 100644 index 0000000..1d351d2 --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestEditAdmin.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-751007486)] + public class TLRequestEditAdmin : TLMethod + { + public override int Constructor + { + get + { + return -751007486; + } + } + + public TLAbsInputChannel Channel { get; set; } + public TLAbsInputUser UserId { get; set; } + public TLChatAdminRights AdminRights { get; set; } + public string Rank { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + AdminRights = (TLChatAdminRights)ObjectUtils.DeserializeObject(br); + Rank = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Channel, bw); + ObjectUtils.SerializeObject(UserId, bw); + ObjectUtils.SerializeObject(AdminRights, bw); + StringUtil.Serialize(Rank, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs b/src/TgSharp.TL/TL/Channels/TLRequestEditBanned.cs similarity index 73% rename from src/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs rename to src/TgSharp.TL/TL/Channels/TLRequestEditBanned.cs index da2885b..b9798f1 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestEditAdmin.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestEditBanned.cs @@ -4,37 +4,37 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-344583728)] - public class TLRequestEditAdmin : TLMethod + [TLObject(1920559378)] + public class TLRequestEditBanned : TLMethod { public override int Constructor { get { - return -344583728; + return 1920559378; } } public TLAbsInputChannel Channel { get; set; } public TLAbsInputUser UserId { get; set; } - public TLAbsChannelParticipantRole Role { get; set; } + public TLChatBannedRights BannedRights { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - Role = (TLAbsChannelParticipantRole)ObjectUtils.DeserializeObject(br); - + BannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -42,13 +42,12 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(UserId, bw); - ObjectUtils.SerializeObject(Role, bw); - + ObjectUtils.SerializeObject(BannedRights, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestEditCreator.cs similarity index 73% rename from src/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestEditCreator.cs index 2c3834e..f67f870 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestKickFromChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestEditCreator.cs @@ -4,37 +4,37 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-1502421484)] - public class TLRequestKickFromChannel : TLMethod + [TLObject(-1892102881)] + public class TLRequestEditCreator : TLMethod { public override int Constructor { get { - return -1502421484; + return -1892102881; } } public TLAbsInputChannel Channel { get; set; } public TLAbsInputUser UserId { get; set; } - public bool Kicked { get; set; } + public TLAbsInputCheckPasswordSRP Password { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - Kicked = BoolUtil.Deserialize(br); - + Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -42,13 +42,12 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(UserId, bw); - BoolUtil.Serialize(Kicked, bw); - + ObjectUtils.SerializeObject(Password, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLRequestEditLocation.cs b/src/TgSharp.TL/TL/Channels/TLRequestEditLocation.cs new file mode 100644 index 0000000..e615478 --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestEditLocation.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(1491484525)] + public class TLRequestEditLocation : TLMethod + { + public override int Constructor + { + get + { + return 1491484525; + } + } + + public TLAbsInputChannel Channel { get; set; } + public TLAbsInputGeoPoint GeoPoint { get; set; } + public string Address { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); + Address = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Channel, bw); + ObjectUtils.SerializeObject(GeoPoint, bw); + StringUtil.Serialize(Address, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs b/src/TgSharp.TL/TL/Channels/TLRequestEditPhoto.cs similarity index 94% rename from src/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs rename to src/TgSharp.TL/TL/Channels/TLRequestEditPhoto.cs index e909bb8..eec079f 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestEditPhoto.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestEditPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-248621111)] public class TLRequestEditPhoto : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public TLAbsInputChatPhoto Photo { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Photo = (TLAbsInputChatPhoto)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(Photo, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs b/src/TgSharp.TL/TL/Channels/TLRequestEditTitle.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs rename to src/TgSharp.TL/TL/Channels/TLRequestEditTitle.cs index 891d708..0485708 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestEditTitle.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestEditTitle.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(1450044624)] public class TLRequestEditTitle : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public string Title { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); StringUtil.Serialize(Title, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs b/src/TgSharp.TL/TL/Channels/TLRequestExportMessageLink.cs similarity index 79% rename from src/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs rename to src/TgSharp.TL/TL/Channels/TLRequestExportMessageLink.cs index 01cd2d8..f3776fd 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestExportMessageLink.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestExportMessageLink.cs @@ -4,35 +4,37 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-934882771)] + [TLObject(-826838685)] public class TLRequestExportMessageLink : TLMethod { public override int Constructor { get { - return -934882771; + return -826838685; } } public TLAbsInputChannel Channel { get; set; } public int Id { get; set; } + public bool Grouped { get; set; } public TLExportedMessageLink Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Id = br.ReadInt32(); - + Grouped = BoolUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +42,12 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); bw.Write(Id); - + BoolUtil.Serialize(Grouped, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLExportedMessageLink)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLRequestGetAdminLog.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetAdminLog.cs new file mode 100644 index 0000000..deca39f --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetAdminLog.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(870184064)] + public class TLRequestGetAdminLog : TLMethod + { + public override int Constructor + { + get + { + return 870184064; + } + } + + public int Flags { get; set; } + public TLAbsInputChannel Channel { get; set; } + public string Q { get; set; } + public TLChannelAdminLogEventsFilter EventsFilter { get; set; } + public TLVector Admins { get; set; } + public long MaxId { get; set; } + public long MinId { get; set; } + public int Limit { get; set; } + public Channels.TLAdminLogResults Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + Q = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + EventsFilter = (TLChannelAdminLogEventsFilter)ObjectUtils.DeserializeObject(br); + else + EventsFilter = null; + + if ((Flags & 2) != 0) + Admins = (TLVector)ObjectUtils.DeserializeVector(br); + else + Admins = null; + + MaxId = br.ReadInt64(); + MinId = br.ReadInt64(); + Limit = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Channel, bw); + StringUtil.Serialize(Q, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(EventsFilter, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Admins, bw); + bw.Write(MaxId); + bw.Write(MinId); + bw.Write(Limit); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Channels.TLAdminLogResults)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs new file mode 100644 index 0000000..cf8f613 --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-122669393)] + public class TLRequestGetAdminedPublicChannels : TLMethod + { + public override int Constructor + { + get + { + return -122669393; + } + } + + public int Flags { get; set; } + public bool ByLocation { get; set; } + public bool CheckLimit { get; set; } + public Messages.TLAbsChats Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + ByLocation = (Flags & 1) != 0; + CheckLimit = (Flags & 2) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetChannels.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs rename to src/TgSharp.TL/TL/Channels/TLRequestGetChannels.cs index d5ed38f..d425a14 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestGetChannels.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetChannels.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(176122811)] public class TLRequestGetChannels : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Channels public TLVector Id { get; set; } public Messages.TLAbsChats Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetFullChannel.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestGetFullChannel.cs index 48b587c..06542e8 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestGetFullChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetFullChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(141781513)] public class TLRequestGetFullChannel : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Channels public TLAbsInputChannel Channel { get; set; } public Messages.TLChatFull Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLChatFull)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetGroupsForDiscussion.cs similarity index 74% rename from src/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs rename to src/TgSharp.TL/TL/Channels/TLRequestGetGroupsForDiscussion.cs index 0409b56..5f1d42d 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestGetAdminedPublicChannels.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetGroupsForDiscussion.cs @@ -4,42 +4,43 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-1920105769)] - public class TLRequestGetAdminedPublicChannels : TLMethod + [TLObject(-170208392)] + public class TLRequestGetGroupsForDiscussion : TLMethod { public override int Constructor { get { - return -1920105769; + return -170208392; } } public Messages.TLAbsChats Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLRequestGetInactiveChannels.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetInactiveChannels.cs new file mode 100644 index 0000000..fe98371 --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetInactiveChannels.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(300429806)] + public class TLRequestGetInactiveChannels : TLMethod + { + public override int Constructor + { + get + { + return 300429806; + } + } + + public Messages.TLInactiveChats Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLInactiveChats)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Channels/TLRequestGetLeftChannels.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetLeftChannels.cs new file mode 100644 index 0000000..c144eff --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetLeftChannels.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-2092831552)] + public class TLRequestGetLeftChannels : TLMethod + { + public override int Constructor + { + get + { + return -2092831552; + } + } + + public int Offset { get; set; } + public Messages.TLAbsChats Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetMessages.cs similarity index 77% rename from src/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs rename to src/TgSharp.TL/TL/Channels/TLRequestGetMessages.cs index 0469921..73f1ecc 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestGetMessages.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetMessages.cs @@ -4,35 +4,35 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-1814580409)] + [TLObject(-1383294429)] public class TLRequestGetMessages : TLMethod { public override int Constructor { get { - return -1814580409; + return -1383294429; } } public TLAbsInputChannel Channel { get; set; } - public TLVector Id { get; set; } + public TLVector Id { get; set; } public Messages.TLAbsMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - Id = (TLVector)ObjectUtils.DeserializeVector(br); - + Id = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetParticipant.cs similarity index 94% rename from src/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs rename to src/TgSharp.TL/TL/Channels/TLRequestGetParticipant.cs index 954d527..4dd1a7e 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestGetParticipant.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetParticipant.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(1416484774)] public class TLRequestGetParticipant : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public TLAbsInputUser UserId { get; set; } public Channels.TLChannelParticipant Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(UserId, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Channels.TLChannelParticipant)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs b/src/TgSharp.TL/TL/Channels/TLRequestGetParticipants.cs similarity index 75% rename from src/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs rename to src/TgSharp.TL/TL/Channels/TLRequestGetParticipants.cs index ab7f76b..a711224 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestGetParticipants.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestGetParticipants.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(618237842)] + [TLObject(306054633)] public class TLRequestGetParticipants : TLMethod { public override int Constructor { get { - return 618237842; + return 306054633; } } @@ -22,12 +24,12 @@ namespace TeleSharp.TL.Channels public TLAbsChannelParticipantsFilter Filter { get; set; } public int Offset { get; set; } public int Limit { get; set; } - public Channels.TLChannelParticipants Response { get; set; } - + public int Hash { get; set; } + public Channels.TLAbsChannelParticipants Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +38,7 @@ namespace TeleSharp.TL.Channels Filter = (TLAbsChannelParticipantsFilter)ObjectUtils.DeserializeObject(br); Offset = br.ReadInt32(); Limit = br.ReadInt32(); - + Hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +48,12 @@ namespace TeleSharp.TL.Channels ObjectUtils.SerializeObject(Filter, bw); bw.Write(Offset); bw.Write(Limit); - + bw.Write(Hash); } + public override void DeserializeResponse(BinaryReader br) { - Response = (Channels.TLChannelParticipants)ObjectUtils.DeserializeObject(br); - + Response = (Channels.TLAbsChannelParticipants)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestInviteToChannel.cs similarity index 94% rename from src/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestInviteToChannel.cs index 9cb97c5..f8cd13a 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestInviteToChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestInviteToChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(429865580)] public class TLRequestInviteToChannel : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public TLVector Users { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(Users, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestJoinChannel.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestJoinChannel.cs index 6a46ca4..605ebcb 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestJoinChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestJoinChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(615851205)] public class TLRequestJoinChannel : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Channels public TLAbsInputChannel Channel { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs b/src/TgSharp.TL/TL/Channels/TLRequestLeaveChannel.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs rename to src/TgSharp.TL/TL/Channels/TLRequestLeaveChannel.cs index 6acdee0..5b11e5d 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestLeaveChannel.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestLeaveChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-130635115)] public class TLRequestLeaveChannel : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Channels public TLAbsInputChannel Channel { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs b/src/TgSharp.TL/TL/Channels/TLRequestReadHistory.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs rename to src/TgSharp.TL/TL/Channels/TLRequestReadHistory.cs index c3fea5e..2cb04d0 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestReadHistory.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestReadHistory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-871347913)] public class TLRequestReadHistory : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public int MaxId { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); MaxId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); bw.Write(MaxId); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLRequestReadMessageContents.cs b/src/TgSharp.TL/TL/Channels/TLRequestReadMessageContents.cs new file mode 100644 index 0000000..62c10c3 --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestReadMessageContents.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-357180360)] + public class TLRequestReadMessageContents : TLMethod + { + public override int Constructor + { + get + { + return -357180360; + } + } + + public TLAbsInputChannel Channel { get; set; } + public TLVector Id { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + Id = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Channel, bw); + ObjectUtils.SerializeObject(Id, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs b/src/TgSharp.TL/TL/Channels/TLRequestReportSpam.cs similarity index 94% rename from src/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs rename to src/TgSharp.TL/TL/Channels/TLRequestReportSpam.cs index b948586..4b17a15 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestReportSpam.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestReportSpam.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(-32999408)] public class TLRequestReportSpam : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Channels public TLVector Id { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Channels Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Channels ObjectUtils.SerializeObject(Channel, bw); ObjectUtils.SerializeObject(UserId, bw); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs b/src/TgSharp.TL/TL/Channels/TLRequestSetDiscussionGroup.cs similarity index 55% rename from src/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs rename to src/TgSharp.TL/TL/Channels/TLRequestSetDiscussionGroup.cs index 3f894bb..7722653 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestSendInvites.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestSetDiscussionGroup.cs @@ -4,48 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(1998331287)] - public class TLRequestSendInvites : TLMethod + [TLObject(1079520178)] + public class TLRequestSetDiscussionGroup : TLMethod { public override int Constructor { get { - return 1998331287; + return 1079520178; } } - public TLVector PhoneNumbers { get; set; } - public string Message { get; set; } + public TLAbsInputChannel Broadcast { get; set; } + public TLAbsInputChannel Group { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - PhoneNumbers = (TLVector)ObjectUtils.DeserializeVector(br); - Message = StringUtil.Deserialize(br); - + Broadcast = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + Group = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ObjectUtils.SerializeObject(PhoneNumbers, bw); - StringUtil.Serialize(Message, bw); - + ObjectUtils.SerializeObject(Broadcast, bw); + ObjectUtils.SerializeObject(Group, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Channels/TLRequestSetStickers.cs b/src/TgSharp.TL/TL/Channels/TLRequestSetStickers.cs new file mode 100644 index 0000000..5bde58d --- /dev/null +++ b/src/TgSharp.TL/TL/Channels/TLRequestSetStickers.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Channels +{ + [TLObject(-359881479)] + public class TLRequestSetStickers : TLMethod + { + public override int Constructor + { + get + { + return -359881479; + } + } + + public TLAbsInputChannel Channel { get; set; } + public TLAbsInputStickerSet Stickerset { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + Stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Channel, bw); + ObjectUtils.SerializeObject(Stickerset, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs b/src/TgSharp.TL/TL/Channels/TLRequestTogglePreHistoryHidden.cs similarity index 84% rename from src/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs rename to src/TgSharp.TL/TL/Channels/TLRequestTogglePreHistoryHidden.cs index 7dc57ea..a4904dd 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestToggleInvites.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestTogglePreHistoryHidden.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(1231065863)] - public class TLRequestToggleInvites : TLMethod + [TLObject(-356796084)] + public class TLRequestTogglePreHistoryHidden : TLMethod { public override int Constructor { get { - return 1231065863; + return -356796084; } } @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public bool Enabled { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Enabled = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); BoolUtil.Serialize(Enabled, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs b/src/TgSharp.TL/TL/Channels/TLRequestToggleSignatures.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs rename to src/TgSharp.TL/TL/Channels/TLRequestToggleSignatures.cs index daecd4d..c75d679 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestToggleSignatures.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestToggleSignatures.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(527021574)] public class TLRequestToggleSignatures : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public bool Enabled { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Enabled = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); BoolUtil.Serialize(Enabled, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs b/src/TgSharp.TL/TL/Channels/TLRequestToggleSlowMode.cs similarity index 65% rename from src/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs rename to src/TgSharp.TL/TL/Channels/TLRequestToggleSlowMode.cs index 0f287be..42e2ad1 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestExportInvite.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestToggleSlowMode.cs @@ -4,45 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { - [TLObject(-950663035)] - public class TLRequestExportInvite : TLMethod + [TLObject(-304832784)] + public class TLRequestToggleSlowMode : TLMethod { public override int Constructor { get { - return -950663035; + return -304832784; } } public TLAbsInputChannel Channel { get; set; } - public TLAbsExportedChatInvite Response { get; set; } - + public int Seconds { get; set; } + public TLAbsUpdates Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); - + Seconds = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - + bw.Write(Seconds); } + public override void DeserializeResponse(BinaryReader br) { - Response = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); - + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs b/src/TgSharp.TL/TL/Channels/TLRequestUpdateUsername.cs similarity index 93% rename from src/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs rename to src/TgSharp.TL/TL/Channels/TLRequestUpdateUsername.cs index b5778c2..46ef28f 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestUpdateUsername.cs +++ b/src/TgSharp.TL/TL/Channels/TLRequestUpdateUsername.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Channels { [TLObject(890549214)] public class TLRequestUpdateUsername : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Channels public string Username { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); Username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Channels bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); StringUtil.Serialize(Username, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs b/src/TgSharp.TL/TL/Contacts/TLAbsBlocked.cs similarity index 79% rename from src/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs rename to src/TgSharp.TL/TL/Contacts/TLAbsBlocked.cs index 74381d8..06fa79e 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLAbsBlocked.cs +++ b/src/TgSharp.TL/TL/Contacts/TLAbsBlocked.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { public abstract class TLAbsBlocked : TLObject { diff --git a/src/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs b/src/TgSharp.TL/TL/Contacts/TLAbsContacts.cs similarity index 79% rename from src/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs rename to src/TgSharp.TL/TL/Contacts/TLAbsContacts.cs index bb97ae3..10aee0a 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLAbsContacts.cs +++ b/src/TgSharp.TL/TL/Contacts/TLAbsContacts.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { public abstract class TLAbsContacts : TLObject { diff --git a/src/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs b/src/TgSharp.TL/TL/Contacts/TLAbsTopPeers.cs similarity index 79% rename from src/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs rename to src/TgSharp.TL/TL/Contacts/TLAbsTopPeers.cs index f3df0c1..4ceb5fd 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLAbsTopPeers.cs +++ b/src/TgSharp.TL/TL/Contacts/TLAbsTopPeers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { public abstract class TLAbsTopPeers : TLObject { diff --git a/src/TeleSharp.TL/TL/Contacts/TLBlocked.cs b/src/TgSharp.TL/TL/Contacts/TLBlocked.cs similarity index 93% rename from src/TeleSharp.TL/TL/Contacts/TLBlocked.cs rename to src/TgSharp.TL/TL/Contacts/TLBlocked.cs index d447954..d71b071 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLBlocked.cs +++ b/src/TgSharp.TL/TL/Contacts/TLBlocked.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(471043349)] public class TLBlocked : TLAbsBlocked @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Contacts public TLVector Blocked { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Blocked = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Contacts bw.Write(Constructor); ObjectUtils.SerializeObject(Blocked, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs b/src/TgSharp.TL/TL/Contacts/TLBlockedSlice.cs similarity index 93% rename from src/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs rename to src/TgSharp.TL/TL/Contacts/TLBlockedSlice.cs index 1cd5b31..59c5acb 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLBlockedSlice.cs +++ b/src/TgSharp.TL/TL/Contacts/TLBlockedSlice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-1878523231)] public class TLBlockedSlice : TLAbsBlocked @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Contacts public TLVector Blocked { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Contacts Count = br.ReadInt32(); Blocked = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Contacts bw.Write(Count); ObjectUtils.SerializeObject(Blocked, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLContacts.cs b/src/TgSharp.TL/TL/Contacts/TLContacts.cs similarity index 78% rename from src/TeleSharp.TL/TL/Contacts/TLContacts.cs rename to src/TgSharp.TL/TL/Contacts/TLContacts.cs index aaf63af..7307a4e 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLContacts.cs +++ b/src/TgSharp.TL/TL/Contacts/TLContacts.cs @@ -4,42 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(1871416498)] + [TLObject(-353862078)] public class TLContacts : TLAbsContacts { public override int Constructor { get { - return 1871416498; + return -353862078; } } public TLVector Contacts { get; set; } + public int SavedCount { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Contacts = (TLVector)ObjectUtils.DeserializeVector(br); + SavedCount = br.ReadInt32(); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Contacts, bw); + bw.Write(SavedCount); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs b/src/TgSharp.TL/TL/Contacts/TLContactsNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs rename to src/TgSharp.TL/TL/Contacts/TLContactsNotModified.cs index ef9f2bc..3ffb80b 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLContactsNotModified.cs +++ b/src/TgSharp.TL/TL/Contacts/TLContactsNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-1219778094)] public class TLContactsNotModified : TLAbsContacts @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Contacts } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLFound.cs b/src/TgSharp.TL/TL/Contacts/TLFound.cs similarity index 76% rename from src/TeleSharp.TL/TL/Contacts/TLFound.cs rename to src/TgSharp.TL/TL/Contacts/TLFound.cs index 793e5b3..e934c53 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLFound.cs +++ b/src/TgSharp.TL/TL/Contacts/TLFound.cs @@ -4,45 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(446822276)] + [TLObject(-1290580579)] public class TLFound : TLObject { public override int Constructor { get { - return 446822276; + return -1290580579; } } + public TLVector MyResults { get; set; } public TLVector Results { get; set; } public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + MyResults = (TLVector)ObjectUtils.DeserializeVector(br); Results = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + ObjectUtils.SerializeObject(MyResults, bw); ObjectUtils.SerializeObject(Results, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs b/src/TgSharp.TL/TL/Contacts/TLImportedContacts.cs similarity index 75% rename from src/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs rename to src/TgSharp.TL/TL/Contacts/TLImportedContacts.cs index fea30b8..4b3a212 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLImportedContacts.cs +++ b/src/TgSharp.TL/TL/Contacts/TLImportedContacts.cs @@ -4,45 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(-1387117803)] + [TLObject(2010127419)] public class TLImportedContacts : TLObject { public override int Constructor { get { - return -1387117803; + return 2010127419; } } public TLVector Imported { get; set; } + public TLVector PopularInvites { get; set; } public TLVector RetryContacts { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Imported = (TLVector)ObjectUtils.DeserializeVector(br); + PopularInvites = (TLVector)ObjectUtils.DeserializeVector(br); RetryContacts = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Imported, bw); + ObjectUtils.SerializeObject(PopularInvites, bw); ObjectUtils.SerializeObject(RetryContacts, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs b/src/TgSharp.TL/TL/Contacts/TLRequestAcceptContact.cs similarity index 71% rename from src/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestAcceptContact.cs index acb9f0c..b9bf247 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestDeleteContact.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestAcceptContact.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(-1902823612)] - public class TLRequestDeleteContact : TLMethod + [TLObject(-130964977)] + public class TLRequestAcceptContact : TLMethod { public override int Constructor { get { - return -1902823612; + return -130964977; } } public TLAbsInputUser Id { get; set; } - public Contacts.TLLink Response { get; set; } - + public TLAbsUpdates Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (Contacts.TLLink)ObjectUtils.DeserializeObject(br); - + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TgSharp.TL/TL/Contacts/TLRequestAddContact.cs b/src/TgSharp.TL/TL/Contacts/TLRequestAddContact.cs new file mode 100644 index 0000000..324e224 --- /dev/null +++ b/src/TgSharp.TL/TL/Contacts/TLRequestAddContact.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts +{ + [TLObject(-386636848)] + public class TLRequestAddContact : TLMethod + { + public override int Constructor + { + get + { + return -386636848; + } + } + + public int Flags { get; set; } + public bool AddPhonePrivacyException { get; set; } + public TLAbsInputUser Id { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Phone { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + AddPhonePrivacyException = (Flags & 1) != 0; + Id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + FirstName = StringUtil.Deserialize(br); + LastName = StringUtil.Deserialize(br); + Phone = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Id, bw); + StringUtil.Serialize(FirstName, bw); + StringUtil.Serialize(LastName, bw); + StringUtil.Serialize(Phone, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs b/src/TgSharp.TL/TL/Contacts/TLRequestBlock.cs similarity index 92% rename from src/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestBlock.cs index c23f9fb..c658a87 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestBlock.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestBlock.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(858475004)] public class TLRequestBlock : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Contacts public TLAbsInputUser Id { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Contacts/TLRequestDeleteByPhones.cs b/src/TgSharp.TL/TL/Contacts/TLRequestDeleteByPhones.cs new file mode 100644 index 0000000..f83c8f5 --- /dev/null +++ b/src/TgSharp.TL/TL/Contacts/TLRequestDeleteByPhones.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts +{ + [TLObject(269745566)] + public class TLRequestDeleteByPhones : TLMethod + { + public override int Constructor + { + get + { + return 269745566; + } + } + + public TLVector Phones { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Phones = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Phones, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs b/src/TgSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs similarity index 76% rename from src/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs index b4d39ef..cb68fe9 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestDeleteContacts.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(1504393374)] + [TLObject(157945344)] public class TLRequestDeleteContacts : TLMethod { public override int Constructor { get { - return 1504393374; + return 157945344; } } public TLVector Id { get; set; } - public bool Response { get; set; } - + public TLAbsUpdates Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = BoolUtil.Deserialize(br); - + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetBlocked.cs similarity index 93% rename from src/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestGetBlocked.cs index f149bf3..118e8bd 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestGetBlocked.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetBlocked.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-176409329)] public class TLRequestGetBlocked : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Contacts public int Limit { get; set; } public Contacts.TLAbsBlocked Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Contacts bw.Write(Constructor); bw.Write(Offset); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Contacts.TLAbsBlocked)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetContactIDs.cs similarity index 71% rename from src/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestGetContactIDs.cs index 5c240ca..1bbb117 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestExportCard.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetContactIDs.cs @@ -4,42 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(-2065352905)] - public class TLRequestExportCard : TLMethod + [TLObject(749357634)] + public class TLRequestGetContactIDs : TLMethod { public override int Constructor { get { - return -2065352905; + return 749357634; } } + public int Hash { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + Hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + bw.Write(Hash); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetContacts.cs similarity index 76% rename from src/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestGetContacts.cs index 77cffcf..37a8705 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestGetContacts.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetContacts.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(583445000)] + [TLObject(-1071414113)] public class TLRequestGetContacts : TLMethod { public override int Constructor { get { - return 583445000; + return -1071414113; } } - public string Hash { get; set; } + public int Hash { get; set; } public Contacts.TLAbsContacts Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Hash = StringUtil.Deserialize(br); - + Hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - StringUtil.Serialize(Hash, bw); - + bw.Write(Hash); } + public override void DeserializeResponse(BinaryReader br) { Response = (Contacts.TLAbsContacts)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Contacts/TLRequestGetLocated.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetLocated.cs new file mode 100644 index 0000000..5158a91 --- /dev/null +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetLocated.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts +{ + [TLObject(171270230)] + public class TLRequestGetLocated : TLMethod + { + public override int Constructor + { + get + { + return 171270230; + } + } + + public TLAbsInputGeoPoint GeoPoint { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(GeoPoint, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Contacts/TLRequestGetSaved.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetSaved.cs new file mode 100644 index 0000000..caacf1d --- /dev/null +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetSaved.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts +{ + [TLObject(-2098076769)] + public class TLRequestGetSaved : TLMethod + { + public override int Constructor + { + get + { + return -2098076769; + } + } + + // manual edit: SavedContact -> TLSavedPhoneContact + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + // manual edit: SavedContact -> TLSavedPhoneContact + Response = (TLVector)ObjectUtils.DeserializeVector (br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetStatuses.cs similarity index 86% rename from src/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestGetStatuses.cs index 29853ce..1c33918 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestGetStatuses.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetStatuses.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-995929106)] public class TLRequestGetStatuses : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Contacts public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs b/src/TgSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs similarity index 78% rename from src/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs index c4f0803..1a4a33e 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-728224331)] public class TLRequestGetTopPeers : TLMethod @@ -23,6 +25,8 @@ namespace TeleSharp.TL.Contacts public bool BotsPm { get; set; } public bool BotsInline { get; set; } public bool PhoneCalls { get; set; } + public bool ForwardUsers { get; set; } + public bool ForwardChats { get; set; } public bool Groups { get; set; } public bool Channels { get; set; } public int Offset { get; set; } @@ -30,17 +34,9 @@ namespace TeleSharp.TL.Contacts public int Hash { get; set; } public Contacts.TLAbsTopPeers Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Correspondents ? (Flags | 1) : (Flags & ~1); - Flags = BotsPm ? (Flags | 2) : (Flags & ~2); - Flags = BotsInline ? (Flags | 4) : (Flags & ~4); - Flags = PhoneCalls ? (Flags | 8) : (Flags & ~8); - Flags = Groups ? (Flags | 1024) : (Flags & ~1024); - Flags = Channels ? (Flags | 32768) : (Flags & ~32768); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -50,34 +46,27 @@ namespace TeleSharp.TL.Contacts BotsPm = (Flags & 2) != 0; BotsInline = (Flags & 4) != 0; PhoneCalls = (Flags & 8) != 0; + ForwardUsers = (Flags & 16) != 0; + ForwardChats = (Flags & 32) != 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); - ComputeFlags(); bw.Write(Flags); - - - - - - bw.Write(Offset); bw.Write(Limit); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Contacts.TLAbsTopPeers)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs b/src/TgSharp.TL/TL/Contacts/TLRequestImportContacts.cs similarity index 80% rename from src/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestImportContacts.cs index 076cf39..ff1621f 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestImportContacts.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestImportContacts.cs @@ -4,48 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(-634342611)] + [TLObject(746589157)] public class TLRequestImportContacts : TLMethod { public override int Constructor { get { - return -634342611; + return 746589157; } } public TLVector Contacts { get; set; } - public bool Replace { get; set; } public Contacts.TLImportedContacts Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Contacts = (TLVector)ObjectUtils.DeserializeVector(br); - Replace = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Contacts, bw); - BoolUtil.Serialize(Replace, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Contacts.TLImportedContacts)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs b/src/TgSharp.TL/TL/Contacts/TLRequestResetSaved.cs similarity index 64% rename from src/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestResetSaved.cs index 0e9a5b9..4991ce4 100644 --- a/src/TeleSharp.TL/TL/Account/TLRequestGetWallPapers.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestResetSaved.cs @@ -4,42 +4,43 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(-1068696894)] - public class TLRequestGetWallPapers : TLMethod + [TLObject(-2020263951)] + public class TLRequestResetSaved : TLMethod { public override int Constructor { get { - return -1068696894; + return -2020263951; } } - public TLVector Response { get; set; } - + public bool Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { - Response = (TLVector)ObjectUtils.DeserializeVector(br); - + Response = BoolUtil.Deserialize(br); } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs b/src/TgSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs similarity index 94% rename from src/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs index 1da6fde..2250ff0 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestResetTopPeerRating.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(451113900)] public class TLRequestResetTopPeerRating : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Contacts public TLAbsInputPeer Peer { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Category = (TLAbsTopPeerCategory)ObjectUtils.DeserializeObject(br); Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Contacts bw.Write(Constructor); ObjectUtils.SerializeObject(Category, bw); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs b/src/TgSharp.TL/TL/Contacts/TLRequestResolveUsername.cs similarity index 93% rename from src/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestResolveUsername.cs index 04a49b6..957cfb5 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestResolveUsername.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestResolveUsername.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-113456221)] public class TLRequestResolveUsername : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Contacts public string Username { get; set; } public Contacts.TLResolvedPeer Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Username, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Contacts.TLResolvedPeer)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs b/src/TgSharp.TL/TL/Contacts/TLRequestSearch.cs similarity index 93% rename from src/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestSearch.cs index 3e486c0..0883959 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestSearch.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestSearch.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(301470424)] public class TLRequestSearch : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Contacts public int Limit { get; set; } public Contacts.TLFound Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Q = StringUtil.Deserialize(br); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Contacts bw.Write(Constructor); StringUtil.Serialize(Q, bw); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Contacts.TLFound)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs b/src/TgSharp.TL/TL/Contacts/TLRequestToggleTopPeers.cs similarity index 64% rename from src/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestToggleTopPeers.cs index 179bb89..b770382 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestToggleChatAdmins.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestToggleTopPeers.cs @@ -4,48 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { - [TLObject(-326379039)] - public class TLRequestToggleChatAdmins : TLMethod + [TLObject(-2062238246)] + public class TLRequestToggleTopPeers : TLMethod { public override int Constructor { get { - return -326379039; + return -2062238246; } } - public int ChatId { get; set; } public bool Enabled { get; set; } - public TLAbsUpdates Response { get; set; } - + public bool Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - ChatId = br.ReadInt32(); Enabled = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(ChatId); BoolUtil.Serialize(Enabled, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - + Response = BoolUtil.Deserialize(br); } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs b/src/TgSharp.TL/TL/Contacts/TLRequestUnblock.cs similarity index 92% rename from src/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs rename to src/TgSharp.TL/TL/Contacts/TLRequestUnblock.cs index 420b3dc..4610d78 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestUnblock.cs +++ b/src/TgSharp.TL/TL/Contacts/TLRequestUnblock.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-448724803)] public class TLRequestUnblock : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Contacts public TLAbsInputUser Id { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs b/src/TgSharp.TL/TL/Contacts/TLResolvedPeer.cs similarity index 94% rename from src/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs rename to src/TgSharp.TL/TL/Contacts/TLResolvedPeer.cs index c962622..9917ced 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLResolvedPeer.cs +++ b/src/TgSharp.TL/TL/Contacts/TLResolvedPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(2131196633)] public class TLResolvedPeer : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Contacts public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Contacts Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Contacts ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLTopPeers.cs b/src/TgSharp.TL/TL/Contacts/TLTopPeers.cs similarity index 94% rename from src/TeleSharp.TL/TL/Contacts/TLTopPeers.cs rename to src/TgSharp.TL/TL/Contacts/TLTopPeers.cs index 9de0205..1f0ff98 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLTopPeers.cs +++ b/src/TgSharp.TL/TL/Contacts/TLTopPeers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(1891070632)] public class TLTopPeers : TLAbsTopPeers @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Contacts public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Contacts Categories = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Contacts ObjectUtils.SerializeObject(Categories, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/Contacts/TLTopPeersDisabled.cs b/src/TgSharp.TL/TL/Contacts/TLTopPeersDisabled.cs new file mode 100644 index 0000000..b065aa1 --- /dev/null +++ b/src/TgSharp.TL/TL/Contacts/TLTopPeersDisabled.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts +{ + [TLObject(-1255369827)] + public class TLTopPeersDisabled : TLAbsTopPeers + { + public override int Constructor + { + get + { + return -1255369827; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs b/src/TgSharp.TL/TL/Contacts/TLTopPeersNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs rename to src/TgSharp.TL/TL/Contacts/TLTopPeersNotModified.cs index 792627b..62f7ea9 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLTopPeersNotModified.cs +++ b/src/TgSharp.TL/TL/Contacts/TLTopPeersNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Contacts + +using TgSharp.TL; + +namespace TgSharp.TL.Contacts { [TLObject(-567906571)] public class TLTopPeersNotModified : TLAbsTopPeers @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Contacts } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/Folders/TLRequestDeleteFolder.cs b/src/TgSharp.TL/TL/Folders/TLRequestDeleteFolder.cs new file mode 100644 index 0000000..cf71222 --- /dev/null +++ b/src/TgSharp.TL/TL/Folders/TLRequestDeleteFolder.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Folders +{ + [TLObject(472471681)] + public class TLRequestDeleteFolder : TLMethod + { + public override int Constructor + { + get + { + return 472471681; + } + } + + public int FolderId { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + FolderId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(FolderId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Folders/TLRequestEditPeerFolders.cs b/src/TgSharp.TL/TL/Folders/TLRequestEditPeerFolders.cs new file mode 100644 index 0000000..19664ff --- /dev/null +++ b/src/TgSharp.TL/TL/Folders/TLRequestEditPeerFolders.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Folders +{ + [TLObject(1749536939)] + public class TLRequestEditPeerFolders : TLMethod + { + public override int Constructor + { + get + { + return 1749536939; + } + } + + public TLVector FolderPeers { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + FolderPeers = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(FolderPeers, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs b/src/TgSharp.TL/TL/Help/TLAbsAppUpdate.cs similarity index 80% rename from src/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs rename to src/TgSharp.TL/TL/Help/TLAbsAppUpdate.cs index 8f38d8d..f71d9e2 100644 --- a/src/TeleSharp.TL/TL/Help/TLAbsAppUpdate.cs +++ b/src/TgSharp.TL/TL/Help/TLAbsAppUpdate.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { public abstract class TLAbsAppUpdate : TLObject { diff --git a/src/TgSharp.TL/TL/Help/TLAbsDeepLinkInfo.cs b/src/TgSharp.TL/TL/Help/TLAbsDeepLinkInfo.cs new file mode 100644 index 0000000..8ec44b9 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLAbsDeepLinkInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + public abstract class TLAbsDeepLinkInfo : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/Help/TLAbsPassportConfig.cs b/src/TgSharp.TL/TL/Help/TLAbsPassportConfig.cs new file mode 100644 index 0000000..a8251f7 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLAbsPassportConfig.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + public abstract class TLAbsPassportConfig : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/Help/TLAbsProxyData.cs b/src/TgSharp.TL/TL/Help/TLAbsProxyData.cs new file mode 100644 index 0000000..0786b8a --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLAbsProxyData.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + public abstract class TLAbsProxyData : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs b/src/TgSharp.TL/TL/Help/TLAbsTermsOfServiceUpdate.cs similarity index 58% rename from src/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs rename to src/TgSharp.TL/TL/Help/TLAbsTermsOfServiceUpdate.cs index c162b88..264e6e1 100644 --- a/src/TeleSharp.TL/TL/TLAbsChannelParticipantRole.cs +++ b/src/TgSharp.TL/TL/Help/TLAbsTermsOfServiceUpdate.cs @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL.Help { - public abstract class TLAbsChannelParticipantRole : TLObject + public abstract class TLAbsTermsOfServiceUpdate : TLObject { } } diff --git a/src/TeleSharp.TL/TL/TLAbsContactLink.cs b/src/TgSharp.TL/TL/Help/TLAbsUserInfo.cs similarity index 60% rename from src/TeleSharp.TL/TL/TLAbsContactLink.cs rename to src/TgSharp.TL/TL/Help/TLAbsUserInfo.cs index 096f1cf..1d732c3 100644 --- a/src/TeleSharp.TL/TL/TLAbsContactLink.cs +++ b/src/TgSharp.TL/TL/Help/TLAbsUserInfo.cs @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL.Help { - public abstract class TLAbsContactLink : TLObject + public abstract class TLAbsUserInfo : TLObject { } } diff --git a/src/TgSharp.TL/TL/Help/TLAppUpdate.cs b/src/TgSharp.TL/TL/Help/TLAppUpdate.cs new file mode 100644 index 0000000..66fab9e --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLAppUpdate.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(497489295)] + public class TLAppUpdate : TLAbsAppUpdate + { + public override int Constructor + { + get + { + return 497489295; + } + } + + public int Flags { get; set; } + public bool CanNotSkip { get; set; } + public int Id { get; set; } + public string Version { get; set; } + public string Text { get; set; } + public TLVector Entities { get; set; } + public TLAbsDocument Document { get; set; } + public string Url { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + CanNotSkip = (Flags & 1) != 0; + Id = br.ReadInt32(); + Version = StringUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + if ((Flags & 2) != 0) + Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); + else + Document = null; + + if ((Flags & 4) != 0) + Url = StringUtil.Deserialize(br); + else + Url = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(Id); + StringUtil.Serialize(Version, bw); + StringUtil.Serialize(Text, bw); + ObjectUtils.SerializeObject(Entities, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Document, bw); + if ((Flags & 4) != 0) + StringUtil.Serialize(Url, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLDeepLinkInfo.cs b/src/TgSharp.TL/TL/Help/TLDeepLinkInfo.cs new file mode 100644 index 0000000..476abf4 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLDeepLinkInfo.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(1783556146)] + public class TLDeepLinkInfo : TLAbsDeepLinkInfo + { + public override int Constructor + { + get + { + return 1783556146; + } + } + + public int Flags { get; set; } + public bool UpdateApp { get; set; } + public string Message { get; set; } + public TLVector Entities { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + UpdateApp = (Flags & 1) != 0; + Message = StringUtil.Deserialize(br); + if ((Flags & 2) != 0) + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + else + Entities = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Message, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Entities, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLDeepLinkInfoEmpty.cs b/src/TgSharp.TL/TL/Help/TLDeepLinkInfoEmpty.cs new file mode 100644 index 0000000..56d3ad6 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLDeepLinkInfoEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(1722786150)] + public class TLDeepLinkInfoEmpty : TLAbsDeepLinkInfo + { + public override int Constructor + { + get + { + return 1722786150; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLInviteText.cs b/src/TgSharp.TL/TL/Help/TLInviteText.cs similarity index 91% rename from src/TeleSharp.TL/TL/Help/TLInviteText.cs rename to src/TgSharp.TL/TL/Help/TLInviteText.cs index 00f99c2..4f6ec09 100644 --- a/src/TeleSharp.TL/TL/Help/TLInviteText.cs +++ b/src/TgSharp.TL/TL/Help/TLInviteText.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(415997816)] public class TLInviteText : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Help public string Message { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Message = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Message, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs b/src/TgSharp.TL/TL/Help/TLNoAppUpdate.cs similarity index 81% rename from src/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs rename to src/TgSharp.TL/TL/Help/TLNoAppUpdate.cs index ad0619f..73bc000 100644 --- a/src/TeleSharp.TL/TL/Help/TLNoAppUpdate.cs +++ b/src/TgSharp.TL/TL/Help/TLNoAppUpdate.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(-1000708810)] public class TLNoAppUpdate : TLAbsAppUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Help } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/Help/TLPassportConfig.cs b/src/TgSharp.TL/TL/Help/TLPassportConfig.cs new file mode 100644 index 0000000..bf96e79 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLPassportConfig.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-1600596305)] + public class TLPassportConfig : TLAbsPassportConfig + { + public override int Constructor + { + get + { + return -1600596305; + } + } + + public int Hash { get; set; } + public TLDataJSON CountriesLangs { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + CountriesLangs = (TLDataJSON)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + ObjectUtils.SerializeObject(CountriesLangs, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLPassportConfigNotModified.cs b/src/TgSharp.TL/TL/Help/TLPassportConfigNotModified.cs new file mode 100644 index 0000000..e6a185e --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLPassportConfigNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-1078332329)] + public class TLPassportConfigNotModified : TLAbsPassportConfig + { + public override int Constructor + { + get + { + return -1078332329; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLProxyDataEmpty.cs b/src/TgSharp.TL/TL/Help/TLProxyDataEmpty.cs new file mode 100644 index 0000000..91d6f97 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLProxyDataEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-526508104)] + public class TLProxyDataEmpty : TLAbsProxyData + { + public override int Constructor + { + get + { + return -526508104; + } + } + + public int Expires { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Expires = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Expires); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLProxyDataPromo.cs b/src/TgSharp.TL/TL/Help/TLProxyDataPromo.cs new file mode 100644 index 0000000..56a8a6c --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLProxyDataPromo.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(737668643)] + public class TLProxyDataPromo : TLAbsProxyData + { + public override int Constructor + { + get + { + return 737668643; + } + } + + public int Expires { get; set; } + public TLAbsPeer Peer { get; set; } + public TLVector Chats { get; set; } + public TLVector Users { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Expires = br.ReadInt32(); + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + Users = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Expires); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Chats, bw); + ObjectUtils.SerializeObject(Users, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRecentMeUrls.cs b/src/TgSharp.TL/TL/Help/TLRecentMeUrls.cs new file mode 100644 index 0000000..d6447f7 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRecentMeUrls.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(235081943)] + public class TLRecentMeUrls : TLObject + { + public override int Constructor + { + get + { + return 235081943; + } + } + + public TLVector Urls { get; set; } + public TLVector Chats { get; set; } + public TLVector Users { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Urls = (TLVector)ObjectUtils.DeserializeVector(br); + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + Users = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Urls, bw); + ObjectUtils.SerializeObject(Chats, bw); + ObjectUtils.SerializeObject(Users, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRequestAcceptTermsOfService.cs b/src/TgSharp.TL/TL/Help/TLRequestAcceptTermsOfService.cs new file mode 100644 index 0000000..ca14e0f --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestAcceptTermsOfService.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-294455398)] + public class TLRequestAcceptTermsOfService : TLMethod + { + public override int Constructor + { + get + { + return -294455398; + } + } + + public TLDataJSON Id { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = (TLDataJSON)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Id, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRequestEditUserInfo.cs b/src/TgSharp.TL/TL/Help/TLRequestEditUserInfo.cs new file mode 100644 index 0000000..7f9a929 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestEditUserInfo.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(1723407216)] + public class TLRequestEditUserInfo : TLMethod + { + public override int Constructor + { + get + { + return 1723407216; + } + } + + public TLAbsInputUser UserId { get; set; } + public string Message { get; set; } + public TLVector Entities { get; set; } + public Help.TLAbsUserInfo Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + Message = StringUtil.Deserialize(br); + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(UserId, bw); + StringUtil.Serialize(Message, bw); + ObjectUtils.SerializeObject(Entities, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLAbsUserInfo)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs b/src/TgSharp.TL/TL/Help/TLRequestGetAppChangelog.cs similarity index 93% rename from src/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetAppChangelog.cs index 9a94beb..8422a4d 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetAppChangelog.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetAppChangelog.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(-1877938321)] public class TLRequestGetAppChangelog : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Help public string PrevAppVersion { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PrevAppVersion = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(PrevAppVersion, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetAppConfig.cs b/src/TgSharp.TL/TL/Help/TLRequestGetAppConfig.cs new file mode 100644 index 0000000..29912d5 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetAppConfig.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-1735311088)] + public class TLRequestGetAppConfig : TLMethod + { + public override int Constructor + { + get + { + return -1735311088; + } + } + + public TLAbsJSONValue Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsJSONValue)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs b/src/TgSharp.TL/TL/Help/TLRequestGetAppUpdate.cs similarity index 74% rename from src/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetAppUpdate.cs index 620942e..403e007 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetAppUpdate.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetAppUpdate.cs @@ -4,42 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { - [TLObject(-1372724842)] + [TLObject(1378703997)] public class TLRequestGetAppUpdate : TLMethod { public override int Constructor { get { - return -1372724842; + return 1378703997; } } + public string Source { get; set; } public Help.TLAbsAppUpdate Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + Source = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + StringUtil.Serialize(Source, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (Help.TLAbsAppUpdate)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetCdnConfig.cs b/src/TgSharp.TL/TL/Help/TLRequestGetCdnConfig.cs similarity index 86% rename from src/TeleSharp.TL/TL/Help/TLRequestGetCdnConfig.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetCdnConfig.cs index ede8e5c..ff60876 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetCdnConfig.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetCdnConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(1375900482)] public class TLRequestGetCdnConfig : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Help public TLCdnConfig Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLCdnConfig)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs b/src/TgSharp.TL/TL/Help/TLRequestGetConfig.cs similarity index 86% rename from src/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetConfig.cs index 1013c1a..cf3cd33 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetConfig.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(-990308245)] public class TLRequestGetConfig : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Help public TLConfig Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLConfig)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetDeepLinkInfo.cs b/src/TgSharp.TL/TL/Help/TLRequestGetDeepLinkInfo.cs new file mode 100644 index 0000000..3e57843 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetDeepLinkInfo.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(1072547679)] + public class TLRequestGetDeepLinkInfo : TLMethod + { + public override int Constructor + { + get + { + return 1072547679; + } + } + + public string Path { get; set; } + public Help.TLAbsDeepLinkInfo Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Path = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Path, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLAbsDeepLinkInfo)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs b/src/TgSharp.TL/TL/Help/TLRequestGetInviteText.cs similarity index 86% rename from src/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetInviteText.cs index d02032d..a8b188f 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetInviteText.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetInviteText.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(1295590211)] public class TLRequestGetInviteText : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Help public Help.TLInviteText Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Help.TLInviteText)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs b/src/TgSharp.TL/TL/Help/TLRequestGetNearestDc.cs similarity index 86% rename from src/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetNearestDc.cs index 7b03ce7..bc823cc 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetNearestDc.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetNearestDc.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(531836966)] public class TLRequestGetNearestDc : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Help public TLNearestDc Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLNearestDc)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetPassportConfig.cs b/src/TgSharp.TL/TL/Help/TLRequestGetPassportConfig.cs new file mode 100644 index 0000000..da16b47 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetPassportConfig.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-966677240)] + public class TLRequestGetPassportConfig : TLMethod + { + public override int Constructor + { + get + { + return -966677240; + } + } + + public int Hash { get; set; } + public Help.TLAbsPassportConfig Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLAbsPassportConfig)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetProxyData.cs b/src/TgSharp.TL/TL/Help/TLRequestGetProxyData.cs new file mode 100644 index 0000000..fca8886 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetProxyData.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(1031231713)] + public class TLRequestGetProxyData : TLMethod + { + public override int Constructor + { + get + { + return 1031231713; + } + } + + public Help.TLAbsProxyData Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLAbsProxyData)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetRecentMeUrls.cs b/src/TgSharp.TL/TL/Help/TLRequestGetRecentMeUrls.cs new file mode 100644 index 0000000..90d3120 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetRecentMeUrls.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(1036054804)] + public class TLRequestGetRecentMeUrls : TLMethod + { + public override int Constructor + { + get + { + return 1036054804; + } + } + + public string Referer { get; set; } + public Help.TLRecentMeUrls Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Referer = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Referer, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLRecentMeUrls)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs b/src/TgSharp.TL/TL/Help/TLRequestGetSupport.cs similarity index 86% rename from src/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs rename to src/TgSharp.TL/TL/Help/TLRequestGetSupport.cs index c4edfa3..f0a7e45 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestGetSupport.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestGetSupport.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(-1663104819)] public class TLRequestGetSupport : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Help public Help.TLSupport Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Help.TLSupport)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetSupportName.cs b/src/TgSharp.TL/TL/Help/TLRequestGetSupportName.cs new file mode 100644 index 0000000..dfc60d1 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetSupportName.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-748624084)] + public class TLRequestGetSupportName : TLMethod + { + public override int Constructor + { + get + { + return -748624084; + } + } + + public Help.TLSupportName Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLSupportName)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetTermsOfServiceUpdate.cs b/src/TgSharp.TL/TL/Help/TLRequestGetTermsOfServiceUpdate.cs new file mode 100644 index 0000000..f624207 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetTermsOfServiceUpdate.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(749019089)] + public class TLRequestGetTermsOfServiceUpdate : TLMethod + { + public override int Constructor + { + get + { + return 749019089; + } + } + + public Help.TLAbsTermsOfServiceUpdate Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLAbsTermsOfServiceUpdate)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLRequestGetUserInfo.cs b/src/TgSharp.TL/TL/Help/TLRequestGetUserInfo.cs new file mode 100644 index 0000000..b7e5b0f --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLRequestGetUserInfo.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(59377875)] + public class TLRequestGetUserInfo : TLMethod + { + public override int Constructor + { + get + { + return 59377875; + } + } + + public TLAbsInputUser UserId { get; set; } + public Help.TLAbsUserInfo Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(UserId, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Help.TLAbsUserInfo)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs b/src/TgSharp.TL/TL/Help/TLRequestSaveAppLog.cs similarity index 93% rename from src/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs rename to src/TgSharp.TL/TL/Help/TLRequestSaveAppLog.cs index d6494ad..96334ec 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestSaveAppLog.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestSaveAppLog.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(1862465352)] public class TLRequestSaveAppLog : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Help public TLVector Events { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Events = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Events, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLRequestSetBotUpdatesStatus.cs b/src/TgSharp.TL/TL/Help/TLRequestSetBotUpdatesStatus.cs similarity index 93% rename from src/TeleSharp.TL/TL/Help/TLRequestSetBotUpdatesStatus.cs rename to src/TgSharp.TL/TL/Help/TLRequestSetBotUpdatesStatus.cs index e0dc67c..c3c230d 100644 --- a/src/TeleSharp.TL/TL/Help/TLRequestSetBotUpdatesStatus.cs +++ b/src/TgSharp.TL/TL/Help/TLRequestSetBotUpdatesStatus.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(-333262899)] public class TLRequestSetBotUpdatesStatus : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Help public string Message { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PendingUpdatesCount = br.ReadInt32(); Message = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Help bw.Write(Constructor); bw.Write(PendingUpdatesCount); StringUtil.Serialize(Message, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLSupport.cs b/src/TgSharp.TL/TL/Help/TLSupport.cs similarity index 92% rename from src/TeleSharp.TL/TL/Help/TLSupport.cs rename to src/TgSharp.TL/TL/Help/TLSupport.cs index 8466bac..71dfe03 100644 --- a/src/TeleSharp.TL/TL/Help/TLSupport.cs +++ b/src/TgSharp.TL/TL/Help/TLSupport.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL.Help { [TLObject(398898678)] public class TLSupport : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Help public string PhoneNumber { get; set; } public TLAbsUser User { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneNumber = StringUtil.Deserialize(br); User = (TLAbsUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Help bw.Write(Constructor); StringUtil.Serialize(PhoneNumber, bw); ObjectUtils.SerializeObject(User, bw); - } } } diff --git a/src/TgSharp.TL/TL/Help/TLSupportName.cs b/src/TgSharp.TL/TL/Help/TLSupportName.cs new file mode 100644 index 0000000..ca8e97a --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLSupportName.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-1945767479)] + public class TLSupportName : TLObject + { + public override int Constructor + { + get + { + return -1945767479; + } + } + + public string Name { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Name = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Name, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLTermsOfService.cs b/src/TgSharp.TL/TL/Help/TLTermsOfService.cs new file mode 100644 index 0000000..b4cf6dd --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLTermsOfService.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(2013922064)] + public class TLTermsOfService : TLObject + { + public override int Constructor + { + get + { + return 2013922064; + } + } + + public int Flags { get; set; } + public bool Popup { get; set; } + public TLDataJSON Id { get; set; } + public string Text { get; set; } + public TLVector Entities { get; set; } + public int? MinAgeConfirm { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Popup = (Flags & 1) != 0; + Id = (TLDataJSON)ObjectUtils.DeserializeObject(br); + Text = StringUtil.Deserialize(br); + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + if ((Flags & 2) != 0) + MinAgeConfirm = br.ReadInt32(); + else + MinAgeConfirm = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Id, bw); + StringUtil.Serialize(Text, bw); + ObjectUtils.SerializeObject(Entities, bw); + if ((Flags & 2) != 0) + bw.Write(MinAgeConfirm.Value); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLTermsOfServiceUpdate.cs b/src/TgSharp.TL/TL/Help/TLTermsOfServiceUpdate.cs new file mode 100644 index 0000000..e9cd363 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLTermsOfServiceUpdate.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(686618977)] + public class TLTermsOfServiceUpdate : TLAbsTermsOfServiceUpdate + { + public override int Constructor + { + get + { + return 686618977; + } + } + + public int Expires { get; set; } + public Help.TLTermsOfService TermsOfService { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Expires = br.ReadInt32(); + TermsOfService = (Help.TLTermsOfService)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Expires); + ObjectUtils.SerializeObject(TermsOfService, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLTermsOfServiceUpdateEmpty.cs b/src/TgSharp.TL/TL/Help/TLTermsOfServiceUpdateEmpty.cs new file mode 100644 index 0000000..0fc8517 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLTermsOfServiceUpdateEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-483352705)] + public class TLTermsOfServiceUpdateEmpty : TLAbsTermsOfServiceUpdate + { + public override int Constructor + { + get + { + return -483352705; + } + } + + public int Expires { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Expires = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Expires); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLUserInfo.cs b/src/TgSharp.TL/TL/Help/TLUserInfo.cs new file mode 100644 index 0000000..6b28662 --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLUserInfo.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(32192344)] + public class TLUserInfo : TLAbsUserInfo + { + public override int Constructor + { + get + { + return 32192344; + } + } + + public string Message { get; set; } + public TLVector Entities { get; set; } + public string Author { get; set; } + public int Date { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Message = StringUtil.Deserialize(br); + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + Author = StringUtil.Deserialize(br); + Date = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Message, bw); + ObjectUtils.SerializeObject(Entities, bw); + StringUtil.Serialize(Author, bw); + bw.Write(Date); + } + } +} diff --git a/src/TgSharp.TL/TL/Help/TLUserInfoEmpty.cs b/src/TgSharp.TL/TL/Help/TLUserInfoEmpty.cs new file mode 100644 index 0000000..855f77e --- /dev/null +++ b/src/TgSharp.TL/TL/Help/TLUserInfoEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Help +{ + [TLObject(-206688531)] + public class TLUserInfoEmpty : TLAbsUserInfo + { + public override int Constructor + { + get + { + return -206688531; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/Langpack/TLRequestGetDifference.cs b/src/TgSharp.TL/TL/Langpack/TLRequestGetDifference.cs new file mode 100644 index 0000000..8ba1074 --- /dev/null +++ b/src/TgSharp.TL/TL/Langpack/TLRequestGetDifference.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Langpack +{ + [TLObject(-845657435)] + public class TLRequestGetDifference : TLMethod + { + public override int Constructor + { + get + { + return -845657435; + } + } + + public string LangPack { get; set; } + public string LangCode { get; set; } + public int FromVersion { get; set; } + public TLLangPackDifference Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangPack = StringUtil.Deserialize(br); + LangCode = StringUtil.Deserialize(br); + FromVersion = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangPack, bw); + StringUtil.Serialize(LangCode, bw); + bw.Write(FromVersion); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLLangPackDifference)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Langpack/TLRequestGetLangPack.cs b/src/TgSharp.TL/TL/Langpack/TLRequestGetLangPack.cs new file mode 100644 index 0000000..b901a7c --- /dev/null +++ b/src/TgSharp.TL/TL/Langpack/TLRequestGetLangPack.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Langpack +{ + [TLObject(-219008246)] + public class TLRequestGetLangPack : TLMethod + { + public override int Constructor + { + get + { + return -219008246; + } + } + + public string LangPack { get; set; } + public string LangCode { get; set; } + public TLLangPackDifference Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangPack = StringUtil.Deserialize(br); + LangCode = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangPack, bw); + StringUtil.Serialize(LangCode, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLLangPackDifference)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Langpack/TLRequestGetLanguage.cs b/src/TgSharp.TL/TL/Langpack/TLRequestGetLanguage.cs new file mode 100644 index 0000000..d52326d --- /dev/null +++ b/src/TgSharp.TL/TL/Langpack/TLRequestGetLanguage.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Langpack +{ + [TLObject(1784243458)] + public class TLRequestGetLanguage : TLMethod + { + public override int Constructor + { + get + { + return 1784243458; + } + } + + public string LangPack { get; set; } + public string LangCode { get; set; } + public TLLangPackLanguage Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangPack = StringUtil.Deserialize(br); + LangCode = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangPack, bw); + StringUtil.Serialize(LangCode, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLLangPackLanguage)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Langpack/TLRequestGetLanguages.cs b/src/TgSharp.TL/TL/Langpack/TLRequestGetLanguages.cs new file mode 100644 index 0000000..f491094 --- /dev/null +++ b/src/TgSharp.TL/TL/Langpack/TLRequestGetLanguages.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Langpack +{ + [TLObject(1120311183)] + public class TLRequestGetLanguages : TLMethod + { + public override int Constructor + { + get + { + return 1120311183; + } + } + + public string LangPack { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangPack = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangPack, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Langpack/TLRequestGetStrings.cs b/src/TgSharp.TL/TL/Langpack/TLRequestGetStrings.cs new file mode 100644 index 0000000..b7089a5 --- /dev/null +++ b/src/TgSharp.TL/TL/Langpack/TLRequestGetStrings.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Langpack +{ + [TLObject(-269862909)] + public class TLRequestGetStrings : TLMethod + { + public override int Constructor + { + get + { + return -269862909; + } + } + + public string LangPack { get; set; } + public string LangCode { get; set; } + public TLVector Keys { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangPack = StringUtil.Deserialize(br); + LangCode = StringUtil.Deserialize(br); + Keys = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangPack, bw); + StringUtil.Serialize(LangCode, bw); + ObjectUtils.SerializeObject(Keys, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs b/src/TgSharp.TL/TL/Messages/TLAbsAllStickers.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs rename to src/TgSharp.TL/TL/Messages/TLAbsAllStickers.cs index 02c5d7f..493f016 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsAllStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsAllStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsAllStickers : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsChats.cs b/src/TgSharp.TL/TL/Messages/TLAbsChats.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsChats.cs rename to src/TgSharp.TL/TL/Messages/TLAbsChats.cs index 06a5553..6830cb0 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsChats.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsChats : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs b/src/TgSharp.TL/TL/Messages/TLAbsDhConfig.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs rename to src/TgSharp.TL/TL/Messages/TLAbsDhConfig.cs index b57822b..683f03a 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsDhConfig.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsDhConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsDhConfig : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs b/src/TgSharp.TL/TL/Messages/TLAbsDialogs.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLAbsDialogs.cs index 0050795..e0afb91 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsDialogs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsDialogs : TLObject { diff --git a/src/TgSharp.TL/TL/Messages/TLAbsFavedStickers.cs b/src/TgSharp.TL/TL/Messages/TLAbsFavedStickers.cs new file mode 100644 index 0000000..5fd42e2 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLAbsFavedStickers.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + public abstract class TLAbsFavedStickers : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs b/src/TgSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs similarity index 80% rename from src/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs index bc96191..a14bf24 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsFeaturedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsFeaturedStickers : TLObject { diff --git a/src/TgSharp.TL/TL/Messages/TLAbsFoundStickerSets.cs b/src/TgSharp.TL/TL/Messages/TLAbsFoundStickerSets.cs new file mode 100644 index 0000000..d848e33 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLAbsFoundStickerSets.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + public abstract class TLAbsFoundStickerSets : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsMessages.cs b/src/TgSharp.TL/TL/Messages/TLAbsMessages.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsMessages.cs rename to src/TgSharp.TL/TL/Messages/TLAbsMessages.cs index bdddf0a..ac96d49 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsMessages : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs b/src/TgSharp.TL/TL/Messages/TLAbsRecentStickers.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs rename to src/TgSharp.TL/TL/Messages/TLAbsRecentStickers.cs index 1e763ff..e9cf522 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsRecentStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsRecentStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsRecentStickers : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs b/src/TgSharp.TL/TL/Messages/TLAbsSavedGifs.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs rename to src/TgSharp.TL/TL/Messages/TLAbsSavedGifs.cs index ee01f4e..8930353 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsSavedGifs.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsSavedGifs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsSavedGifs : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs b/src/TgSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs similarity index 80% rename from src/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs rename to src/TgSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs index a6d12bc..13919ef 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsSentEncryptedMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsSentEncryptedMessage : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs b/src/TgSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs similarity index 80% rename from src/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs rename to src/TgSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs index bf4da05..9e0b5dd 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsStickerSetInstallResult.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsStickerSetInstallResult : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAbsStickers.cs b/src/TgSharp.TL/TL/Messages/TLAbsStickers.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLAbsStickers.cs rename to src/TgSharp.TL/TL/Messages/TLAbsStickers.cs index c84da33..49f00ca 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAbsStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLAbsStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { public abstract class TLAbsStickers : TLObject { diff --git a/src/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs b/src/TgSharp.TL/TL/Messages/TLAffectedHistory.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs rename to src/TgSharp.TL/TL/Messages/TLAffectedHistory.cs index 76236d6..855424a 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAffectedHistory.cs +++ b/src/TgSharp.TL/TL/Messages/TLAffectedHistory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1269012015)] public class TLAffectedHistory : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Messages public int PtsCount { get; set; } public int Offset { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Messages Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); Offset = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Messages bw.Write(Pts); bw.Write(PtsCount); bw.Write(Offset); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs b/src/TgSharp.TL/TL/Messages/TLAffectedMessages.cs similarity index 91% rename from src/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs rename to src/TgSharp.TL/TL/Messages/TLAffectedMessages.cs index e0c0ac5..78925a1 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAffectedMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLAffectedMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-2066640507)] public class TLAffectedMessages : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLAllStickers.cs b/src/TgSharp.TL/TL/Messages/TLAllStickers.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLAllStickers.cs rename to src/TgSharp.TL/TL/Messages/TLAllStickers.cs index c71c000..d4472a1 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAllStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLAllStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-302170017)] public class TLAllStickers : TLAbsAllStickers @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public TLVector Sets { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); Sets = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Hash); ObjectUtils.SerializeObject(Sets, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs b/src/TgSharp.TL/TL/Messages/TLAllStickersNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs rename to src/TgSharp.TL/TL/Messages/TLAllStickersNotModified.cs index 2df94dc..01a15a8 100644 --- a/src/TeleSharp.TL/TL/Messages/TLAllStickersNotModified.cs +++ b/src/TgSharp.TL/TL/Messages/TLAllStickersNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-395967805)] public class TLAllStickersNotModified : TLAbsAllStickers @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Messages } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs b/src/TgSharp.TL/TL/Messages/TLArchivedStickers.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLArchivedStickers.cs index e6c4f06..28acb16 100644 --- a/src/TeleSharp.TL/TL/Messages/TLArchivedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLArchivedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1338747336)] public class TLArchivedStickers : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int Count { get; set; } public TLVector Sets { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Count = br.ReadInt32(); Sets = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Count); ObjectUtils.SerializeObject(Sets, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs b/src/TgSharp.TL/TL/Messages/TLBotCallbackAnswer.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs rename to src/TgSharp.TL/TL/Messages/TLBotCallbackAnswer.cs index a33b8a6..85c3fc4 100644 --- a/src/TeleSharp.TL/TL/Messages/TLBotCallbackAnswer.cs +++ b/src/TgSharp.TL/TL/Messages/TLBotCallbackAnswer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(911761060)] public class TLBotCallbackAnswer : TLObject @@ -21,19 +23,14 @@ namespace TeleSharp.TL.Messages public int Flags { get; set; } public bool Alert { get; set; } public bool HasUrl { get; set; } + public bool NativeUi { get; set; } public string Message { get; set; } public string Url { get; set; } public int CacheTime { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Alert ? (Flags | 2) : (Flags & ~2); - Flags = HasUrl ? (Flags | 8) : (Flags & ~8); - Flags = Message != null ? (Flags | 1) : (Flags & ~1); - Flags = Url != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,6 +38,7 @@ namespace TeleSharp.TL.Messages Flags = br.ReadInt32(); Alert = (Flags & 2) != 0; HasUrl = (Flags & 8) != 0; + NativeUi = (Flags & 16) != 0; if ((Flags & 1) != 0) Message = StringUtil.Deserialize(br); else @@ -52,22 +50,17 @@ namespace TeleSharp.TL.Messages Url = null; CacheTime = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - if ((Flags & 1) != 0) StringUtil.Serialize(Message, bw); if ((Flags & 4) != 0) StringUtil.Serialize(Url, bw); bw.Write(CacheTime); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLBotResults.cs b/src/TgSharp.TL/TL/Messages/TLBotResults.cs similarity index 83% rename from src/TeleSharp.TL/TL/Messages/TLBotResults.cs rename to src/TgSharp.TL/TL/Messages/TLBotResults.cs index f524520..3b28b4b 100644 --- a/src/TeleSharp.TL/TL/Messages/TLBotResults.cs +++ b/src/TgSharp.TL/TL/Messages/TLBotResults.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-858565059)] + [TLObject(-1803769784)] public class TLBotResults : TLObject { public override int Constructor { get { - return -858565059; + return -1803769784; } } @@ -25,15 +27,11 @@ namespace TeleSharp.TL.Messages public TLInlineBotSwitchPM SwitchPm { get; set; } public TLVector Results { get; set; } public int CacheTime { get; set; } - + public TLVector Users { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Gallery ? (Flags | 1) : (Flags & ~1); - Flags = NextOffset != null ? (Flags | 2) : (Flags & ~2); - Flags = SwitchPm != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -53,15 +51,13 @@ namespace TeleSharp.TL.Messages Results = (TLVector)ObjectUtils.DeserializeVector(br); CacheTime = br.ReadInt32(); - + Users = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(QueryId); if ((Flags & 2) != 0) StringUtil.Serialize(NextOffset, bw); @@ -69,7 +65,7 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(SwitchPm, bw); ObjectUtils.SerializeObject(Results, bw); bw.Write(CacheTime); - + ObjectUtils.SerializeObject(Users, bw); } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLChannelMessages.cs b/src/TgSharp.TL/TL/Messages/TLChannelMessages.cs similarity index 90% rename from src/TeleSharp.TL/TL/Messages/TLChannelMessages.cs rename to src/TgSharp.TL/TL/Messages/TLChannelMessages.cs index 04b6d3e..fb7bdb8 100644 --- a/src/TeleSharp.TL/TL/Messages/TLChannelMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLChannelMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1725551049)] public class TLChannelMessages : TLAbsMessages @@ -19,41 +21,38 @@ namespace TeleSharp.TL.Messages } public int Flags { get; set; } + public bool Inexact { 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; - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); + Inexact = (Flags & 2) != 0; Pts = br.ReadInt32(); Count = br.ReadInt32(); Messages = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { 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); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLChatFull.cs b/src/TgSharp.TL/TL/Messages/TLChatFull.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLChatFull.cs rename to src/TgSharp.TL/TL/Messages/TLChatFull.cs index 995586a..0ec0c37 100644 --- a/src/TeleSharp.TL/TL/Messages/TLChatFull.cs +++ b/src/TgSharp.TL/TL/Messages/TLChatFull.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-438840932)] public class TLChatFull : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Messages public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Messages FullChat = (TLAbsChatFull)ObjectUtils.DeserializeObject(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(FullChat, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLChats.cs b/src/TgSharp.TL/TL/Messages/TLChats.cs similarity index 91% rename from src/TeleSharp.TL/TL/Messages/TLChats.cs rename to src/TgSharp.TL/TL/Messages/TLChats.cs index 571cddc..c6f465c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLChats.cs +++ b/src/TgSharp.TL/TL/Messages/TLChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1694474197)] public class TLChats : TLAbsChats @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Messages public TLVector Chats { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Chats = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Chats, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLChatsSlice.cs b/src/TgSharp.TL/TL/Messages/TLChatsSlice.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLChatsSlice.cs rename to src/TgSharp.TL/TL/Messages/TLChatsSlice.cs index 1ab55d1..d5faf55 100644 --- a/src/TeleSharp.TL/TL/Messages/TLChatsSlice.cs +++ b/src/TgSharp.TL/TL/Messages/TLChatsSlice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1663561404)] public class TLChatsSlice : TLAbsChats @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int Count { get; set; } public TLVector Chats { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Count = br.ReadInt32(); Chats = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Count); ObjectUtils.SerializeObject(Chats, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLDhConfig.cs b/src/TgSharp.TL/TL/Messages/TLDhConfig.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLDhConfig.cs rename to src/TgSharp.TL/TL/Messages/TLDhConfig.cs index 459cebf..4b16eea 100644 --- a/src/TeleSharp.TL/TL/Messages/TLDhConfig.cs +++ b/src/TgSharp.TL/TL/Messages/TLDhConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(740433629)] public class TLDhConfig : TLAbsDhConfig @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public int Version { get; set; } public byte[] Random { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL.Messages P = BytesUtil.Deserialize(br); Version = br.ReadInt32(); Random = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL.Messages BytesUtil.Serialize(P, bw); bw.Write(Version); BytesUtil.Serialize(Random, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs b/src/TgSharp.TL/TL/Messages/TLDhConfigNotModified.cs similarity index 91% rename from src/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs rename to src/TgSharp.TL/TL/Messages/TLDhConfigNotModified.cs index b4707ed..a4164d0 100644 --- a/src/TeleSharp.TL/TL/Messages/TLDhConfigNotModified.cs +++ b/src/TgSharp.TL/TL/Messages/TLDhConfigNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1058912715)] public class TLDhConfigNotModified : TLAbsDhConfig @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Messages public byte[] Random { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Random = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); BytesUtil.Serialize(Random, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLDialogs.cs b/src/TgSharp.TL/TL/Messages/TLDialogs.cs similarity index 84% rename from src/TeleSharp.TL/TL/Messages/TLDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLDialogs.cs index be6d0f2..eedeff0 100644 --- a/src/TeleSharp.TL/TL/Messages/TLDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLDialogs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(364538944)] public class TLDialogs : TLAbsDialogs @@ -18,24 +20,22 @@ namespace TeleSharp.TL.Messages } } - public TLVector Dialogs { 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() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Dialogs = (TLVector)ObjectUtils.DeserializeVector(br); + Dialogs = (TLVector)ObjectUtils.DeserializeVector(br); Messages = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Messages, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLDialogsNotModified.cs b/src/TgSharp.TL/TL/Messages/TLDialogsNotModified.cs new file mode 100644 index 0000000..4c508aa --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLDialogsNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-253500010)] + public class TLDialogsNotModified : TLAbsDialogs + { + public override int Constructor + { + get + { + return -253500010; + } + } + + public int Count { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Count = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Count); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs b/src/TgSharp.TL/TL/Messages/TLDialogsSlice.cs similarity index 85% rename from src/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs rename to src/TgSharp.TL/TL/Messages/TLDialogsSlice.cs index 87e6642..3630674 100644 --- a/src/TeleSharp.TL/TL/Messages/TLDialogsSlice.cs +++ b/src/TgSharp.TL/TL/Messages/TLDialogsSlice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1910543603)] public class TLDialogsSlice : TLAbsDialogs @@ -19,25 +21,23 @@ namespace TeleSharp.TL.Messages } public int Count { get; set; } - public TLVector Dialogs { 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() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Count = br.ReadInt32(); - Dialogs = (TLVector)ObjectUtils.DeserializeVector(br); + Dialogs = (TLVector)ObjectUtils.DeserializeVector(br); Messages = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Messages, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRecentStickers.cs b/src/TgSharp.TL/TL/Messages/TLFavedStickers.cs similarity index 67% rename from src/TeleSharp.TL/TL/Messages/TLRecentStickers.cs rename to src/TgSharp.TL/TL/Messages/TLFavedStickers.cs index 80adc92..2919889 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRecentStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLFavedStickers.cs @@ -4,42 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(1558317424)] - public class TLRecentStickers : TLAbsRecentStickers + [TLObject(-209768682)] + public class TLFavedStickers : TLAbsFavedStickers { public override int Constructor { get { - return 1558317424; + return -209768682; } } public int Hash { get; set; } + public TLVector Packs { get; set; } public TLVector Stickers { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); + Packs = (TLVector)ObjectUtils.DeserializeVector(br); Stickers = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Hash); + ObjectUtils.SerializeObject(Packs, bw); ObjectUtils.SerializeObject(Stickers, bw); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLFavedStickersNotModified.cs b/src/TgSharp.TL/TL/Messages/TLFavedStickersNotModified.cs new file mode 100644 index 0000000..4ee77f9 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLFavedStickersNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1634752813)] + public class TLFavedStickersNotModified : TLAbsFavedStickers + { + public override int Constructor + { + get + { + return -1634752813; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs b/src/TgSharp.TL/TL/Messages/TLFeaturedStickers.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLFeaturedStickers.cs index 0029e2e..1000b2a 100644 --- a/src/TeleSharp.TL/TL/Messages/TLFeaturedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLFeaturedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-123893531)] public class TLFeaturedStickers : TLAbsFeaturedStickers @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Messages public TLVector Sets { get; set; } public TLVector Unread { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Messages Hash = br.ReadInt32(); Sets = (TLVector)ObjectUtils.DeserializeVector(br); Unread = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Messages bw.Write(Hash); ObjectUtils.SerializeObject(Sets, bw); ObjectUtils.SerializeObject(Unread, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs b/src/TgSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs rename to src/TgSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs index d7f5113..a8bd73c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs +++ b/src/TgSharp.TL/TL/Messages/TLFeaturedStickersNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(82699215)] public class TLFeaturedStickersNotModified : TLAbsFeaturedStickers @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Messages } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLFoundGifs.cs b/src/TgSharp.TL/TL/Messages/TLFoundGifs.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLFoundGifs.cs rename to src/TgSharp.TL/TL/Messages/TLFoundGifs.cs index bba2fbd..53b0f8b 100644 --- a/src/TeleSharp.TL/TL/Messages/TLFoundGifs.cs +++ b/src/TgSharp.TL/TL/Messages/TLFoundGifs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1158290442)] public class TLFoundGifs : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int NextOffset { get; set; } public TLVector Results { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { NextOffset = br.ReadInt32(); Results = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(NextOffset); ObjectUtils.SerializeObject(Results, bw); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLFoundStickerSets.cs b/src/TgSharp.TL/TL/Messages/TLFoundStickerSets.cs new file mode 100644 index 0000000..793f865 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLFoundStickerSets.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1359533640)] + public class TLFoundStickerSets : TLAbsFoundStickerSets + { + public override int Constructor + { + get + { + return 1359533640; + } + } + + public int Hash { get; set; } + public TLVector Sets { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + Sets = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + ObjectUtils.SerializeObject(Sets, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLFoundStickerSetsNotModified.cs b/src/TgSharp.TL/TL/Messages/TLFoundStickerSetsNotModified.cs new file mode 100644 index 0000000..09fa186 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLFoundStickerSetsNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(223655517)] + public class TLFoundStickerSetsNotModified : TLAbsFoundStickerSets + { + public override int Constructor + { + get + { + return 223655517; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLHighScores.cs b/src/TgSharp.TL/TL/Messages/TLHighScores.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLHighScores.cs rename to src/TgSharp.TL/TL/Messages/TLHighScores.cs index fefcb1d..8e50b16 100644 --- a/src/TeleSharp.TL/TL/Messages/TLHighScores.cs +++ b/src/TgSharp.TL/TL/Messages/TLHighScores.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1707344487)] public class TLHighScores : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public TLVector Scores { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Scores = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Scores, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLInactiveChats.cs b/src/TgSharp.TL/TL/Messages/TLInactiveChats.cs new file mode 100644 index 0000000..beb84ea --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLInactiveChats.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1456996667)] + public class TLInactiveChats : TLObject + { + public override int Constructor + { + get + { + return -1456996667; + } + } + + public TLVector Dates { get; set; } + public TLVector Chats { get; set; } + public TLVector Users { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Dates = (TLVector)ObjectUtils.DeserializeVector(br); + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + Users = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Dates, bw); + ObjectUtils.SerializeObject(Chats, bw); + ObjectUtils.SerializeObject(Users, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLMessageEditData.cs b/src/TgSharp.TL/TL/Messages/TLMessageEditData.cs similarity index 83% rename from src/TeleSharp.TL/TL/Messages/TLMessageEditData.cs rename to src/TgSharp.TL/TL/Messages/TLMessageEditData.cs index 744a655..1484038 100644 --- a/src/TeleSharp.TL/TL/Messages/TLMessageEditData.cs +++ b/src/TgSharp.TL/TL/Messages/TLMessageEditData.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(649453030)] public class TLMessageEditData : TLObject @@ -21,28 +23,21 @@ namespace TeleSharp.TL.Messages public int Flags { get; set; } public bool Caption { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Caption ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Caption = (Flags & 1) != 0; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLMessages.cs b/src/TgSharp.TL/TL/Messages/TLMessages.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLMessages.cs rename to src/TgSharp.TL/TL/Messages/TLMessages.cs index 1209ec9..65b340c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1938715001)] public class TLMessages : TLAbsMessages @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Messages public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Messages Messages = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Messages, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLMessagesNotModified.cs b/src/TgSharp.TL/TL/Messages/TLMessagesNotModified.cs new file mode 100644 index 0000000..b1c2267 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLMessagesNotModified.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1951620897)] + public class TLMessagesNotModified : TLAbsMessages + { + public override int Constructor + { + get + { + return 1951620897; + } + } + + public int Count { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Count = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Count); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs b/src/TgSharp.TL/TL/Messages/TLMessagesSlice.cs similarity index 69% rename from src/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs rename to src/TgSharp.TL/TL/Messages/TLMessagesSlice.cs index 51c928a..1dc3272 100644 --- a/src/TeleSharp.TL/TL/Messages/TLMessagesSlice.cs +++ b/src/TgSharp.TL/TL/Messages/TLMessagesSlice.cs @@ -4,48 +4,60 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(189033187)] + [TLObject(-923939298)] public class TLMessagesSlice : TLAbsMessages { public override int Constructor { get { - return 189033187; + return -923939298; } } + public int Flags { get; set; } + public bool Inexact { get; set; } public int Count { get; set; } + public int? NextRate { get; set; } public TLVector Messages { get; set; } public TLVector Chats { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Inexact = (Flags & 2) != 0; Count = br.ReadInt32(); + if ((Flags & 1) != 0) + NextRate = br.ReadInt32(); + else + NextRate = null; + Messages = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(Count); + if ((Flags & 1) != 0) + bw.Write(NextRate.Value); ObjectUtils.SerializeObject(Messages, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs b/src/TgSharp.TL/TL/Messages/TLPeerDialogs.cs similarity index 86% rename from src/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLPeerDialogs.cs index 0d717f6..1d3683b 100644 --- a/src/TeleSharp.TL/TL/Messages/TLPeerDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLPeerDialogs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(863093588)] public class TLPeerDialogs : TLObject @@ -18,26 +20,24 @@ namespace TeleSharp.TL.Messages } } - public TLVector Dialogs { get; set; } + 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() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Dialogs = (TLVector)ObjectUtils.DeserializeVector(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); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); ObjectUtils.SerializeObject(State, bw); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRecentStickers.cs b/src/TgSharp.TL/TL/Messages/TLRecentStickers.cs new file mode 100644 index 0000000..723fd48 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRecentStickers.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(586395571)] + public class TLRecentStickers : TLAbsRecentStickers + { + public override int Constructor + { + get + { + return 586395571; + } + } + + public int Hash { get; set; } + public TLVector Packs { get; set; } + public TLVector Stickers { get; set; } + public TLVector Dates { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + Packs = (TLVector)ObjectUtils.DeserializeVector(br); + Stickers = (TLVector)ObjectUtils.DeserializeVector(br); + Dates = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + ObjectUtils.SerializeObject(Packs, bw); + ObjectUtils.SerializeObject(Stickers, bw); + ObjectUtils.SerializeObject(Dates, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs b/src/TgSharp.TL/TL/Messages/TLRecentStickersNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs rename to src/TgSharp.TL/TL/Messages/TLRecentStickersNotModified.cs index 06493b7..beff359 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRecentStickersNotModified.cs +++ b/src/TgSharp.TL/TL/Messages/TLRecentStickersNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(186120336)] public class TLRecentStickersNotModified : TLAbsRecentStickers @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Messages } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs b/src/TgSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs rename to src/TgSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs index fdc175a..70ab184 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestAcceptEncryption.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1035731989)] public class TLRequestAcceptEncryption : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public long KeyFingerprint { get; set; } public TLAbsEncryptedChat Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); GB = BytesUtil.Deserialize(br); KeyFingerprint = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Peer, bw); BytesUtil.Serialize(GB, bw); bw.Write(KeyFingerprint); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsEncryptedChat)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestAcceptUrlAuth.cs b/src/TgSharp.TL/TL/Messages/TLRequestAcceptUrlAuth.cs new file mode 100644 index 0000000..bd93a2c --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestAcceptUrlAuth.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-148247912)] + public class TLRequestAcceptUrlAuth : TLMethod + { + public override int Constructor + { + get + { + return -148247912; + } + } + + public int Flags { get; set; } + public bool WriteAllowed { get; set; } + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public int ButtonId { get; set; } + public TLAbsUrlAuthResult Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + WriteAllowed = (Flags & 1) != 0; + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + ButtonId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + bw.Write(ButtonId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUrlAuthResult)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs b/src/TgSharp.TL/TL/Messages/TLRequestAddChatUser.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs rename to src/TgSharp.TL/TL/Messages/TLRequestAddChatUser.cs index 275a442..0ce1ce8 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestAddChatUser.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestAddChatUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-106911223)] public class TLRequestAddChatUser : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public int FwdLimit { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages ChatId = br.ReadInt32(); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); FwdLimit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages bw.Write(ChatId); ObjectUtils.SerializeObject(UserId, bw); bw.Write(FwdLimit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs b/src/TgSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs rename to src/TgSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs index 7957e51..390851d 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestCheckChatInvite.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1051570619)] public class TLRequestCheckChatInvite : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public string Hash { get; set; } public TLAbsChatInvite Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Hash, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsChatInvite)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestClearAllDrafts.cs b/src/TgSharp.TL/TL/Messages/TLRequestClearAllDrafts.cs new file mode 100644 index 0000000..668f860 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestClearAllDrafts.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(2119757468)] + public class TLRequestClearAllDrafts : TLMethod + { + public override int Constructor + { + get + { + return 2119757468; + } + } + + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs similarity index 85% rename from src/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs index 052214a..0bf1fb9 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestClearRecentStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1986437075)] public class TLRequestClearRecentStickers : TLMethod @@ -22,33 +24,26 @@ namespace TeleSharp.TL.Messages public bool Attached { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Attached ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Attached = (Flags & 1) != 0; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs b/src/TgSharp.TL/TL/Messages/TLRequestCreateChat.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs rename to src/TgSharp.TL/TL/Messages/TLRequestCreateChat.cs index 8ec1cb4..6e11f84 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestCreateChat.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestCreateChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(164303470)] public class TLRequestCreateChat : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public string Title { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Users = (TLVector)ObjectUtils.DeserializeVector(br); Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Users, bw); StringUtil.Serialize(Title, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs b/src/TgSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs rename to src/TgSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs index 6529453..e5c03c9 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestDeleteChatUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-530505962)] public class TLRequestDeleteChatUser : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public TLAbsInputUser UserId { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(ChatId); ObjectUtils.SerializeObject(UserId, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs b/src/TgSharp.TL/TL/Messages/TLRequestDeleteHistory.cs similarity index 88% rename from src/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs rename to src/TgSharp.TL/TL/Messages/TLRequestDeleteHistory.cs index 917180f..930d521 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestDeleteHistory.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestDeleteHistory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(469850889)] public class TLRequestDeleteHistory : TLMethod @@ -20,41 +22,36 @@ namespace TeleSharp.TL.Messages public int Flags { get; set; } public bool JustClear { get; set; } + public bool Revoke { get; set; } public TLAbsInputPeer Peer { get; set; } public int MaxId { get; set; } public Messages.TLAffectedHistory Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = JustClear ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); JustClear = (Flags & 1) != 0; + Revoke = (Flags & 2) != 0; Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); MaxId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Peer, bw); bw.Write(MaxId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAffectedHistory)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestDeleteMessages.cs similarity index 88% rename from src/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs rename to src/TgSharp.TL/TL/Messages/TLRequestDeleteMessages.cs index f47d99d..bfa6b50 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestDeleteMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestDeleteMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-443640366)] public class TLRequestDeleteMessages : TLMethod @@ -23,12 +25,9 @@ namespace TeleSharp.TL.Messages public TLVector Id { get; set; } public Messages.TLAffectedMessages Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Revoke ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,22 +35,18 @@ namespace TeleSharp.TL.Messages Flags = br.ReadInt32(); Revoke = (Flags & 1) != 0; Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestDeleteScheduledMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestDeleteScheduledMessages.cs new file mode 100644 index 0000000..3486c1c --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestDeleteScheduledMessages.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1504586518)] + public class TLRequestDeleteScheduledMessages : TLMethod + { + public override int Constructor + { + get + { + return 1504586518; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLVector Id { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Id = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Id, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs b/src/TgSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs rename to src/TgSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs index 1ef45be..1645422 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestDiscardEncryption.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-304536635)] public class TLRequestDiscardEncryption : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int ChatId { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestEditChatAbout.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditChatAbout.cs new file mode 100644 index 0000000..4981fdf --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditChatAbout.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-554301545)] + public class TLRequestEditChatAbout : TLMethod + { + public override int Constructor + { + get + { + return -554301545; + } + } + + public TLAbsInputPeer Peer { get; set; } + public string About { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + About = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + StringUtil.Serialize(About, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs rename to src/TgSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs index 9258c3f..87cdfae 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditChatAdmin.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1444503762)] public class TLRequestEditChatAdmin : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public bool IsAdmin { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages ChatId = br.ReadInt32(); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); IsAdmin = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages bw.Write(ChatId); ObjectUtils.SerializeObject(UserId, bw); BoolUtil.Serialize(IsAdmin, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestEditChatDefaultBannedRights.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditChatDefaultBannedRights.cs new file mode 100644 index 0000000..8505f1a --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditChatDefaultBannedRights.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1517917375)] + public class TLRequestEditChatDefaultBannedRights : TLMethod + { + public override int Constructor + { + get + { + return -1517917375; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLChatBannedRights BannedRights { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + BannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(BannedRights, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs rename to src/TgSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs index ee58232..8d73ee8 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditChatPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-900957736)] public class TLRequestEditChatPhoto : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public TLAbsInputChatPhoto Photo { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); Photo = (TLAbsInputChatPhoto)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(ChatId); ObjectUtils.SerializeObject(Photo, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditChatTitle.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs rename to src/TgSharp.TL/TL/Messages/TLRequestEditChatTitle.cs index e6eb2bd..782ae2e 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestEditChatTitle.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditChatTitle.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-599447467)] public class TLRequestEditChatTitle : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public string Title { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(ChatId); StringUtil.Serialize(Title, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs rename to src/TgSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs index cf8340f..1c5e124 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditInlineBotMessage.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(319564933)] + [TLObject(-2091549254)] public class TLRequestEditInlineBotMessage : TLMethod { public override int Constructor { get { - return 319564933; + return -2091549254; } } @@ -22,19 +24,14 @@ namespace TeleSharp.TL.Messages public bool NoWebpage { get; set; } public TLInputBotInlineMessageID Id { get; set; } public string Message { get; set; } + public TLAbsInputMedia Media { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } public TLVector Entities { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 2) : (Flags & ~2); - Flags = Message != null ? (Flags | 2048) : (Flags & ~2048); - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - Flags = Entities != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -47,6 +44,11 @@ namespace TeleSharp.TL.Messages else Message = null; + if ((Flags & 16384) != 0) + Media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br); + else + Media = null; + if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else @@ -57,28 +59,26 @@ namespace TeleSharp.TL.Messages else Entities = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Id, bw); if ((Flags & 2048) != 0) StringUtil.Serialize(Message, bw); + if ((Flags & 16384) != 0) + ObjectUtils.SerializeObject(Media, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(Entities, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs b/src/TgSharp.TL/TL/Messages/TLRequestEditMessage.cs similarity index 75% rename from src/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs rename to src/TgSharp.TL/TL/Messages/TLRequestEditMessage.cs index d9109de..3f29f4f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestEditMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestEditMessage.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-829299510)] + [TLObject(1224152952)] public class TLRequestEditMessage : TLMethod { public override int Constructor { get { - return -829299510; + return 1224152952; } } @@ -23,19 +25,15 @@ namespace TeleSharp.TL.Messages public TLAbsInputPeer Peer { get; set; } public int Id { get; set; } public string Message { get; set; } + public TLAbsInputMedia Media { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } public TLVector Entities { get; set; } + public int? ScheduleDate { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 2) : (Flags & ~2); - Flags = Message != null ? (Flags | 2048) : (Flags & ~2048); - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - Flags = Entities != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -49,6 +47,11 @@ namespace TeleSharp.TL.Messages else Message = null; + if ((Flags & 16384) != 0) + Media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br); + else + Media = null; + if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else @@ -59,29 +62,34 @@ namespace TeleSharp.TL.Messages else Entities = null; + if ((Flags & 32768) != 0) + ScheduleDate = br.ReadInt32(); + else + ScheduleDate = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Peer, bw); bw.Write(Id); if ((Flags & 2048) != 0) StringUtil.Serialize(Message, bw); + if ((Flags & 16384) != 0) + ObjectUtils.SerializeObject(Media, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(Entities, bw); - + if ((Flags & 32768) != 0) + bw.Write(ScheduleDate.Value); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs b/src/TgSharp.TL/TL/Messages/TLRequestExportChatInvite.cs similarity index 72% rename from src/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs rename to src/TgSharp.TL/TL/Messages/TLRequestExportChatInvite.cs index 1e35315..c0bc79f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestExportChatInvite.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestExportChatInvite.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(2106086025)] + [TLObject(234312524)] public class TLRequestExportChatInvite : TLMethod { public override int Constructor { get { - return 2106086025; + return 234312524; } } - public int ChatId { get; set; } + public TLAbsInputPeer Peer { get; set; } public TLAbsExportedChatInvite Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - ChatId = br.ReadInt32(); - + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(ChatId); - + ObjectUtils.SerializeObject(Peer, bw); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestFaveSticker.cs b/src/TgSharp.TL/TL/Messages/TLRequestFaveSticker.cs new file mode 100644 index 0000000..90d307e --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestFaveSticker.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1174420133)] + public class TLRequestFaveSticker : TLMethod + { + public override int Constructor + { + get + { + return -1174420133; + } + } + + public TLAbsInputDocument Id { get; set; } + public bool Unfave { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); + Unfave = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Id, bw); + BoolUtil.Serialize(Unfave, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestForwardMessages.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs rename to src/TgSharp.TL/TL/Messages/TLRequestForwardMessages.cs index ac85f71..35badd6 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestForwardMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestForwardMessages.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(1888354709)] + [TLObject(-637606386)] public class TLRequestForwardMessages : TLMethod { public override int Constructor { get { - return 1888354709; + return -637606386; } } @@ -22,20 +24,17 @@ namespace TeleSharp.TL.Messages public bool Silent { get; set; } public bool Background { get; set; } public bool WithMyScore { get; set; } + public bool Grouped { get; set; } public TLAbsInputPeer FromPeer { get; set; } public TLVector Id { get; set; } public TLVector RandomId { get; set; } public TLAbsInputPeer ToPeer { get; set; } + public int? ScheduleDate { 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 = WithMyScore ? (Flags | 256) : (Flags & ~256); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -44,31 +43,33 @@ namespace TeleSharp.TL.Messages Silent = (Flags & 32) != 0; Background = (Flags & 64) != 0; WithMyScore = (Flags & 256) != 0; + Grouped = (Flags & 512) != 0; FromPeer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Id = (TLVector)ObjectUtils.DeserializeVector(br); RandomId = (TLVector)ObjectUtils.DeserializeVector(br); ToPeer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + if ((Flags & 1024) != 0) + ScheduleDate = br.ReadInt32(); + else + ScheduleDate = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - ObjectUtils.SerializeObject(FromPeer, bw); ObjectUtils.SerializeObject(Id, bw); ObjectUtils.SerializeObject(RandomId, bw); ObjectUtils.SerializeObject(ToPeer, bw); - + if ((Flags & 1024) != 0) + bw.Write(ScheduleDate.Value); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetAllChats.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetAllChats.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetAllChats.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetAllChats.cs index 042f37d..ea9cf54 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetAllChats.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetAllChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-341307408)] public class TLRequestGetAllChats : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLVector ExceptIds { get; set; } public Messages.TLAbsChats Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ExceptIds = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(ExceptIds, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs similarity index 86% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs index 7b40f9f..16c17cb 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetAllDrafts.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1782549861)] public class TLRequestGetAllDrafts : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Messages public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetAllStickers.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetAllStickers.cs index 14732fa..6666da0 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetAllStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetAllStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(479598769)] public class TLRequestGetAllStickers : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public Messages.TLAbsAllStickers Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsAllStickers)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs similarity index 88% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs index 065673a..23503ac 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetArchivedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1475442322)] public class TLRequestGetArchivedStickers : TLMethod @@ -24,12 +26,9 @@ namespace TeleSharp.TL.Messages public int Limit { get; set; } public Messages.TLArchivedStickers Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Masks ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -38,23 +37,19 @@ namespace TeleSharp.TL.Messages Masks = (Flags & 1) != 0; OffsetId = br.ReadInt64(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(OffsetId); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLArchivedStickers)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs index c5710e8..c9db37c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetAttachedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-866424884)] public class TLRequestGetAttachedStickers : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLAbsInputStickeredMedia Media { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Media = (TLAbsInputStickeredMedia)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Media, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs similarity index 87% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs index e22366d..da3aaf7 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetBotCallbackAnswer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-2130010132)] public class TLRequestGetBotCallbackAnswer : TLMethod @@ -25,13 +27,9 @@ namespace TeleSharp.TL.Messages 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -45,25 +43,21 @@ namespace TeleSharp.TL.Messages else Data = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Peer, bw); bw.Write(MsgId); if ((Flags & 1) != 0) BytesUtil.Serialize(Data, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLBotCallbackAnswer)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetChats.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetChats.cs index 7ca76b4..68a9532 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetChats.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1013621127)] public class TLRequestGetChats : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLVector Id { get; set; } public Messages.TLAbsChats Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetCommonChats.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetCommonChats.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetCommonChats.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetCommonChats.cs index 2721dd1..8b9196e 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetCommonChats.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetCommonChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(218777796)] public class TLRequestGetCommonChats : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public int Limit { get; set; } public Messages.TLAbsChats Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); MaxId = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(UserId, bw); bw.Write(MaxId); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsChats)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetDhConfig.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetDhConfig.cs index 30876b4..914aad9 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetDhConfig.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetDhConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(651135312)] public class TLRequestGetDhConfig : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public int RandomLength { get; set; } public Messages.TLAbsDhConfig Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Version = br.ReadInt32(); RandomLength = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Version); bw.Write(RandomLength); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsDhConfig)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetDialogUnreadMarks.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetDialogUnreadMarks.cs new file mode 100644 index 0000000..197eed6 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetDialogUnreadMarks.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(585256482)] + public class TLRequestGetDialogUnreadMarks : TLMethod + { + public override int Constructor + { + get + { + return 585256482; + } + } + + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetDialogs.cs similarity index 75% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetDialogs.cs index 34ea1f3..02e2b60 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetDialogs.cs @@ -4,63 +4,69 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(421243333)] + [TLObject(-1594999949)] public class TLRequestGetDialogs : TLMethod { public override int Constructor { get { - return 421243333; + return -1594999949; } } public int Flags { get; set; } public bool ExcludePinned { get; set; } + public int? FolderId { get; set; } public int OffsetDate { get; set; } public int OffsetId { get; set; } public TLAbsInputPeer OffsetPeer { get; set; } public int Limit { get; set; } + public int Hash { get; set; } public Messages.TLAbsDialogs Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ExcludePinned ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); ExcludePinned = (Flags & 1) != 0; + if ((Flags & 2) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + OffsetDate = br.ReadInt32(); OffsetId = br.ReadInt32(); OffsetPeer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Limit = br.ReadInt32(); - + Hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - + if ((Flags & 2) != 0) + bw.Write(FolderId.Value); bw.Write(OffsetDate); bw.Write(OffsetId); ObjectUtils.SerializeObject(OffsetPeer, bw); bw.Write(Limit); - + bw.Write(Hash); } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsDialogs)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs index 677799d..59e8ce1 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetDocumentByHash.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(864953444)] public class TLRequestGetDocumentByHash : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public string MimeType { get; set; } public TLAbsDocument Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages Sha256 = BytesUtil.Deserialize(br); Size = br.ReadInt32(); MimeType = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages BytesUtil.Serialize(Sha256, bw); bw.Write(Size); StringUtil.Serialize(MimeType, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywords.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywords.cs new file mode 100644 index 0000000..b75e445 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywords.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(899735650)] + public class TLRequestGetEmojiKeywords : TLMethod + { + public override int Constructor + { + get + { + return 899735650; + } + } + + public string LangCode { get; set; } + public TLEmojiKeywordsDifference Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCode = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangCode, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLEmojiKeywordsDifference)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywordsDifference.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywordsDifference.cs new file mode 100644 index 0000000..0be300d --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywordsDifference.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(352892591)] + public class TLRequestGetEmojiKeywordsDifference : TLMethod + { + public override int Constructor + { + get + { + return 352892591; + } + } + + public string LangCode { get; set; } + public int FromVersion { get; set; } + public TLEmojiKeywordsDifference Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCode = StringUtil.Deserialize(br); + FromVersion = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangCode, bw); + bw.Write(FromVersion); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLEmojiKeywordsDifference)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywordsLanguages.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywordsLanguages.cs new file mode 100644 index 0000000..f1b59be --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiKeywordsLanguages.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1318675378)] + public class TLRequestGetEmojiKeywordsLanguages : TLMethod + { + public override int Constructor + { + get + { + return 1318675378; + } + } + + public TLVector LangCodes { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCodes = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(LangCodes, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiURL.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiURL.cs new file mode 100644 index 0000000..a38b222 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetEmojiURL.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-709817306)] + public class TLRequestGetEmojiURL : TLMethod + { + public override int Constructor + { + get + { + return -709817306; + } + } + + public string LangCode { get; set; } + public TLEmojiURL Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCode = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangCode, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLEmojiURL)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetFavedStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetFavedStickers.cs new file mode 100644 index 0000000..28b19fe --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetFavedStickers.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(567151374)] + public class TLRequestGetFavedStickers : TLMethod + { + public override int Constructor + { + get + { + return 567151374; + } + } + + public int Hash { get; set; } + public Messages.TLAbsFavedStickers Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsFavedStickers)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs index 8004dbd..0cdbb08 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetFeaturedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(766298703)] public class TLRequestGetFeaturedStickers : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public Messages.TLAbsFeaturedStickers Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsFeaturedStickers)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetFullChat.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetFullChat.cs index e92c7a2..4779b7b 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetFullChat.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetFullChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(998448230)] public class TLRequestGetFullChat : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int ChatId { get; set; } public Messages.TLChatFull Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLChatFull)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs index f67bbcd..0357048 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetGameHighScores.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-400399203)] public class TLRequestGetGameHighScores : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public TLAbsInputUser UserId { get; set; } public Messages.TLHighScores Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Id = br.ReadInt32(); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Peer, bw); bw.Write(Id); ObjectUtils.SerializeObject(UserId, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLHighScores)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetHistory.cs similarity index 87% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetHistory.cs index f78f360..7dcc92f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetHistory.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetHistory.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1347868602)] + [TLObject(-591691168)] public class TLRequestGetHistory : TLMethod { public override int Constructor { get { - return -1347868602; + return -591691168; } } @@ -25,12 +27,12 @@ namespace TeleSharp.TL.Messages public int Limit { get; set; } public int MaxId { get; set; } public int MinId { get; set; } + public int Hash { get; set; } public Messages.TLAbsMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,7 +44,7 @@ namespace TeleSharp.TL.Messages Limit = br.ReadInt32(); MaxId = br.ReadInt32(); MinId = br.ReadInt32(); - + Hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) @@ -55,12 +57,12 @@ namespace TeleSharp.TL.Messages bw.Write(Limit); bw.Write(MaxId); bw.Write(MinId); - + bw.Write(Hash); } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs similarity index 91% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs index 7399be4..47d001f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetInlineBotResults.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1364105629)] public class TLRequestGetInlineBotResults : TLMethod @@ -26,12 +28,9 @@ namespace TeleSharp.TL.Messages public string Offset { get; set; } public Messages.TLBotResults Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = GeoPoint != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -46,13 +45,11 @@ namespace TeleSharp.TL.Messages Query = StringUtil.Deserialize(br); Offset = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(Bot, bw); ObjectUtils.SerializeObject(Peer, bw); @@ -60,12 +57,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(GeoPoint, bw); StringUtil.Serialize(Query, bw); StringUtil.Serialize(Offset, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLBotResults)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs index 1b46313..74a1f48 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetInlineGameHighScores.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(258170395)] public class TLRequestGetInlineGameHighScores : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public TLAbsInputUser UserId { get; set; } public Messages.TLHighScores Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); ObjectUtils.SerializeObject(UserId, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLHighScores)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs index 4fdb571..48162bd 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetMaskStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1706608543)] public class TLRequestGetMaskStickers : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public Messages.TLAbsAllStickers Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsAllStickers)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs index 4f074b9..ad9d078 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetMessageEditData.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-39416522)] public class TLRequestGetMessageEditData : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public int Id { get; set; } public Messages.TLMessageEditData Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); bw.Write(Id); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLMessageEditData)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetMessages.cs similarity index 73% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetMessages.cs index bbd12d9..579b2e5 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetMessages.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(1109588596)] + [TLObject(1673946374)] public class TLRequestGetMessages : TLMethod { public override int Constructor { get { - return 1109588596; + return 1673946374; } } - public TLVector Id { get; set; } + public TLVector Id { get; set; } public Messages.TLAbsMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Id = (TLVector)ObjectUtils.DeserializeVector(br); - + Id = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs index fe42888..0ef744a 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetMessagesViews.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-993483427)] public class TLRequestGetMessagesViews : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public bool Increment { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Id = (TLVector)ObjectUtils.DeserializeVector(br); Increment = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Id, bw); BoolUtil.Serialize(Increment, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetOnlines.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetOnlines.cs new file mode 100644 index 0000000..04f4b06 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetOnlines.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1848369232)] + public class TLRequestGetOnlines : TLMethod + { + public override int Constructor + { + get + { + return 1848369232; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLChatOnlines Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLChatOnlines)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs similarity index 73% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs index 6ad2466..6c6e887 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetPeerDialogs.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(764901049)] + [TLObject(-462373635)] public class TLRequestGetPeerDialogs : TLMethod { public override int Constructor { get { - return 764901049; + return -462373635; } } - public TLVector Peers { get; set; } + public TLVector Peers { get; set; } public Messages.TLPeerDialogs Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Peers = (TLVector)ObjectUtils.DeserializeVector(br); - + Peers = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peers, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLPeerDialogs)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs index cf66afe..413ef6f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetPeerSettings.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(913498268)] public class TLRequestGetPeerSettings : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLAbsInputPeer Peer { get; set; } public TLPeerSettings Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLPeerSettings)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetPinnedDialogs.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetPinnedDialogs.cs similarity index 76% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetPinnedDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetPinnedDialogs.cs index 4b8cee8..d4cb1b1 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetPinnedDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetPinnedDialogs.cs @@ -4,42 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-497756594)] + [TLObject(-692498958)] public class TLRequestGetPinnedDialogs : TLMethod { public override int Constructor { get { - return -497756594; + return -692498958; } } + public int FolderId { get; set; } public Messages.TLPeerDialogs Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + FolderId = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + bw.Write(FolderId); } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLPeerDialogs)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetPollResults.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetPollResults.cs new file mode 100644 index 0000000..a651cb6 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetPollResults.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1941660731)] + public class TLRequestGetPollResults : TLMethod + { + public override int Constructor + { + get + { + return 1941660731; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetRecentLocations.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetRecentLocations.cs new file mode 100644 index 0000000..0f47a48 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetRecentLocations.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1144759543)] + public class TLRequestGetRecentLocations : TLMethod + { + public override int Constructor + { + get + { + return -1144759543; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int Limit { get; set; } + public int Hash { get; set; } + public Messages.TLAbsMessages Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Limit = br.ReadInt32(); + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(Limit); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs similarity index 87% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs index 4d9ac23..93b09d1 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetRecentStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1587647177)] public class TLRequestGetRecentStickers : TLMethod @@ -23,12 +25,9 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public Messages.TLAbsRecentStickers Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Attached ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,22 +35,18 @@ namespace TeleSharp.TL.Messages Flags = br.ReadInt32(); Attached = (Flags & 1) != 0; Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsRecentStickers)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs index 436971b..5e815e7 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetSavedGifs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-2084618926)] public class TLRequestGetSavedGifs : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public Messages.TLAbsSavedGifs Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsSavedGifs)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetScheduledHistory.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetScheduledHistory.cs new file mode 100644 index 0000000..d568344 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetScheduledHistory.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-490575781)] + public class TLRequestGetScheduledHistory : TLMethod + { + public override int Constructor + { + get + { + return -490575781; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int Hash { get; set; } + public Messages.TLAbsMessages Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetScheduledMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetScheduledMessages.cs new file mode 100644 index 0000000..f81a56e --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetScheduledMessages.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1111817116)] + public class TLRequestGetScheduledMessages : TLMethod + { + public override int Constructor + { + get + { + return -1111817116; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLVector Id { get; set; } + public Messages.TLAbsMessages Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Id = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Id, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetSearchCounters.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetSearchCounters.cs new file mode 100644 index 0000000..582586b --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetSearchCounters.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1932455680)] + public class TLRequestGetSearchCounters : TLMethod + { + public override int Constructor + { + get + { + return 1932455680; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLVector Filters { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Filters = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Filters, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetSplitRanges.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetSplitRanges.cs new file mode 100644 index 0000000..428c3ed --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetSplitRanges.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(486505992)] + public class TLRequestGetSplitRanges : TLMethod + { + public override int Constructor + { + get + { + return 486505992; + } + } + + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing else + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetStatsURL.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetStatsURL.cs new file mode 100644 index 0000000..6a8ff8b --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetStatsURL.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-2127811866)] + public class TLRequestGetStatsURL : TLMethod + { + public override int Constructor + { + get + { + return -2127811866; + } + } + + public int Flags { get; set; } + public bool Dark { get; set; } + public TLAbsInputPeer Peer { get; set; } + public string Params { get; set; } + public TLStatsURL Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Dark = (Flags & 1) != 0; + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Params = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Peer, bw); + StringUtil.Serialize(Params, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLStatsURL)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetStickerSet.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetStickerSet.cs index cf15876..696727f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetStickerSet.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(639215886)] public class TLRequestGetStickerSet : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLAbsInputStickerSet Stickerset { get; set; } public Messages.TLStickerSet Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Stickerset, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetStickers.cs new file mode 100644 index 0000000..540a468 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetStickers.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(71126828)] + public class TLRequestGetStickers : TLMethod + { + public override int Constructor + { + get + { + return 71126828; + } + } + + public string Emoticon { get; set; } + public int Hash { get; set; } + public Messages.TLAbsStickers Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Emoticon = StringUtil.Deserialize(br); + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Emoticon, bw); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsStickers)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetUnreadMentions.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetUnreadMentions.cs new file mode 100644 index 0000000..92e06b6 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetUnreadMentions.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1180140658)] + public class TLRequestGetUnreadMentions : TLMethod + { + public override int Constructor + { + get + { + return 1180140658; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int OffsetId { get; set; } + public int AddOffset { get; set; } + public int Limit { get; set; } + public int MaxId { get; set; } + public int MinId { get; set; } + public Messages.TLAbsMessages Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + OffsetId = br.ReadInt32(); + AddOffset = br.ReadInt32(); + Limit = br.ReadInt32(); + MaxId = br.ReadInt32(); + MinId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(OffsetId); + bw.Write(AddOffset); + bw.Write(Limit); + bw.Write(MaxId); + bw.Write(MinId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetWebPage.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetWebPage.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetWebPage.cs rename to src/TgSharp.TL/TL/Messages/TLRequestGetWebPage.cs index 499828e..f29e70f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetWebPage.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetWebPage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(852135825)] public class TLRequestGetWebPage : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public TLAbsWebPage Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Url = StringUtil.Deserialize(br); Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); StringUtil.Serialize(Url, bw); bw.Write(Hash); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsWebPage)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs b/src/TgSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs new file mode 100644 index 0000000..35fb43d --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1956073268)] + public class TLRequestGetWebPagePreview : TLMethod + { + public override int Constructor + { + get + { + return -1956073268; + } + } + + public int Flags { get; set; } + public string Message { get; set; } + public TLVector Entities { get; set; } + public TLAbsMessageMedia Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Message = StringUtil.Deserialize(br); + if ((Flags & 8) != 0) + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + else + Entities = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Message, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Entities, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs b/src/TgSharp.TL/TL/Messages/TLRequestHidePeerSettingsBar.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs rename to src/TgSharp.TL/TL/Messages/TLRequestHidePeerSettingsBar.cs index b65333b..391a10c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestHideReportSpam.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestHidePeerSettingsBar.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1460572005)] - public class TLRequestHideReportSpam : TLMethod + [TLObject(1336717624)] + public class TLRequestHidePeerSettingsBar : TLMethod { public override int Constructor { get { - return -1460572005; + return 1336717624; } } public TLAbsInputPeer Peer { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs b/src/TgSharp.TL/TL/Messages/TLRequestImportChatInvite.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs rename to src/TgSharp.TL/TL/Messages/TLRequestImportChatInvite.cs index b28d7fe..e32bc7d 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestImportChatInvite.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestImportChatInvite.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1817183516)] public class TLRequestImportChatInvite : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public string Hash { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Hash, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs b/src/TgSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs rename to src/TgSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs index d14e913..9e74c39 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestInstallStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-946871200)] public class TLRequestInstallStickerSet : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public bool Archived { get; set; } public Messages.TLAbsStickerSetInstallResult Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); Archived = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Stickerset, bw); BoolUtil.Serialize(Archived, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsStickerSetInstallResult)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestMarkDialogUnread.cs b/src/TgSharp.TL/TL/Messages/TLRequestMarkDialogUnread.cs new file mode 100644 index 0000000..f4c5b28 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestMarkDialogUnread.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1031349873)] + public class TLRequestMarkDialogUnread : TLMethod + { + public override int Constructor + { + get + { + return -1031349873; + } + } + + public int Flags { get; set; } + public bool Unread { get; set; } + public TLAbsInputDialogPeer Peer { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Unread = (Flags & 1) != 0; + Peer = (TLAbsInputDialogPeer)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Peer, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs b/src/TgSharp.TL/TL/Messages/TLRequestMigrateChat.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs rename to src/TgSharp.TL/TL/Messages/TLRequestMigrateChat.cs index a754f8d..2ff517c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestMigrateChat.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestMigrateChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(363051235)] public class TLRequestMigrateChat : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int ChatId { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs b/src/TgSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs index 942a94f..925142f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReadEncryptedHistory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(2135648522)] public class TLRequestReadEncryptedHistory : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public int MaxDate { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); MaxDate = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); bw.Write(MaxDate); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs b/src/TgSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs index 265a434..3723078 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReadFeaturedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1527873830)] public class TLRequestReadFeaturedStickers : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLVector Id { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs b/src/TgSharp.TL/TL/Messages/TLRequestReadHistory.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReadHistory.cs index 0c983d3..1b14ab9 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReadHistory.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReadHistory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(238054714)] public class TLRequestReadHistory : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public int MaxId { get; set; } public Messages.TLAffectedMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); MaxId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); bw.Write(MaxId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestReadMentions.cs b/src/TgSharp.TL/TL/Messages/TLRequestReadMentions.cs new file mode 100644 index 0000000..38f02eb --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestReadMentions.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(251759059)] + public class TLRequestReadMentions : TLMethod + { + public override int Constructor + { + get + { + return 251759059; + } + } + + public TLAbsInputPeer Peer { get; set; } + public Messages.TLAffectedHistory Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAffectedHistory)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs b/src/TgSharp.TL/TL/Messages/TLRequestReadMessageContents.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReadMessageContents.cs index 250e05b..5ae18a3 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReadMessageContents.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReadMessageContents.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(916930423)] public class TLRequestReadMessageContents : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLVector Id { get; set; } public Messages.TLAffectedMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAffectedMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestReceivedMessages.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReceivedMessages.cs index 99cbcd5..6b7efd7 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReceivedMessages.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReceivedMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(94983360)] public class TLRequestReceivedMessages : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int MaxId { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MaxId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(MaxId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs b/src/TgSharp.TL/TL/Messages/TLRequestReceivedQueue.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReceivedQueue.cs index eb6ba35..b77f1e9 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReceivedQueue.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReceivedQueue.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1436924774)] public class TLRequestReceivedQueue : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public int MaxQts { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MaxQts = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(MaxQts); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReorderPinnedDialogs.cs b/src/TgSharp.TL/TL/Messages/TLRequestReorderPinnedDialogs.cs similarity index 69% rename from src/TeleSharp.TL/TL/Messages/TLRequestReorderPinnedDialogs.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReorderPinnedDialogs.cs index 47fdd9c..c311103 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReorderPinnedDialogs.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReorderPinnedDialogs.cs @@ -4,54 +4,52 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1784678844)] + [TLObject(991616823)] public class TLRequestReorderPinnedDialogs : TLMethod { public override int Constructor { get { - return -1784678844; + return 991616823; } } public int Flags { get; set; } public bool Force { get; set; } - public TLVector Order { get; set; } + public int FolderId { get; set; } + public TLVector Order { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Force ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Force = (Flags & 1) != 0; - Order = (TLVector)ObjectUtils.DeserializeVector(br); - + FolderId = br.ReadInt32(); + Order = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - + bw.Write(FolderId); ObjectUtils.SerializeObject(Order, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs b/src/TgSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs similarity index 87% rename from src/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs index 4bb0256..29019e3 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReorderStickerSets.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(2016638777)] public class TLRequestReorderStickerSets : TLMethod @@ -23,12 +25,9 @@ namespace TeleSharp.TL.Messages public TLVector Order { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Masks ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,22 +35,18 @@ namespace TeleSharp.TL.Messages Flags = br.ReadInt32(); Masks = (Flags & 1) != 0; Order = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Order, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestReport.cs b/src/TgSharp.TL/TL/Messages/TLRequestReport.cs new file mode 100644 index 0000000..7f03e0a --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestReport.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1115507112)] + public class TLRequestReport : TLMethod + { + public override int Constructor + { + get + { + return -1115507112; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLVector Id { get; set; } + public TLAbsReportReason Reason { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Id = (TLVector)ObjectUtils.DeserializeVector(br); + Reason = (TLAbsReportReason)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Id, bw); + ObjectUtils.SerializeObject(Reason, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReportEncryptedSpam.cs b/src/TgSharp.TL/TL/Messages/TLRequestReportEncryptedSpam.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestReportEncryptedSpam.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReportEncryptedSpam.cs index 2bfd9bd..ee4cce4 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReportEncryptedSpam.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReportEncryptedSpam.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1259113487)] public class TLRequestReportEncryptedSpam : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLInputEncryptedChat Peer { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs b/src/TgSharp.TL/TL/Messages/TLRequestReportSpam.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs rename to src/TgSharp.TL/TL/Messages/TLRequestReportSpam.cs index 9aabf24..20ce9e5 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestReportSpam.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestReportSpam.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-820669733)] public class TLRequestReportSpam : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLAbsInputPeer Peer { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs b/src/TgSharp.TL/TL/Messages/TLRequestRequestEncryption.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs rename to src/TgSharp.TL/TL/Messages/TLRequestRequestEncryption.cs index 36a66e1..1d1b705 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestRequestEncryption.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestRequestEncryption.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-162681021)] public class TLRequestRequestEncryption : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public byte[] GA { get; set; } public TLAbsEncryptedChat Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); RandomId = br.ReadInt32(); GA = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(UserId, bw); bw.Write(RandomId); BytesUtil.Serialize(GA, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsEncryptedChat)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestRequestUrlAuth.cs b/src/TgSharp.TL/TL/Messages/TLRequestRequestUrlAuth.cs new file mode 100644 index 0000000..922808b --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestRequestUrlAuth.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-482388461)] + public class TLRequestRequestUrlAuth : TLMethod + { + public override int Constructor + { + get + { + return -482388461; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public int ButtonId { get; set; } + public TLAbsUrlAuthResult Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + ButtonId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + bw.Write(ButtonId); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUrlAuthResult)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs b/src/TgSharp.TL/TL/Messages/TLRequestSaveDraft.cs similarity index 86% rename from src/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSaveDraft.cs index 4c31964..2a9b573 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSaveDraft.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSaveDraft.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1137057461)] public class TLRequestSaveDraft : TLMethod @@ -26,14 +28,9 @@ namespace TeleSharp.TL.Messages public TLVector Entities { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 2) : (Flags & ~2); - Flags = ReplyToMsgId != null ? (Flags | 1) : (Flags & ~1); - Flags = Entities != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -52,27 +49,23 @@ namespace TeleSharp.TL.Messages else Entities = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - if ((Flags & 1) != 0) bw.Write(ReplyToMsgId.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); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs b/src/TgSharp.TL/TL/Messages/TLRequestSaveGif.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSaveGif.cs index cbce789..a404026 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSaveGif.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSaveGif.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(846868683)] public class TLRequestSaveGif : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public bool Unsave { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); Unsave = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); BoolUtil.Serialize(Unsave, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs b/src/TgSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs similarity index 88% rename from src/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs index 524b75e..d47cd2e 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSaveRecentSticker.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(958863608)] public class TLRequestSaveRecentSticker : TLMethod @@ -24,12 +26,9 @@ namespace TeleSharp.TL.Messages public bool Unsave { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Attached ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -38,23 +37,19 @@ namespace TeleSharp.TL.Messages Attached = (Flags & 1) != 0; Id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); Unsave = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Id, bw); BoolUtil.Serialize(Unsave, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSearch.cs b/src/TgSharp.TL/TL/Messages/TLRequestSearch.cs similarity index 67% rename from src/TeleSharp.TL/TL/Messages/TLRequestSearch.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSearch.cs index b9fb8b3..547470e 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSearch.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSearch.cs @@ -4,36 +4,40 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-732523960)] + [TLObject(-2045448344)] public class TLRequestSearch : TLMethod { public override int Constructor { get { - return -732523960; + return -2045448344; } } public int Flags { get; set; } public TLAbsInputPeer Peer { get; set; } public string Q { get; set; } + public TLAbsInputUser FromId { get; set; } public TLAbsMessagesFilter Filter { get; set; } public int MinDate { get; set; } public int MaxDate { get; set; } - public int Offset { get; set; } - public int MaxId { get; set; } + public int OffsetId { get; set; } + public int AddOffset { get; set; } public int Limit { get; set; } + public int MaxId { get; set; } + public int MinId { get; set; } + public int Hash { get; set; } public Messages.TLAbsMessages Response { get; set; } - public void ComputeFlags() { - Flags = 0; - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,34 +45,44 @@ namespace TeleSharp.TL.Messages Flags = br.ReadInt32(); Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Q = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + FromId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + else + FromId = null; + Filter = (TLAbsMessagesFilter)ObjectUtils.DeserializeObject(br); MinDate = br.ReadInt32(); MaxDate = br.ReadInt32(); - Offset = br.ReadInt32(); - MaxId = br.ReadInt32(); + OffsetId = br.ReadInt32(); + AddOffset = br.ReadInt32(); Limit = br.ReadInt32(); - + MaxId = br.ReadInt32(); + MinId = br.ReadInt32(); + Hash = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(Peer, bw); StringUtil.Serialize(Q, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(FromId, bw); ObjectUtils.SerializeObject(Filter, bw); bw.Write(MinDate); bw.Write(MaxDate); - bw.Write(Offset); - bw.Write(MaxId); + bw.Write(OffsetId); + bw.Write(AddOffset); bw.Write(Limit); - + bw.Write(MaxId); + bw.Write(MinId); + bw.Write(Hash); } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs b/src/TgSharp.TL/TL/Messages/TLRequestSearchGifs.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSearchGifs.cs index a83eb68..04cc95c 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSearchGifs.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSearchGifs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1080395925)] public class TLRequestSearchGifs : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public int Offset { get; set; } public Messages.TLFoundGifs Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Q = StringUtil.Deserialize(br); Offset = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); StringUtil.Serialize(Q, bw); bw.Write(Offset); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLFoundGifs)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs b/src/TgSharp.TL/TL/Messages/TLRequestSearchGlobal.cs similarity index 68% rename from src/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSearchGlobal.cs index 990d5b1..1623f03 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSearchGlobal.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSearchGlobal.cs @@ -4,57 +4,67 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1640190800)] + [TLObject(-1083038300)] public class TLRequestSearchGlobal : TLMethod { public override int Constructor { get { - return -1640190800; + return -1083038300; } } + public int Flags { get; set; } + public int? FolderId { get; set; } public string Q { get; set; } - public int OffsetDate { get; set; } + public int OffsetRate { get; set; } public TLAbsInputPeer OffsetPeer { get; set; } public int OffsetId { get; set; } public int Limit { get; set; } public Messages.TLAbsMessages Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + Q = StringUtil.Deserialize(br); - OffsetDate = br.ReadInt32(); + OffsetRate = br.ReadInt32(); OffsetPeer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); OffsetId = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + bw.Write(FolderId.Value); StringUtil.Serialize(Q, bw); - bw.Write(OffsetDate); + bw.Write(OffsetRate); ObjectUtils.SerializeObject(OffsetPeer, bw); bw.Write(OffsetId); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsMessages)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestSearchStickerSets.cs b/src/TgSharp.TL/TL/Messages/TLRequestSearchStickerSets.cs new file mode 100644 index 0000000..148db00 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestSearchStickerSets.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1028140917)] + public class TLRequestSearchStickerSets : TLMethod + { + public override int Constructor + { + get + { + return -1028140917; + } + } + + public int Flags { get; set; } + public bool ExcludeFeatured { get; set; } + public string Q { get; set; } + public int Hash { get; set; } + public Messages.TLAbsFoundStickerSets Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + ExcludeFeatured = (Flags & 1) != 0; + Q = StringUtil.Deserialize(br); + Hash = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Q, bw); + bw.Write(Hash); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (Messages.TLAbsFoundStickerSets)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendEncrypted.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendEncrypted.cs index d5a1816..192b2aa 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSendEncrypted.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendEncrypted.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1451792525)] public class TLRequestSendEncrypted : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public byte[] Data { get; set; } public Messages.TLAbsSentEncryptedMessage Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); RandomId = br.ReadInt64(); Data = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Peer, bw); bw.Write(RandomId); BytesUtil.Serialize(Data, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsSentEncryptedMessage)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs similarity index 95% rename from src/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs index 9d4c3aa..00af697 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendEncryptedFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1701831834)] public class TLRequestSendEncryptedFile : TLMethod @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Messages public TLAbsInputEncryptedFile File { get; set; } public Messages.TLAbsSentEncryptedMessage Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +37,6 @@ namespace TeleSharp.TL.Messages RandomId = br.ReadInt64(); Data = BytesUtil.Deserialize(br); File = (TLAbsInputEncryptedFile)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +46,11 @@ namespace TeleSharp.TL.Messages bw.Write(RandomId); BytesUtil.Serialize(Data, bw); ObjectUtils.SerializeObject(File, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsSentEncryptedMessage)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs index 787db61..3b951da 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendEncryptedService.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(852769188)] public class TLRequestSendEncryptedService : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Messages public byte[] Data { get; set; } public Messages.TLAbsSentEncryptedMessage Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Messages Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); RandomId = br.ReadInt64(); Data = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Peer, bw); bw.Write(RandomId); BytesUtil.Serialize(Data, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLAbsSentEncryptedMessage)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs similarity index 79% rename from src/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs index 74b5c25..5616165 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendInlineBotResult.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1318189314)] + [TLObject(570955184)] public class TLRequestSendInlineBotResult : TLMethod { public override int Constructor { get { - return -1318189314; + return 570955184; } } @@ -22,22 +24,18 @@ namespace TeleSharp.TL.Messages public bool Silent { get; set; } public bool Background { get; set; } public bool ClearDraft { get; set; } + public bool HideVia { get; set; } public TLAbsInputPeer Peer { get; set; } public int? ReplyToMsgId { get; set; } public long RandomId { get; set; } public long QueryId { get; set; } public string Id { get; set; } + public int? ScheduleDate { 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 = ClearDraft ? (Flags | 128) : (Flags & ~128); - Flags = ReplyToMsgId != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -46,6 +44,7 @@ namespace TeleSharp.TL.Messages Silent = (Flags & 32) != 0; Background = (Flags & 64) != 0; ClearDraft = (Flags & 128) != 0; + HideVia = (Flags & 2048) != 0; Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); if ((Flags & 1) != 0) ReplyToMsgId = br.ReadInt32(); @@ -55,29 +54,30 @@ namespace TeleSharp.TL.Messages RandomId = br.ReadInt64(); QueryId = br.ReadInt64(); Id = StringUtil.Deserialize(br); + if ((Flags & 1024) != 0) + ScheduleDate = br.ReadInt32(); + else + ScheduleDate = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - ObjectUtils.SerializeObject(Peer, bw); if ((Flags & 1) != 0) bw.Write(ReplyToMsgId.Value); bw.Write(RandomId); bw.Write(QueryId); StringUtil.Serialize(Id, bw); - + if ((Flags & 1024) != 0) + bw.Write(ScheduleDate.Value); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendMedia.cs similarity index 70% rename from src/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendMedia.cs index f8606e7..a80b625 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSendMedia.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendMedia.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-923703407)] + [TLObject(881978281)] public class TLRequestSendMedia : TLMethod { public override int Constructor { get { - return -923703407; + return 881978281; } } @@ -25,20 +27,16 @@ namespace TeleSharp.TL.Messages public TLAbsInputPeer Peer { get; set; } public int? ReplyToMsgId { get; set; } public TLAbsInputMedia Media { get; set; } + public string Message { get; set; } public long RandomId { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } + public TLVector Entities { get; set; } + public int? ScheduleDate { 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 = ClearDraft ? (Flags | 128) : (Flags & ~128); - Flags = ReplyToMsgId != null ? (Flags | 1) : (Flags & ~1); - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -54,36 +52,46 @@ namespace TeleSharp.TL.Messages ReplyToMsgId = null; Media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br); + Message = StringUtil.Deserialize(br); RandomId = br.ReadInt64(); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; + if ((Flags & 8) != 0) + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + else + Entities = null; + + if ((Flags & 1024) != 0) + ScheduleDate = br.ReadInt32(); + else + ScheduleDate = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - ObjectUtils.SerializeObject(Peer, bw); if ((Flags & 1) != 0) bw.Write(ReplyToMsgId.Value); ObjectUtils.SerializeObject(Media, bw); + StringUtil.Serialize(Message, bw); bw.Write(RandomId); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Entities, bw); + if ((Flags & 1024) != 0) + bw.Write(ScheduleDate.Value); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendMessage.cs similarity index 80% rename from src/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendMessage.cs index 84d0a2a..33a240a 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSendMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendMessage.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-91733382)] + [TLObject(1376532592)] public class TLRequestSendMessage : TLMethod { public override int Constructor { get { - return -91733382; + return 1376532592; } } @@ -29,20 +31,12 @@ namespace TeleSharp.TL.Messages public long RandomId { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } public TLVector Entities { get; set; } + public int? ScheduleDate { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 2) : (Flags & ~2); - Flags = Silent ? (Flags | 32) : (Flags & ~32); - Flags = Background ? (Flags | 64) : (Flags & ~64); - Flags = ClearDraft ? (Flags | 128) : (Flags & ~128); - Flags = ReplyToMsgId != null ? (Flags | 1) : (Flags & ~1); - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - Flags = Entities != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -70,18 +64,17 @@ namespace TeleSharp.TL.Messages else Entities = null; + if ((Flags & 1024) != 0) + ScheduleDate = br.ReadInt32(); + else + ScheduleDate = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - ObjectUtils.SerializeObject(Peer, bw); if ((Flags & 1) != 0) bw.Write(ReplyToMsgId.Value); @@ -91,12 +84,13 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(ReplyMarkup, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(Entities, bw); - + if ((Flags & 1024) != 0) + bw.Write(ScheduleDate.Value); } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestSendMultiMedia.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendMultiMedia.cs new file mode 100644 index 0000000..caa1d13 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendMultiMedia.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-872345397)] + public class TLRequestSendMultiMedia : TLMethod + { + public override int Constructor + { + get + { + return -872345397; + } + } + + public int Flags { get; set; } + public bool Silent { get; set; } + public bool Background { get; set; } + public bool ClearDraft { get; set; } + public TLAbsInputPeer Peer { get; set; } + public int? ReplyToMsgId { get; set; } + public TLVector MultiMedia { get; set; } + public int? ScheduleDate { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Silent = (Flags & 32) != 0; + Background = (Flags & 64) != 0; + ClearDraft = (Flags & 128) != 0; + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + ReplyToMsgId = br.ReadInt32(); + else + ReplyToMsgId = null; + + MultiMedia = (TLVector)ObjectUtils.DeserializeVector(br); + if ((Flags & 1024) != 0) + ScheduleDate = br.ReadInt32(); + else + ScheduleDate = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Peer, bw); + if ((Flags & 1) != 0) + bw.Write(ReplyToMsgId.Value); + ObjectUtils.SerializeObject(MultiMedia, bw); + if ((Flags & 1024) != 0) + bw.Write(ScheduleDate.Value); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/Messages/TLRequestSendScheduledMessages.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendScheduledMessages.cs new file mode 100644 index 0000000..f497dee --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendScheduledMessages.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-1120369398)] + public class TLRequestSendScheduledMessages : TLMethod + { + public override int Constructor + { + get + { + return -1120369398; + } + } + + public TLAbsInputPeer Peer { get; set; } + public TLVector Id { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + Id = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Id, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendScreenshotNotification.cs similarity index 75% rename from src/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSendScreenshotNotification.cs index cb704cd..f9c6653 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestForwardMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendScreenshotNotification.cs @@ -4,51 +4,50 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(865483769)] - public class TLRequestForwardMessage : TLMethod + [TLObject(-914493408)] + public class TLRequestSendScreenshotNotification : TLMethod { public override int Constructor { get { - return 865483769; + return -914493408; } } public TLAbsInputPeer Peer { get; set; } - public int Id { get; set; } + public int ReplyToMsgId { get; set; } public long RandomId { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - Id = br.ReadInt32(); + ReplyToMsgId = br.ReadInt32(); RandomId = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - bw.Write(Id); + bw.Write(ReplyToMsgId); bw.Write(RandomId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestSendVote.cs b/src/TgSharp.TL/TL/Messages/TLRequestSendVote.cs new file mode 100644 index 0000000..d047cf5 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestSendVote.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(283795844)] + public class TLRequestSendVote : TLMethod + { + public override int Constructor + { + get + { + return 283795844; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public TLVector Options { get; set; } + public TLAbsUpdates Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + Options = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + ObjectUtils.SerializeObject(Options, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs similarity index 85% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs index 96ab6ff..4467417 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetBotCallbackAnswer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-712043766)] public class TLRequestSetBotCallbackAnswer : TLMethod @@ -26,14 +28,9 @@ namespace TeleSharp.TL.Messages public int CacheTime { 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -52,27 +49,23 @@ namespace TeleSharp.TL.Messages Url = null; CacheTime = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(QueryId); if ((Flags & 1) != 0) StringUtil.Serialize(Message, bw); if ((Flags & 4) != 0) StringUtil.Serialize(Url, bw); bw.Write(CacheTime); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetBotPrecheckoutResults.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetBotPrecheckoutResults.cs similarity index 85% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetBotPrecheckoutResults.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetBotPrecheckoutResults.cs index 88311c3..2f8b161 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetBotPrecheckoutResults.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetBotPrecheckoutResults.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(163765653)] public class TLRequestSetBotPrecheckoutResults : TLMethod @@ -24,13 +26,9 @@ namespace TeleSharp.TL.Messages public string Error { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Success ? (Flags | 2) : (Flags & ~2); - Flags = Error != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -43,24 +41,20 @@ namespace TeleSharp.TL.Messages else Error = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(QueryId); if ((Flags & 1) != 0) StringUtil.Serialize(Error, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetBotShippingResults.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetBotShippingResults.cs similarity index 87% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetBotShippingResults.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetBotShippingResults.cs index 80e4d84..32eab78 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetBotShippingResults.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetBotShippingResults.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-436833542)] public class TLRequestSetBotShippingResults : TLMethod @@ -24,13 +26,9 @@ namespace TeleSharp.TL.Messages public TLVector ShippingOptions { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Error != null ? (Flags | 1) : (Flags & ~1); - Flags = ShippingOptions != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -47,25 +45,22 @@ namespace TeleSharp.TL.Messages else ShippingOptions = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(QueryId); if ((Flags & 1) != 0) StringUtil.Serialize(Error, bw); if ((Flags & 2) != 0) ObjectUtils.SerializeObject(ShippingOptions, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs index 8c79475..837a221 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetEncryptedTyping.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(2031374829)] public class TLRequestSetEncryptedTyping : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public bool Typing { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); Typing = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); BoolUtil.Serialize(Typing, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetGameScore.cs similarity index 88% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetGameScore.cs index 111327e..57e91ed 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetGameScore.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetGameScore.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1896289088)] public class TLRequestSetGameScore : TLMethod @@ -27,13 +29,9 @@ namespace TeleSharp.TL.Messages public int Score { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = EditMessage ? (Flags | 1) : (Flags & ~1); - Flags = Force ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -45,26 +43,21 @@ namespace TeleSharp.TL.Messages Id = br.ReadInt32(); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); Score = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - ObjectUtils.SerializeObject(Peer, bw); bw.Write(Id); ObjectUtils.SerializeObject(UserId, bw); bw.Write(Score); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs similarity index 85% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs index 666e6fa..b734998 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetInlineBotResults.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-346119674)] public class TLRequestSetInlineBotResults : TLMethod @@ -28,15 +30,9 @@ namespace TeleSharp.TL.Messages public TLInlineBotSwitchPM SwitchPm { 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 = NextOffset != null ? (Flags | 4) : (Flags & ~4); - Flags = SwitchPm != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -57,16 +53,12 @@ namespace TeleSharp.TL.Messages else SwitchPm = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(QueryId); ObjectUtils.SerializeObject(Results, bw); bw.Write(CacheTime); @@ -74,12 +66,11 @@ namespace TeleSharp.TL.Messages StringUtil.Serialize(NextOffset, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(SwitchPm, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs similarity index 87% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs index 336ad0f..2e4de96 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(363700068)] public class TLRequestSetInlineGameScore : TLMethod @@ -26,13 +28,9 @@ namespace TeleSharp.TL.Messages public int Score { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = EditMessage ? (Flags | 1) : (Flags & ~1); - Flags = Force ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -43,25 +41,20 @@ namespace TeleSharp.TL.Messages Id = (TLInputBotInlineMessageID)ObjectUtils.DeserializeObject(br); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); Score = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - ObjectUtils.SerializeObject(Id, bw); ObjectUtils.SerializeObject(UserId, bw); bw.Write(Score); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs b/src/TgSharp.TL/TL/Messages/TLRequestSetTyping.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs rename to src/TgSharp.TL/TL/Messages/TLRequestSetTyping.cs index 62e7bed..52b7682 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestSetTyping.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestSetTyping.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1551737264)] public class TLRequestSetTyping : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public TLAbsSendMessageAction Action { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Action = (TLAbsSendMessageAction)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Action, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs b/src/TgSharp.TL/TL/Messages/TLRequestStartBot.cs similarity index 95% rename from src/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs rename to src/TgSharp.TL/TL/Messages/TLRequestStartBot.cs index 15eb75d..0649a09 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestStartBot.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestStartBot.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-421563528)] public class TLRequestStartBot : TLMethod @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Messages public string StartParam { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +37,6 @@ namespace TeleSharp.TL.Messages Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); RandomId = br.ReadInt64(); StartParam = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +46,11 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Peer, bw); bw.Write(RandomId); StringUtil.Serialize(StartParam, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs b/src/TgSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs similarity index 74% rename from src/TeleSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs rename to src/TgSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs index cfc6029..304084d 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs @@ -4,54 +4,49 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(847887978)] + [TLObject(-1489903017)] public class TLRequestToggleDialogPin : TLMethod { public override int Constructor { get { - return 847887978; + return -1489903017; } } public int Flags { get; set; } public bool Pinned { get; set; } - public TLAbsInputPeer Peer { get; set; } + public TLAbsInputDialogPeer Peer { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Pinned ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Pinned = (Flags & 1) != 0; - Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - + Peer = (TLAbsInputDialogPeer)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs b/src/TgSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs similarity index 93% rename from src/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs rename to src/TgSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs index 7ff4676..a121627 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestUninstallStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-110209570)] public class TLRequestUninstallStickerSet : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Messages public TLAbsInputStickerSet Stickerset { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Stickerset, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs b/src/TgSharp.TL/TL/Messages/TLRequestUpdatePinnedMessage.cs similarity index 71% rename from src/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs rename to src/TgSharp.TL/TL/Messages/TLRequestUpdatePinnedMessage.cs index 45014fd..7766dc1 100644 --- a/src/TeleSharp.TL/TL/Channels/TLRequestUpdatePinnedMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestUpdatePinnedMessage.cs @@ -4,57 +4,52 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Channels + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1490162350)] + [TLObject(-760547348)] public class TLRequestUpdatePinnedMessage : TLMethod { public override int Constructor { get { - return -1490162350; + return -760547348; } } public int Flags { get; set; } public bool Silent { get; set; } - public TLAbsInputChannel Channel { get; set; } + public TLAbsInputPeer Peer { get; set; } public int Id { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Silent ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Silent = (Flags & 1) != 0; - Channel = (TLAbsInputChannel)ObjectUtils.DeserializeObject(br); + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - ObjectUtils.SerializeObject(Channel, bw); + ObjectUtils.SerializeObject(Peer, bw); bw.Write(Id); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Messages/TLRequestUploadEncryptedFile.cs b/src/TgSharp.TL/TL/Messages/TLRequestUploadEncryptedFile.cs new file mode 100644 index 0000000..91220cb --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLRequestUploadEncryptedFile.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(1347929239)] + public class TLRequestUploadEncryptedFile : TLMethod + { + public override int Constructor + { + get + { + return 1347929239; + } + } + + public TLInputEncryptedChat Peer { get; set; } + public TLAbsInputEncryptedFile File { get; set; } + public TLAbsEncryptedFile Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLInputEncryptedChat)ObjectUtils.DeserializeObject(br); + File = (TLAbsInputEncryptedFile)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(File, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLAbsEncryptedFile)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestUploadMedia.cs b/src/TgSharp.TL/TL/Messages/TLRequestUploadMedia.cs similarity index 94% rename from src/TeleSharp.TL/TL/Messages/TLRequestUploadMedia.cs rename to src/TgSharp.TL/TL/Messages/TLRequestUploadMedia.cs index eefa512..27e84ca 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestUploadMedia.cs +++ b/src/TgSharp.TL/TL/Messages/TLRequestUploadMedia.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1369162417)] public class TLRequestUploadMedia : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Messages public TLAbsInputMedia Media { get; set; } public TLAbsMessageMedia Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); Media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Media, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLSavedGifs.cs b/src/TgSharp.TL/TL/Messages/TLSavedGifs.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLSavedGifs.cs rename to src/TgSharp.TL/TL/Messages/TLSavedGifs.cs index 07cd450..8aa097f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLSavedGifs.cs +++ b/src/TgSharp.TL/TL/Messages/TLSavedGifs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(772213157)] public class TLSavedGifs : TLAbsSavedGifs @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int Hash { get; set; } public TLVector Gifs { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Hash = br.ReadInt32(); Gifs = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Hash); ObjectUtils.SerializeObject(Gifs, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs b/src/TgSharp.TL/TL/Messages/TLSavedGifsNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs rename to src/TgSharp.TL/TL/Messages/TLSavedGifsNotModified.cs index b0d0b70..2243cc8 100644 --- a/src/TeleSharp.TL/TL/Messages/TLSavedGifsNotModified.cs +++ b/src/TgSharp.TL/TL/Messages/TLSavedGifsNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-402498398)] public class TLSavedGifsNotModified : TLAbsSavedGifs @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Messages } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/Messages/TLSearchCounter.cs b/src/TgSharp.TL/TL/Messages/TLSearchCounter.cs new file mode 100644 index 0000000..8c96463 --- /dev/null +++ b/src/TgSharp.TL/TL/Messages/TLSearchCounter.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Messages +{ + [TLObject(-398136321)] + public class TLSearchCounter : TLObject + { + public override int Constructor + { + get + { + return -398136321; + } + } + + public int Flags { get; set; } + public bool Inexact { get; set; } + public TLAbsMessagesFilter Filter { get; set; } + public int Count { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Inexact = (Flags & 2) != 0; + Filter = (TLAbsMessagesFilter)ObjectUtils.DeserializeObject(br); + Count = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Filter, bw); + bw.Write(Count); + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs b/src/TgSharp.TL/TL/Messages/TLSentEncryptedFile.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs rename to src/TgSharp.TL/TL/Messages/TLSentEncryptedFile.cs index 274cc0b..d106576 100644 --- a/src/TeleSharp.TL/TL/Messages/TLSentEncryptedFile.cs +++ b/src/TgSharp.TL/TL/Messages/TLSentEncryptedFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1802240206)] public class TLSentEncryptedFile : TLAbsSentEncryptedMessage @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Messages public int Date { get; set; } public TLAbsEncryptedFile File { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Date = br.ReadInt32(); File = (TLAbsEncryptedFile)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Messages bw.Write(Constructor); bw.Write(Date); ObjectUtils.SerializeObject(File, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs b/src/TgSharp.TL/TL/Messages/TLSentEncryptedMessage.cs similarity index 90% rename from src/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs rename to src/TgSharp.TL/TL/Messages/TLSentEncryptedMessage.cs index 1d3bb21..9b529cd 100644 --- a/src/TeleSharp.TL/TL/Messages/TLSentEncryptedMessage.cs +++ b/src/TgSharp.TL/TL/Messages/TLSentEncryptedMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(1443858741)] public class TLSentEncryptedMessage : TLAbsSentEncryptedMessage @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Messages public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLStickerSet.cs b/src/TgSharp.TL/TL/Messages/TLStickerSet.cs similarity index 85% rename from src/TeleSharp.TL/TL/Messages/TLStickerSet.cs rename to src/TgSharp.TL/TL/Messages/TLStickerSet.cs index c481a04..04be2d1 100644 --- a/src/TeleSharp.TL/TL/Messages/TLStickerSet.cs +++ b/src/TgSharp.TL/TL/Messages/TLStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-1240849242)] public class TLStickerSet : TLObject @@ -18,22 +20,20 @@ namespace TeleSharp.TL.Messages } } - public TL.TLStickerSet Set { get; set; } + public TLStickerSet Set { get; set; } public TLVector Packs { get; set; } public TLVector Documents { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Set = (TL.TLStickerSet)ObjectUtils.DeserializeObject(br); + Set = (TLStickerSet)ObjectUtils.DeserializeObject(br); Packs = (TLVector)ObjectUtils.DeserializeVector(br); Documents = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Messages ObjectUtils.SerializeObject(Set, bw); ObjectUtils.SerializeObject(Packs, bw); ObjectUtils.SerializeObject(Documents, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs b/src/TgSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs similarity index 92% rename from src/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs rename to src/TgSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs index 1eb220e..95f440e 100644 --- a/src/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs +++ b/src/TgSharp.TL/TL/Messages/TLStickerSetInstallResultArchive.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(904138920)] public class TLStickerSetInstallResultArchive : TLAbsStickerSetInstallResult @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Messages public TLVector Sets { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Sets = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Sets, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs b/src/TgSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs rename to src/TgSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs index ec926c6..8dff22f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs +++ b/src/TgSharp.TL/TL/Messages/TLStickerSetInstallResultSuccess.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(946083368)] public class TLStickerSetInstallResultSuccess : TLAbsStickerSetInstallResult @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Messages } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLStickers.cs b/src/TgSharp.TL/TL/Messages/TLStickers.cs similarity index 75% rename from src/TeleSharp.TL/TL/Messages/TLStickers.cs rename to src/TgSharp.TL/TL/Messages/TLStickers.cs index 479e8fa..c3f47f4 100644 --- a/src/TeleSharp.TL/TL/Messages/TLStickers.cs +++ b/src/TgSharp.TL/TL/Messages/TLStickers.cs @@ -4,42 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { - [TLObject(-1970352846)] + [TLObject(-463889475)] public class TLStickers : TLAbsStickers { public override int Constructor { get { - return -1970352846; + return -463889475; } } - public string Hash { get; set; } + public int Hash { get; set; } public TLVector Stickers { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Hash = StringUtil.Deserialize(br); + Hash = br.ReadInt32(); Stickers = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - StringUtil.Serialize(Hash, bw); + bw.Write(Hash); ObjectUtils.SerializeObject(Stickers, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs b/src/TgSharp.TL/TL/Messages/TLStickersNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs rename to src/TgSharp.TL/TL/Messages/TLStickersNotModified.cs index be90b51..7e3a2fd 100644 --- a/src/TeleSharp.TL/TL/Messages/TLStickersNotModified.cs +++ b/src/TgSharp.TL/TL/Messages/TLStickersNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL.Messages { [TLObject(-244016606)] public class TLStickersNotModified : TLAbsStickers @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Messages } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLAbsPaymentResult.cs b/src/TgSharp.TL/TL/Payments/TLAbsPaymentResult.cs similarity index 79% rename from src/TeleSharp.TL/TL/Payments/TLAbsPaymentResult.cs rename to src/TgSharp.TL/TL/Payments/TLAbsPaymentResult.cs index 5099caa..7d906ac 100644 --- a/src/TeleSharp.TL/TL/Payments/TLAbsPaymentResult.cs +++ b/src/TgSharp.TL/TL/Payments/TLAbsPaymentResult.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { public abstract class TLAbsPaymentResult : TLObject { diff --git a/src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs b/src/TgSharp.TL/TL/Payments/TLPaymentForm.cs similarity index 84% rename from src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs rename to src/TgSharp.TL/TL/Payments/TLPaymentForm.cs index 8f5c435..6a8837e 100644 --- a/src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs +++ b/src/TgSharp.TL/TL/Payments/TLPaymentForm.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(1062645411)] public class TLPaymentForm : TLObject @@ -28,20 +30,13 @@ namespace TeleSharp.TL.Payments public string NativeProvider { get; set; } public TLDataJSON NativeParams { get; set; } public TLPaymentRequestedInfo SavedInfo { get; set; } + // manual edit: PaymentSavedCredentials -> TLPaymentSavedCredentialsCard public TLPaymentSavedCredentialsCard SavedCredentials { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = CanSaveCredentials ? (Flags | 4) : (Flags & ~4); - Flags = PasswordMissing ? (Flags | 8) : (Flags & ~8); - Flags = NativeProvider != null ? (Flags | 16) : (Flags & ~16); - Flags = NativeParams != null ? (Flags | 16) : (Flags & ~16); - Flags = SavedInfo != null ? (Flags | 1) : (Flags & ~1); - Flags = SavedCredentials != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -69,21 +64,18 @@ namespace TeleSharp.TL.Payments SavedInfo = null; if ((Flags & 2) != 0) + // manual edit: PaymentSavedCredentials -> TLPaymentSavedCredentialsCard SavedCredentials = (TLPaymentSavedCredentialsCard)ObjectUtils.DeserializeObject(br); else SavedCredentials = null; Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(BotId); ObjectUtils.SerializeObject(Invoice, bw); bw.Write(ProviderId); @@ -97,7 +89,6 @@ namespace TeleSharp.TL.Payments if ((Flags & 2) != 0) ObjectUtils.SerializeObject(SavedCredentials, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLPaymentReceipt.cs b/src/TgSharp.TL/TL/Payments/TLPaymentReceipt.cs similarity index 91% rename from src/TeleSharp.TL/TL/Payments/TLPaymentReceipt.cs rename to src/TgSharp.TL/TL/Payments/TLPaymentReceipt.cs index 3faf5a4..d88bd5f 100644 --- a/src/TeleSharp.TL/TL/Payments/TLPaymentReceipt.cs +++ b/src/TgSharp.TL/TL/Payments/TLPaymentReceipt.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(1342771681)] public class TLPaymentReceipt : TLObject @@ -30,13 +32,9 @@ namespace TeleSharp.TL.Payments public string CredentialsTitle { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Info != null ? (Flags | 1) : (Flags & ~1); - Flags = Shipping != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -60,13 +58,11 @@ namespace TeleSharp.TL.Payments TotalAmount = br.ReadInt64(); CredentialsTitle = StringUtil.Deserialize(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(Date); bw.Write(BotId); @@ -80,7 +76,6 @@ namespace TeleSharp.TL.Payments bw.Write(TotalAmount); StringUtil.Serialize(CredentialsTitle, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLPaymentResult.cs b/src/TgSharp.TL/TL/Payments/TLPaymentResult.cs similarity index 91% rename from src/TeleSharp.TL/TL/Payments/TLPaymentResult.cs rename to src/TgSharp.TL/TL/Payments/TLPaymentResult.cs index bab02ea..985150a 100644 --- a/src/TeleSharp.TL/TL/Payments/TLPaymentResult.cs +++ b/src/TgSharp.TL/TL/Payments/TLPaymentResult.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(1314881805)] public class TLPaymentResult : TLAbsPaymentResult @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Payments public TLAbsUpdates Updates { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Updates = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Updates, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs b/src/TgSharp.TL/TL/Payments/TLPaymentVerificationNeeded.cs similarity index 67% rename from src/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs rename to src/TgSharp.TL/TL/Payments/TLPaymentVerificationNeeded.cs index 14e0e26..9049bd9 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs +++ b/src/TgSharp.TL/TL/Payments/TLPaymentVerificationNeeded.cs @@ -4,42 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { - [TLObject(-1252045032)] - public class TLInputMediaPhotoExternal : TLAbsInputMedia + [TLObject(-666824391)] + public class TLPaymentVerificationNeeded : TLAbsPaymentResult { public override int Constructor { get { - return -1252045032; + return -666824391; } } public string Url { get; set; } - public string Caption { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Url = StringUtil.Deserialize(br); - Caption = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Url, bw); - StringUtil.Serialize(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLRequestClearSavedInfo.cs b/src/TgSharp.TL/TL/Payments/TLRequestClearSavedInfo.cs similarity index 82% rename from src/TeleSharp.TL/TL/Payments/TLRequestClearSavedInfo.cs rename to src/TgSharp.TL/TL/Payments/TLRequestClearSavedInfo.cs index 009a75b..6753051 100644 --- a/src/TeleSharp.TL/TL/Payments/TLRequestClearSavedInfo.cs +++ b/src/TgSharp.TL/TL/Payments/TLRequestClearSavedInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(-667062079)] public class TLRequestClearSavedInfo : TLMethod @@ -23,13 +25,9 @@ namespace TeleSharp.TL.Payments public bool Info { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Credentials ? (Flags | 1) : (Flags & ~1); - Flags = Info ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,22 +35,17 @@ namespace TeleSharp.TL.Payments Flags = br.ReadInt32(); Credentials = (Flags & 1) != 0; Info = (Flags & 2) != 0; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLRequestGetPaymentForm.cs b/src/TgSharp.TL/TL/Payments/TLRequestGetPaymentForm.cs similarity index 92% rename from src/TeleSharp.TL/TL/Payments/TLRequestGetPaymentForm.cs rename to src/TgSharp.TL/TL/Payments/TLRequestGetPaymentForm.cs index fc37c50..082d4e9 100644 --- a/src/TeleSharp.TL/TL/Payments/TLRequestGetPaymentForm.cs +++ b/src/TgSharp.TL/TL/Payments/TLRequestGetPaymentForm.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(-1712285883)] public class TLRequestGetPaymentForm : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Payments public int MsgId { get; set; } public Payments.TLPaymentForm Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MsgId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(MsgId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Payments.TLPaymentForm)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLRequestGetPaymentReceipt.cs b/src/TgSharp.TL/TL/Payments/TLRequestGetPaymentReceipt.cs similarity index 92% rename from src/TeleSharp.TL/TL/Payments/TLRequestGetPaymentReceipt.cs rename to src/TgSharp.TL/TL/Payments/TLRequestGetPaymentReceipt.cs index 9b05c9b..d7ab0df 100644 --- a/src/TeleSharp.TL/TL/Payments/TLRequestGetPaymentReceipt.cs +++ b/src/TgSharp.TL/TL/Payments/TLRequestGetPaymentReceipt.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(-1601001088)] public class TLRequestGetPaymentReceipt : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Payments public int MsgId { get; set; } public Payments.TLPaymentReceipt Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MsgId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(MsgId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Payments.TLPaymentReceipt)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLRequestGetSavedInfo.cs b/src/TgSharp.TL/TL/Payments/TLRequestGetSavedInfo.cs similarity index 86% rename from src/TeleSharp.TL/TL/Payments/TLRequestGetSavedInfo.cs rename to src/TgSharp.TL/TL/Payments/TLRequestGetSavedInfo.cs index 53d7ee7..befca7f 100644 --- a/src/TeleSharp.TL/TL/Payments/TLRequestGetSavedInfo.cs +++ b/src/TgSharp.TL/TL/Payments/TLRequestGetSavedInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(578650699)] public class TLRequestGetSavedInfo : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Payments public Payments.TLSavedInfo Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Payments.TLSavedInfo)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLRequestSendPaymentForm.cs b/src/TgSharp.TL/TL/Payments/TLRequestSendPaymentForm.cs similarity index 88% rename from src/TeleSharp.TL/TL/Payments/TLRequestSendPaymentForm.cs rename to src/TgSharp.TL/TL/Payments/TLRequestSendPaymentForm.cs index ad5f901..5fb1759 100644 --- a/src/TeleSharp.TL/TL/Payments/TLRequestSendPaymentForm.cs +++ b/src/TgSharp.TL/TL/Payments/TLRequestSendPaymentForm.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(730364339)] public class TLRequestSendPaymentForm : TLMethod @@ -25,13 +27,9 @@ namespace TeleSharp.TL.Payments public TLAbsInputPaymentCredentials Credentials { get; set; } public Payments.TLAbsPaymentResult Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = RequestedInfoId != null ? (Flags | 1) : (Flags & ~1); - Flags = ShippingOptionId != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -49,13 +47,11 @@ namespace TeleSharp.TL.Payments ShippingOptionId = null; Credentials = (TLAbsInputPaymentCredentials)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(MsgId); if ((Flags & 1) != 0) @@ -63,12 +59,11 @@ namespace TeleSharp.TL.Payments if ((Flags & 2) != 0) StringUtil.Serialize(ShippingOptionId, bw); ObjectUtils.SerializeObject(Credentials, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Payments.TLAbsPaymentResult)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLRequestValidateRequestedInfo.cs b/src/TgSharp.TL/TL/Payments/TLRequestValidateRequestedInfo.cs similarity index 89% rename from src/TeleSharp.TL/TL/Payments/TLRequestValidateRequestedInfo.cs rename to src/TgSharp.TL/TL/Payments/TLRequestValidateRequestedInfo.cs index 286b894..3278866 100644 --- a/src/TeleSharp.TL/TL/Payments/TLRequestValidateRequestedInfo.cs +++ b/src/TgSharp.TL/TL/Payments/TLRequestValidateRequestedInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(1997180532)] public class TLRequestValidateRequestedInfo : TLMethod @@ -24,12 +26,9 @@ namespace TeleSharp.TL.Payments public TLPaymentRequestedInfo Info { get; set; } public Payments.TLValidatedRequestedInfo Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Save ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -38,23 +37,19 @@ namespace TeleSharp.TL.Payments Save = (Flags & 1) != 0; MsgId = br.ReadInt32(); Info = (TLPaymentRequestedInfo)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(MsgId); ObjectUtils.SerializeObject(Info, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Payments.TLValidatedRequestedInfo)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLSavedInfo.cs b/src/TgSharp.TL/TL/Payments/TLSavedInfo.cs similarity index 82% rename from src/TeleSharp.TL/TL/Payments/TLSavedInfo.cs rename to src/TgSharp.TL/TL/Payments/TLSavedInfo.cs index e093e24..9fd8f02 100644 --- a/src/TeleSharp.TL/TL/Payments/TLSavedInfo.cs +++ b/src/TgSharp.TL/TL/Payments/TLSavedInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(-74456004)] public class TLSavedInfo : TLObject @@ -22,13 +24,9 @@ namespace TeleSharp.TL.Payments public bool HasSavedCredentials { get; set; } public TLPaymentRequestedInfo SavedInfo { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = HasSavedCredentials ? (Flags | 2) : (Flags & ~2); - Flags = SavedInfo != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -40,18 +38,14 @@ namespace TeleSharp.TL.Payments else SavedInfo = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - if ((Flags & 1) != 0) ObjectUtils.SerializeObject(SavedInfo, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLValidatedRequestedInfo.cs b/src/TgSharp.TL/TL/Payments/TLValidatedRequestedInfo.cs similarity index 84% rename from src/TeleSharp.TL/TL/Payments/TLValidatedRequestedInfo.cs rename to src/TgSharp.TL/TL/Payments/TLValidatedRequestedInfo.cs index d6936d6..81a451b 100644 --- a/src/TeleSharp.TL/TL/Payments/TLValidatedRequestedInfo.cs +++ b/src/TgSharp.TL/TL/Payments/TLValidatedRequestedInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL.Payments { [TLObject(-784000893)] public class TLValidatedRequestedInfo : TLObject @@ -22,13 +24,9 @@ namespace TeleSharp.TL.Payments public string Id { get; set; } public TLVector ShippingOptions { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Id != null ? (Flags | 1) : (Flags & ~1); - Flags = ShippingOptions != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -44,19 +42,16 @@ namespace TeleSharp.TL.Payments else ShippingOptions = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 1) != 0) StringUtil.Serialize(Id, bw); if ((Flags & 2) != 0) ObjectUtils.SerializeObject(ShippingOptions, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLPhoneCall.cs b/src/TgSharp.TL/TL/Phone/TLPhoneCall.cs similarity index 93% rename from src/TeleSharp.TL/TL/Phone/TLPhoneCall.cs rename to src/TgSharp.TL/TL/Phone/TLPhoneCall.cs index 498c630..0ec974f 100644 --- a/src/TeleSharp.TL/TL/Phone/TLPhoneCall.cs +++ b/src/TgSharp.TL/TL/Phone/TLPhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { [TLObject(-326966976)] public class TLPhoneCall : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Phone public TLAbsPhoneCall PhoneCall { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneCall = (TLAbsPhoneCall)ObjectUtils.DeserializeObject(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Phone bw.Write(Constructor); ObjectUtils.SerializeObject(PhoneCall, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestAcceptCall.cs b/src/TgSharp.TL/TL/Phone/TLRequestAcceptCall.cs similarity index 94% rename from src/TeleSharp.TL/TL/Phone/TLRequestAcceptCall.cs rename to src/TgSharp.TL/TL/Phone/TLRequestAcceptCall.cs index 4cbb177..c16ef64 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestAcceptCall.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestAcceptCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { [TLObject(1003664544)] public class TLRequestAcceptCall : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Phone public TLPhoneCallProtocol Protocol { get; set; } public Phone.TLPhoneCall Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Phone Peer = (TLInputPhoneCall)ObjectUtils.DeserializeObject(br); GB = BytesUtil.Deserialize(br); Protocol = (TLPhoneCallProtocol)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Phone ObjectUtils.SerializeObject(Peer, bw); BytesUtil.Serialize(GB, bw); ObjectUtils.SerializeObject(Protocol, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Phone.TLPhoneCall)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestConfirmCall.cs b/src/TgSharp.TL/TL/Phone/TLRequestConfirmCall.cs similarity index 95% rename from src/TeleSharp.TL/TL/Phone/TLRequestConfirmCall.cs rename to src/TgSharp.TL/TL/Phone/TLRequestConfirmCall.cs index 6db014d..030c3b6 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestConfirmCall.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestConfirmCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { [TLObject(788404002)] public class TLRequestConfirmCall : TLMethod @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Phone public TLPhoneCallProtocol Protocol { get; set; } public Phone.TLPhoneCall Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +37,6 @@ namespace TeleSharp.TL.Phone GA = BytesUtil.Deserialize(br); KeyFingerprint = br.ReadInt64(); Protocol = (TLPhoneCallProtocol)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +46,11 @@ namespace TeleSharp.TL.Phone BytesUtil.Serialize(GA, bw); bw.Write(KeyFingerprint); ObjectUtils.SerializeObject(Protocol, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Phone.TLPhoneCall)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestDiscardCall.cs b/src/TgSharp.TL/TL/Phone/TLRequestDiscardCall.cs similarity index 81% rename from src/TeleSharp.TL/TL/Phone/TLRequestDiscardCall.cs rename to src/TgSharp.TL/TL/Phone/TLRequestDiscardCall.cs index 6004e95..d32947a 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestDiscardCall.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestDiscardCall.cs @@ -4,54 +4,58 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { - [TLObject(2027164582)] + [TLObject(-1295269440)] public class TLRequestDiscardCall : TLMethod { public override int Constructor { get { - return 2027164582; + return -1295269440; } } + public int Flags { get; set; } + public bool Video { get; set; } public TLInputPhoneCall Peer { get; set; } public int Duration { get; set; } public TLAbsPhoneCallDiscardReason Reason { get; set; } public long ConnectionId { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Video = (Flags & 1) != 0; Peer = (TLInputPhoneCall)ObjectUtils.DeserializeObject(br); Duration = br.ReadInt32(); Reason = (TLAbsPhoneCallDiscardReason)ObjectUtils.DeserializeObject(br); ConnectionId = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(Peer, bw); bw.Write(Duration); ObjectUtils.SerializeObject(Reason, bw); bw.Write(ConnectionId); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestGetCallConfig.cs b/src/TgSharp.TL/TL/Phone/TLRequestGetCallConfig.cs similarity index 86% rename from src/TeleSharp.TL/TL/Phone/TLRequestGetCallConfig.cs rename to src/TgSharp.TL/TL/Phone/TLRequestGetCallConfig.cs index 9307f39..2d08c70 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestGetCallConfig.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestGetCallConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { [TLObject(1430593449)] public class TLRequestGetCallConfig : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Phone public TLDataJSON Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestReceivedCall.cs b/src/TgSharp.TL/TL/Phone/TLRequestReceivedCall.cs similarity index 93% rename from src/TeleSharp.TL/TL/Phone/TLRequestReceivedCall.cs rename to src/TgSharp.TL/TL/Phone/TLRequestReceivedCall.cs index 2b3a791..ffdbec3 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestReceivedCall.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestReceivedCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { [TLObject(399855457)] public class TLRequestReceivedCall : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Phone public TLInputPhoneCall Peer { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLInputPhoneCall)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestRequestCall.cs b/src/TgSharp.TL/TL/Phone/TLRequestRequestCall.cs similarity index 81% rename from src/TeleSharp.TL/TL/Phone/TLRequestRequestCall.cs rename to src/TgSharp.TL/TL/Phone/TLRequestRequestCall.cs index db230f2..192abd5 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestRequestCall.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestRequestCall.cs @@ -4,54 +4,58 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { - [TLObject(1536537556)] + [TLObject(1124046573)] public class TLRequestRequestCall : TLMethod { public override int Constructor { get { - return 1536537556; + return 1124046573; } } + public int Flags { get; set; } + public bool Video { get; set; } public TLAbsInputUser UserId { get; set; } public int RandomId { get; set; } public byte[] GAHash { get; set; } public TLPhoneCallProtocol Protocol { get; set; } public Phone.TLPhoneCall Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Video = (Flags & 1) != 0; UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); RandomId = br.ReadInt32(); GAHash = BytesUtil.Deserialize(br); Protocol = (TLPhoneCallProtocol)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(UserId, bw); bw.Write(RandomId); BytesUtil.Serialize(GAHash, bw); ObjectUtils.SerializeObject(Protocol, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Phone.TLPhoneCall)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestSaveCallDebug.cs b/src/TgSharp.TL/TL/Phone/TLRequestSaveCallDebug.cs similarity index 94% rename from src/TeleSharp.TL/TL/Phone/TLRequestSaveCallDebug.cs rename to src/TgSharp.TL/TL/Phone/TLRequestSaveCallDebug.cs index 7f7d944..3477555 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestSaveCallDebug.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestSaveCallDebug.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { [TLObject(662363518)] public class TLRequestSaveCallDebug : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Phone public TLDataJSON Debug { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLInputPhoneCall)ObjectUtils.DeserializeObject(br); Debug = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Phone bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Debug, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Phone/TLRequestSetCallRating.cs b/src/TgSharp.TL/TL/Phone/TLRequestSetCallRating.cs similarity index 78% rename from src/TeleSharp.TL/TL/Phone/TLRequestSetCallRating.cs rename to src/TgSharp.TL/TL/Phone/TLRequestSetCallRating.cs index 14a1c9f..56b0876 100644 --- a/src/TeleSharp.TL/TL/Phone/TLRequestSetCallRating.cs +++ b/src/TgSharp.TL/TL/Phone/TLRequestSetCallRating.cs @@ -4,51 +4,55 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Phone + +using TgSharp.TL; + +namespace TgSharp.TL.Phone { - [TLObject(475228724)] + [TLObject(1508562471)] public class TLRequestSetCallRating : TLMethod { public override int Constructor { get { - return 475228724; + return 1508562471; } } + public int Flags { get; set; } + public bool UserInitiative { get; set; } public TLInputPhoneCall Peer { get; set; } public int Rating { get; set; } public string Comment { get; set; } public TLAbsUpdates Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + UserInitiative = (Flags & 1) != 0; Peer = (TLInputPhoneCall)ObjectUtils.DeserializeObject(br); Rating = br.ReadInt32(); Comment = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(Peer, bw); bw.Write(Rating); StringUtil.Serialize(Comment, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs b/src/TgSharp.TL/TL/Photos/TLAbsPhotos.cs similarity index 79% rename from src/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs rename to src/TgSharp.TL/TL/Photos/TLAbsPhotos.cs index ca753a6..a7d43dd 100644 --- a/src/TeleSharp.TL/TL/Photos/TLAbsPhotos.cs +++ b/src/TgSharp.TL/TL/Photos/TLAbsPhotos.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { public abstract class TLAbsPhotos : TLObject { diff --git a/src/TeleSharp.TL/TL/Photos/TLPhoto.cs b/src/TgSharp.TL/TL/Photos/TLPhoto.cs similarity index 93% rename from src/TeleSharp.TL/TL/Photos/TLPhoto.cs rename to src/TgSharp.TL/TL/Photos/TLPhoto.cs index ae62fb9..8fed041 100644 --- a/src/TeleSharp.TL/TL/Photos/TLPhoto.cs +++ b/src/TgSharp.TL/TL/Photos/TLPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(539045032)] public class TLPhoto : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Photos public TLAbsPhoto Photo { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Photos bw.Write(Constructor); ObjectUtils.SerializeObject(Photo, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLPhotos.cs b/src/TgSharp.TL/TL/Photos/TLPhotos.cs similarity index 93% rename from src/TeleSharp.TL/TL/Photos/TLPhotos.cs rename to src/TgSharp.TL/TL/Photos/TLPhotos.cs index 0698099..57ba345 100644 --- a/src/TeleSharp.TL/TL/Photos/TLPhotos.cs +++ b/src/TgSharp.TL/TL/Photos/TLPhotos.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(-1916114267)] public class TLPhotos : TLAbsPhotos @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Photos public TLVector Photos { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Photos = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Photos bw.Write(Constructor); ObjectUtils.SerializeObject(Photos, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs b/src/TgSharp.TL/TL/Photos/TLPhotosSlice.cs similarity index 93% rename from src/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs rename to src/TgSharp.TL/TL/Photos/TLPhotosSlice.cs index fd7ee46..23f98e1 100644 --- a/src/TeleSharp.TL/TL/Photos/TLPhotosSlice.cs +++ b/src/TgSharp.TL/TL/Photos/TLPhotosSlice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(352657236)] public class TLPhotosSlice : TLAbsPhotos @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Photos public TLVector Photos { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Photos Count = br.ReadInt32(); Photos = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Photos bw.Write(Count); ObjectUtils.SerializeObject(Photos, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs b/src/TgSharp.TL/TL/Photos/TLRequestDeletePhotos.cs similarity index 93% rename from src/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs rename to src/TgSharp.TL/TL/Photos/TLRequestDeletePhotos.cs index ae5faf2..151cab3 100644 --- a/src/TeleSharp.TL/TL/Photos/TLRequestDeletePhotos.cs +++ b/src/TgSharp.TL/TL/Photos/TLRequestDeletePhotos.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(-2016444625)] public class TLRequestDeletePhotos : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Photos public TLVector Id { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs b/src/TgSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs similarity index 94% rename from src/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs rename to src/TgSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs index 9ba8120..4112ef7 100644 --- a/src/TeleSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs +++ b/src/TgSharp.TL/TL/Photos/TLRequestGetUserPhotos.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(-1848823128)] public class TLRequestGetUserPhotos : TLMethod @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Photos public int Limit { get; set; } public Photos.TLAbsPhotos Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +37,6 @@ namespace TeleSharp.TL.Photos Offset = br.ReadInt32(); MaxId = br.ReadInt64(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +46,11 @@ namespace TeleSharp.TL.Photos bw.Write(Offset); bw.Write(MaxId); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Photos.TLAbsPhotos)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs b/src/TgSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs similarity index 93% rename from src/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs rename to src/TgSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs index 12c8eb3..6e02e34 100644 --- a/src/TeleSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs +++ b/src/TgSharp.TL/TL/Photos/TLRequestUpdateProfilePhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(-256159406)] public class TLRequestUpdateProfilePhoto : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Photos public TLAbsInputPhoto Id { get; set; } public TLAbsUserProfilePhoto Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs b/src/TgSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs similarity index 93% rename from src/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs rename to src/TgSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs index e74090f..189b3fa 100644 --- a/src/TeleSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs +++ b/src/TgSharp.TL/TL/Photos/TLRequestUploadProfilePhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Photos + +using TgSharp.TL; + +namespace TgSharp.TL.Photos { [TLObject(1328726168)] public class TLRequestUploadProfilePhoto : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Photos public TLAbsInputFile File { get; set; } public Photos.TLPhoto Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { File = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(File, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Photos.TLPhoto)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Stickers/TLRequestAddStickerToSet.cs b/src/TgSharp.TL/TL/Stickers/TLRequestAddStickerToSet.cs similarity index 94% rename from src/TeleSharp.TL/TL/Stickers/TLRequestAddStickerToSet.cs rename to src/TgSharp.TL/TL/Stickers/TLRequestAddStickerToSet.cs index fb3f701..c2f7b82 100644 --- a/src/TeleSharp.TL/TL/Stickers/TLRequestAddStickerToSet.cs +++ b/src/TgSharp.TL/TL/Stickers/TLRequestAddStickerToSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Stickers + +using TgSharp.TL; + +namespace TgSharp.TL.Stickers { [TLObject(-2041315650)] public class TLRequestAddStickerToSet : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL.Stickers public TLInputStickerSetItem Sticker { get; set; } public Messages.TLStickerSet Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); Sticker = (TLInputStickerSetItem)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Stickers bw.Write(Constructor); ObjectUtils.SerializeObject(Stickerset, bw); ObjectUtils.SerializeObject(Sticker, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Stickers/TLRequestChangeStickerPosition.cs b/src/TgSharp.TL/TL/Stickers/TLRequestChangeStickerPosition.cs similarity index 77% rename from src/TeleSharp.TL/TL/Stickers/TLRequestChangeStickerPosition.cs rename to src/TgSharp.TL/TL/Stickers/TLRequestChangeStickerPosition.cs index 637effd..3640355 100644 --- a/src/TeleSharp.TL/TL/Stickers/TLRequestChangeStickerPosition.cs +++ b/src/TgSharp.TL/TL/Stickers/TLRequestChangeStickerPosition.cs @@ -4,35 +4,35 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Stickers + +using TgSharp.TL; + +namespace TgSharp.TL.Stickers { - [TLObject(1322714570)] + [TLObject(-4795190)] public class TLRequestChangeStickerPosition : TLMethod { public override int Constructor { get { - return 1322714570; + return -4795190; } } public TLAbsInputDocument Sticker { get; set; } public int Position { get; set; } - public bool Response { get; set; } - + public Messages.TLStickerSet Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Sticker = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); Position = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Stickers bw.Write(Constructor); ObjectUtils.SerializeObject(Sticker, bw); bw.Write(Position); - } + public override void DeserializeResponse(BinaryReader br) { - Response = BoolUtil.Deserialize(br); - + Response = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Stickers/TLRequestCreateStickerSet.cs b/src/TgSharp.TL/TL/Stickers/TLRequestCreateStickerSet.cs similarity index 91% rename from src/TeleSharp.TL/TL/Stickers/TLRequestCreateStickerSet.cs rename to src/TgSharp.TL/TL/Stickers/TLRequestCreateStickerSet.cs index 3fae8cd..3132ef5 100644 --- a/src/TeleSharp.TL/TL/Stickers/TLRequestCreateStickerSet.cs +++ b/src/TgSharp.TL/TL/Stickers/TLRequestCreateStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Stickers + +using TgSharp.TL; + +namespace TgSharp.TL.Stickers { [TLObject(-1680314774)] public class TLRequestCreateStickerSet : TLMethod @@ -26,12 +28,9 @@ namespace TeleSharp.TL.Stickers public TLVector Stickers { get; set; } public Messages.TLStickerSet Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Masks ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,25 +41,21 @@ namespace TeleSharp.TL.Stickers Title = StringUtil.Deserialize(br); ShortName = StringUtil.Deserialize(br); Stickers = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(UserId, bw); StringUtil.Serialize(Title, bw); StringUtil.Serialize(ShortName, bw); ObjectUtils.SerializeObject(Stickers, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Stickers/TLRequestRemoveStickerFromSet.cs b/src/TgSharp.TL/TL/Stickers/TLRequestRemoveStickerFromSet.cs similarity index 75% rename from src/TeleSharp.TL/TL/Stickers/TLRequestRemoveStickerFromSet.cs rename to src/TgSharp.TL/TL/Stickers/TLRequestRemoveStickerFromSet.cs index b038891..a2736c2 100644 --- a/src/TeleSharp.TL/TL/Stickers/TLRequestRemoveStickerFromSet.cs +++ b/src/TgSharp.TL/TL/Stickers/TLRequestRemoveStickerFromSet.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Stickers + +using TgSharp.TL; + +namespace TgSharp.TL.Stickers { - [TLObject(69556532)] + [TLObject(-143257775)] public class TLRequestRemoveStickerFromSet : TLMethod { public override int Constructor { get { - return 69556532; + return -143257775; } } public TLAbsInputDocument Sticker { get; set; } - public bool Response { get; set; } - + public Messages.TLStickerSet Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Sticker = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Sticker, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = BoolUtil.Deserialize(br); - + Response = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLAbsFileType.cs b/src/TgSharp.TL/TL/Storage/TLAbsFileType.cs similarity index 79% rename from src/TeleSharp.TL/TL/Storage/TLAbsFileType.cs rename to src/TgSharp.TL/TL/Storage/TLAbsFileType.cs index 958a25e..11a4924 100644 --- a/src/TeleSharp.TL/TL/Storage/TLAbsFileType.cs +++ b/src/TgSharp.TL/TL/Storage/TLAbsFileType.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { public abstract class TLAbsFileType : TLObject { diff --git a/src/TeleSharp.TL/TL/Storage/TLFileGif.cs b/src/TgSharp.TL/TL/Storage/TLFileGif.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileGif.cs rename to src/TgSharp.TL/TL/Storage/TLFileGif.cs index 26960b3..6aa9d8b 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileGif.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileGif.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(-891180321)] public class TLFileGif : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFileJpeg.cs b/src/TgSharp.TL/TL/Storage/TLFileJpeg.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileJpeg.cs rename to src/TgSharp.TL/TL/Storage/TLFileJpeg.cs index b6df7d4..5a8c597 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileJpeg.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileJpeg.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(8322574)] public class TLFileJpeg : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFileMov.cs b/src/TgSharp.TL/TL/Storage/TLFileMov.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileMov.cs rename to src/TgSharp.TL/TL/Storage/TLFileMov.cs index 210f622..4eaa762 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileMov.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileMov.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(1258941372)] public class TLFileMov : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFileMp3.cs b/src/TgSharp.TL/TL/Storage/TLFileMp3.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileMp3.cs rename to src/TgSharp.TL/TL/Storage/TLFileMp3.cs index 89cf402..8dbd83a 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileMp3.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileMp3.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(1384777335)] public class TLFileMp3 : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFileMp4.cs b/src/TgSharp.TL/TL/Storage/TLFileMp4.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileMp4.cs rename to src/TgSharp.TL/TL/Storage/TLFileMp4.cs index d4ee9f8..02acc4e 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileMp4.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileMp4.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(-1278304028)] public class TLFileMp4 : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFilePartial.cs b/src/TgSharp.TL/TL/Storage/TLFilePartial.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFilePartial.cs rename to src/TgSharp.TL/TL/Storage/TLFilePartial.cs index acfbe49..c9d372a 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFilePartial.cs +++ b/src/TgSharp.TL/TL/Storage/TLFilePartial.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(1086091090)] public class TLFilePartial : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFilePdf.cs b/src/TgSharp.TL/TL/Storage/TLFilePdf.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFilePdf.cs rename to src/TgSharp.TL/TL/Storage/TLFilePdf.cs index ce26269..504703e 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFilePdf.cs +++ b/src/TgSharp.TL/TL/Storage/TLFilePdf.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(-1373745011)] public class TLFilePdf : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFilePng.cs b/src/TgSharp.TL/TL/Storage/TLFilePng.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFilePng.cs rename to src/TgSharp.TL/TL/Storage/TLFilePng.cs index 3587007..b720798 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFilePng.cs +++ b/src/TgSharp.TL/TL/Storage/TLFilePng.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(172975040)] public class TLFilePng : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFileUnknown.cs b/src/TgSharp.TL/TL/Storage/TLFileUnknown.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileUnknown.cs rename to src/TgSharp.TL/TL/Storage/TLFileUnknown.cs index 3656c9e..bb54e1d 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileUnknown.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileUnknown.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(-1432995067)] public class TLFileUnknown : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/Storage/TLFileWebp.cs b/src/TgSharp.TL/TL/Storage/TLFileWebp.cs similarity index 80% rename from src/TeleSharp.TL/TL/Storage/TLFileWebp.cs rename to src/TgSharp.TL/TL/Storage/TLFileWebp.cs index 500bc24..ff2d3d9 100644 --- a/src/TeleSharp.TL/TL/Storage/TLFileWebp.cs +++ b/src/TgSharp.TL/TL/Storage/TLFileWebp.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Storage + +using TgSharp.TL; + +namespace TgSharp.TL.Storage { [TLObject(276907596)] public class TLFileWebp : TLAbsFileType @@ -18,22 +20,22 @@ namespace TeleSharp.TL.Storage } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLAbsBaseTheme.cs b/src/TgSharp.TL/TL/TLAbsBaseTheme.cs new file mode 100644 index 0000000..f3e6769 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsBaseTheme.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsBaseTheme : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsBool.cs b/src/TgSharp.TL/TL/TLAbsBool.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsBool.cs rename to src/TgSharp.TL/TL/TLAbsBool.cs index afa7d6c..9969837 100644 --- a/src/TeleSharp.TL/TL/TLAbsBool.cs +++ b/src/TgSharp.TL/TL/TLAbsBool.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsBool : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs b/src/TgSharp.TL/TL/TLAbsBotInlineMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs rename to src/TgSharp.TL/TL/TLAbsBotInlineMessage.cs index 8b54131..d51567f 100644 --- a/src/TeleSharp.TL/TL/TLAbsBotInlineMessage.cs +++ b/src/TgSharp.TL/TL/TLAbsBotInlineMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsBotInlineMessage : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsBotInlineResult.cs b/src/TgSharp.TL/TL/TLAbsBotInlineResult.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsBotInlineResult.cs rename to src/TgSharp.TL/TL/TLAbsBotInlineResult.cs index 841a0fa..7567068 100644 --- a/src/TeleSharp.TL/TL/TLAbsBotInlineResult.cs +++ b/src/TgSharp.TL/TL/TLAbsBotInlineResult.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsBotInlineResult : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsChannelAdminLogEventAction.cs b/src/TgSharp.TL/TL/TLAbsChannelAdminLogEventAction.cs new file mode 100644 index 0000000..aa49621 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsChannelAdminLogEventAction.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsChannelAdminLogEventAction : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsChannelLocation.cs b/src/TgSharp.TL/TL/TLAbsChannelLocation.cs new file mode 100644 index 0000000..dc4cbe5 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsChannelLocation.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsChannelLocation : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs b/src/TgSharp.TL/TL/TLAbsChannelMessagesFilter.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs rename to src/TgSharp.TL/TL/TLAbsChannelMessagesFilter.cs index e754290..2e2b5d6 100644 --- a/src/TeleSharp.TL/TL/TLAbsChannelMessagesFilter.cs +++ b/src/TgSharp.TL/TL/TLAbsChannelMessagesFilter.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChannelMessagesFilter : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChannelParticipant.cs b/src/TgSharp.TL/TL/TLAbsChannelParticipant.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsChannelParticipant.cs rename to src/TgSharp.TL/TL/TLAbsChannelParticipant.cs index 552ef91..65cb135 100644 --- a/src/TeleSharp.TL/TL/TLAbsChannelParticipant.cs +++ b/src/TgSharp.TL/TL/TLAbsChannelParticipant.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChannelParticipant : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs b/src/TgSharp.TL/TL/TLAbsChannelParticipantsFilter.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs rename to src/TgSharp.TL/TL/TLAbsChannelParticipantsFilter.cs index afee66d..bc67467 100644 --- a/src/TeleSharp.TL/TL/TLAbsChannelParticipantsFilter.cs +++ b/src/TgSharp.TL/TL/TLAbsChannelParticipantsFilter.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChannelParticipantsFilter : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChat.cs b/src/TgSharp.TL/TL/TLAbsChat.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsChat.cs rename to src/TgSharp.TL/TL/TLAbsChat.cs index aa92fc0..b3c1fa5 100644 --- a/src/TeleSharp.TL/TL/TLAbsChat.cs +++ b/src/TgSharp.TL/TL/TLAbsChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChat : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChatFull.cs b/src/TgSharp.TL/TL/TLAbsChatFull.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsChatFull.cs rename to src/TgSharp.TL/TL/TLAbsChatFull.cs index ef596c7..9a09600 100644 --- a/src/TeleSharp.TL/TL/TLAbsChatFull.cs +++ b/src/TgSharp.TL/TL/TLAbsChatFull.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChatFull : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChatInvite.cs b/src/TgSharp.TL/TL/TLAbsChatInvite.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsChatInvite.cs rename to src/TgSharp.TL/TL/TLAbsChatInvite.cs index 64ff7dd..9c98cea 100644 --- a/src/TeleSharp.TL/TL/TLAbsChatInvite.cs +++ b/src/TgSharp.TL/TL/TLAbsChatInvite.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChatInvite : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChatParticipant.cs b/src/TgSharp.TL/TL/TLAbsChatParticipant.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsChatParticipant.cs rename to src/TgSharp.TL/TL/TLAbsChatParticipant.cs index 598365a..266b7c6 100644 --- a/src/TeleSharp.TL/TL/TLAbsChatParticipant.cs +++ b/src/TgSharp.TL/TL/TLAbsChatParticipant.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChatParticipant : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChatParticipants.cs b/src/TgSharp.TL/TL/TLAbsChatParticipants.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsChatParticipants.cs rename to src/TgSharp.TL/TL/TLAbsChatParticipants.cs index 246eea2..2b0375d 100644 --- a/src/TeleSharp.TL/TL/TLAbsChatParticipants.cs +++ b/src/TgSharp.TL/TL/TLAbsChatParticipants.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChatParticipants : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsChatPhoto.cs b/src/TgSharp.TL/TL/TLAbsChatPhoto.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsChatPhoto.cs rename to src/TgSharp.TL/TL/TLAbsChatPhoto.cs index b210308..9e25323 100644 --- a/src/TeleSharp.TL/TL/TLAbsChatPhoto.cs +++ b/src/TgSharp.TL/TL/TLAbsChatPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsChatPhoto : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPage.cs b/src/TgSharp.TL/TL/TLAbsDialog.cs similarity index 62% rename from src/TeleSharp.TL/TL/TLAbsPage.cs rename to src/TgSharp.TL/TL/TLAbsDialog.cs index 92ef907..187f0b1 100644 --- a/src/TeleSharp.TL/TL/TLAbsPage.cs +++ b/src/TgSharp.TL/TL/TLAbsDialog.cs @@ -4,10 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - public abstract class TLAbsPage : TLObject + public abstract class TLAbsDialog : TLObject { } } diff --git a/src/TgSharp.TL/TL/TLAbsDialogPeer.cs b/src/TgSharp.TL/TL/TLAbsDialogPeer.cs new file mode 100644 index 0000000..1c7b12c --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsDialogPeer.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsDialogPeer : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsDocument.cs b/src/TgSharp.TL/TL/TLAbsDocument.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsDocument.cs rename to src/TgSharp.TL/TL/TLAbsDocument.cs index d60b4a8..550f69e 100644 --- a/src/TeleSharp.TL/TL/TLAbsDocument.cs +++ b/src/TgSharp.TL/TL/TLAbsDocument.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsDocument : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs b/src/TgSharp.TL/TL/TLAbsDocumentAttribute.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs rename to src/TgSharp.TL/TL/TLAbsDocumentAttribute.cs index 8fd333d..a3c5c6d 100644 --- a/src/TeleSharp.TL/TL/TLAbsDocumentAttribute.cs +++ b/src/TgSharp.TL/TL/TLAbsDocumentAttribute.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsDocumentAttribute : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsDraftMessage.cs b/src/TgSharp.TL/TL/TLAbsDraftMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsDraftMessage.cs rename to src/TgSharp.TL/TL/TLAbsDraftMessage.cs index 1f73bba..e3d6096 100644 --- a/src/TeleSharp.TL/TL/TLAbsDraftMessage.cs +++ b/src/TgSharp.TL/TL/TLAbsDraftMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsDraftMessage : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsEmojiKeyword.cs b/src/TgSharp.TL/TL/TLAbsEmojiKeyword.cs new file mode 100644 index 0000000..ab86c03 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsEmojiKeyword.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsEmojiKeyword : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsEncryptedChat.cs b/src/TgSharp.TL/TL/TLAbsEncryptedChat.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsEncryptedChat.cs rename to src/TgSharp.TL/TL/TLAbsEncryptedChat.cs index e64f973..12f8f7e 100644 --- a/src/TeleSharp.TL/TL/TLAbsEncryptedChat.cs +++ b/src/TgSharp.TL/TL/TLAbsEncryptedChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsEncryptedChat : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsEncryptedFile.cs b/src/TgSharp.TL/TL/TLAbsEncryptedFile.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsEncryptedFile.cs rename to src/TgSharp.TL/TL/TLAbsEncryptedFile.cs index 5ada68d..4221c7e 100644 --- a/src/TeleSharp.TL/TL/TLAbsEncryptedFile.cs +++ b/src/TgSharp.TL/TL/TLAbsEncryptedFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsEncryptedFile : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs b/src/TgSharp.TL/TL/TLAbsEncryptedMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs rename to src/TgSharp.TL/TL/TLAbsEncryptedMessage.cs index bd37fe4..cf93c23 100644 --- a/src/TeleSharp.TL/TL/TLAbsEncryptedMessage.cs +++ b/src/TgSharp.TL/TL/TLAbsEncryptedMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsEncryptedMessage : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs b/src/TgSharp.TL/TL/TLAbsExportedChatInvite.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs rename to src/TgSharp.TL/TL/TLAbsExportedChatInvite.cs index 572ee11..709f430 100644 --- a/src/TeleSharp.TL/TL/TLAbsExportedChatInvite.cs +++ b/src/TgSharp.TL/TL/TLAbsExportedChatInvite.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsExportedChatInvite : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsFoundGif.cs b/src/TgSharp.TL/TL/TLAbsFoundGif.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsFoundGif.cs rename to src/TgSharp.TL/TL/TLAbsFoundGif.cs index 7fc1df8..1a310d6 100644 --- a/src/TeleSharp.TL/TL/TLAbsFoundGif.cs +++ b/src/TgSharp.TL/TL/TLAbsFoundGif.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsFoundGif : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsGeoPoint.cs b/src/TgSharp.TL/TL/TLAbsGeoPoint.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsGeoPoint.cs rename to src/TgSharp.TL/TL/TLAbsGeoPoint.cs index 935339f..0dd63dd 100644 --- a/src/TeleSharp.TL/TL/TLAbsGeoPoint.cs +++ b/src/TgSharp.TL/TL/TLAbsGeoPoint.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsGeoPoint : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs b/src/TgSharp.TL/TL/TLAbsInputBotInlineMessage.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs rename to src/TgSharp.TL/TL/TLAbsInputBotInlineMessage.cs index 015e1a0..bfbf551 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputBotInlineMessage.cs +++ b/src/TgSharp.TL/TL/TLAbsInputBotInlineMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputBotInlineMessage : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs b/src/TgSharp.TL/TL/TLAbsInputBotInlineResult.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs rename to src/TgSharp.TL/TL/TLAbsInputBotInlineResult.cs index 9e4fb99..99010a4 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputBotInlineResult.cs +++ b/src/TgSharp.TL/TL/TLAbsInputBotInlineResult.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputBotInlineResult : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputChannel.cs b/src/TgSharp.TL/TL/TLAbsInputChannel.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputChannel.cs rename to src/TgSharp.TL/TL/TLAbsInputChannel.cs index e84f4f7..812bea7 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputChannel.cs +++ b/src/TgSharp.TL/TL/TLAbsInputChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputChannel : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs b/src/TgSharp.TL/TL/TLAbsInputChatPhoto.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs rename to src/TgSharp.TL/TL/TLAbsInputChatPhoto.cs index bf8800a..1249d8d 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputChatPhoto.cs +++ b/src/TgSharp.TL/TL/TLAbsInputChatPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputChatPhoto : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsInputCheckPasswordSRP.cs b/src/TgSharp.TL/TL/TLAbsInputCheckPasswordSRP.cs new file mode 100644 index 0000000..a3a6653 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputCheckPasswordSRP.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputCheckPasswordSRP : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsInputDialogPeer.cs b/src/TgSharp.TL/TL/TLAbsInputDialogPeer.cs new file mode 100644 index 0000000..d63ec3a --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputDialogPeer.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputDialogPeer : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsInputDocument.cs b/src/TgSharp.TL/TL/TLAbsInputDocument.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputDocument.cs rename to src/TgSharp.TL/TL/TLAbsInputDocument.cs index e49097e..c5e1c18 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputDocument.cs +++ b/src/TgSharp.TL/TL/TLAbsInputDocument.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputDocument : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs b/src/TgSharp.TL/TL/TLAbsInputEncryptedFile.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs rename to src/TgSharp.TL/TL/TLAbsInputEncryptedFile.cs index 2567011..738093b 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputEncryptedFile.cs +++ b/src/TgSharp.TL/TL/TLAbsInputEncryptedFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputEncryptedFile : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputFile.cs b/src/TgSharp.TL/TL/TLAbsInputFile.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputFile.cs rename to src/TgSharp.TL/TL/TLAbsInputFile.cs index 0f8adc3..c03eeab 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputFile.cs +++ b/src/TgSharp.TL/TL/TLAbsInputFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputFile : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputFileLocation.cs b/src/TgSharp.TL/TL/TLAbsInputFileLocation.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputFileLocation.cs rename to src/TgSharp.TL/TL/TLAbsInputFileLocation.cs index b67f3e8..3005913 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputFileLocation.cs +++ b/src/TgSharp.TL/TL/TLAbsInputFileLocation.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputFileLocation : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputGame.cs b/src/TgSharp.TL/TL/TLAbsInputGame.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputGame.cs rename to src/TgSharp.TL/TL/TLAbsInputGame.cs index 16334de..1790089 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputGame.cs +++ b/src/TgSharp.TL/TL/TLAbsInputGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputGame : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs b/src/TgSharp.TL/TL/TLAbsInputGeoPoint.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs rename to src/TgSharp.TL/TL/TLAbsInputGeoPoint.cs index 2e3d1f5..29d7745 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputGeoPoint.cs +++ b/src/TgSharp.TL/TL/TLAbsInputGeoPoint.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputGeoPoint : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputMedia.cs b/src/TgSharp.TL/TL/TLAbsInputMedia.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputMedia.cs rename to src/TgSharp.TL/TL/TLAbsInputMedia.cs index 34ed3a7..0a6ade8 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputMedia.cs +++ b/src/TgSharp.TL/TL/TLAbsInputMedia.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputMedia : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsInputMessage.cs b/src/TgSharp.TL/TL/TLAbsInputMessage.cs new file mode 100644 index 0000000..ff956eb --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputMessage.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputMessage : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs b/src/TgSharp.TL/TL/TLAbsInputNotifyPeer.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs rename to src/TgSharp.TL/TL/TLAbsInputNotifyPeer.cs index 23dd812..e60bb3d 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputNotifyPeer.cs +++ b/src/TgSharp.TL/TL/TLAbsInputNotifyPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputNotifyPeer : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputPaymentCredentials.cs b/src/TgSharp.TL/TL/TLAbsInputPaymentCredentials.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsInputPaymentCredentials.cs rename to src/TgSharp.TL/TL/TLAbsInputPaymentCredentials.cs index 87a6b58..4ec7d4d 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputPaymentCredentials.cs +++ b/src/TgSharp.TL/TL/TLAbsInputPaymentCredentials.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputPaymentCredentials : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputPeer.cs b/src/TgSharp.TL/TL/TLAbsInputPeer.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputPeer.cs rename to src/TgSharp.TL/TL/TLAbsInputPeer.cs index 24845d2..4d6f5be 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputPeer.cs +++ b/src/TgSharp.TL/TL/TLAbsInputPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputPeer : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputPhoto.cs b/src/TgSharp.TL/TL/TLAbsInputPhoto.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputPhoto.cs rename to src/TgSharp.TL/TL/TLAbsInputPhoto.cs index dbeaed0..231ec4e 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputPhoto.cs +++ b/src/TgSharp.TL/TL/TLAbsInputPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputPhoto : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs b/src/TgSharp.TL/TL/TLAbsInputPrivacyKey.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs rename to src/TgSharp.TL/TL/TLAbsInputPrivacyKey.cs index 21b7943..c4bea11 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputPrivacyKey.cs +++ b/src/TgSharp.TL/TL/TLAbsInputPrivacyKey.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputPrivacyKey : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs b/src/TgSharp.TL/TL/TLAbsInputPrivacyRule.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs rename to src/TgSharp.TL/TL/TLAbsInputPrivacyRule.cs index bc89964..9bc525d 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputPrivacyRule.cs +++ b/src/TgSharp.TL/TL/TLAbsInputPrivacyRule.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputPrivacyRule : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsInputSecureFile.cs b/src/TgSharp.TL/TL/TLAbsInputSecureFile.cs new file mode 100644 index 0000000..e96378f --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputSecureFile.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputSecureFile : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsInputStickerSet.cs b/src/TgSharp.TL/TL/TLAbsInputStickerSet.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputStickerSet.cs rename to src/TgSharp.TL/TL/TLAbsInputStickerSet.cs index 7578ef1..fdcd909 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputStickerSet.cs +++ b/src/TgSharp.TL/TL/TLAbsInputStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputStickerSet : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs b/src/TgSharp.TL/TL/TLAbsInputStickeredMedia.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs rename to src/TgSharp.TL/TL/TLAbsInputStickeredMedia.cs index 23d182d..f19f8f5 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputStickeredMedia.cs +++ b/src/TgSharp.TL/TL/TLAbsInputStickeredMedia.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputStickeredMedia : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsInputTheme.cs b/src/TgSharp.TL/TL/TLAbsInputTheme.cs new file mode 100644 index 0000000..d816eae --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputTheme.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputTheme : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsInputUser.cs b/src/TgSharp.TL/TL/TLAbsInputUser.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsInputUser.cs rename to src/TgSharp.TL/TL/TLAbsInputUser.cs index 70ec16b..3185ae5 100644 --- a/src/TeleSharp.TL/TL/TLAbsInputUser.cs +++ b/src/TgSharp.TL/TL/TLAbsInputUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsInputUser : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsInputWallPaper.cs b/src/TgSharp.TL/TL/TLAbsInputWallPaper.cs new file mode 100644 index 0000000..b949ac8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputWallPaper.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputWallPaper : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsInputWebFileLocation.cs b/src/TgSharp.TL/TL/TLAbsInputWebFileLocation.cs new file mode 100644 index 0000000..f25698c --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsInputWebFileLocation.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsInputWebFileLocation : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsJSONValue.cs b/src/TgSharp.TL/TL/TLAbsJSONValue.cs new file mode 100644 index 0000000..2eed1ad --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsJSONValue.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsJSONValue : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsKeyboardButton.cs b/src/TgSharp.TL/TL/TLAbsKeyboardButton.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsKeyboardButton.cs rename to src/TgSharp.TL/TL/TLAbsKeyboardButton.cs index 4760b4f..51f8e45 100644 --- a/src/TeleSharp.TL/TL/TLAbsKeyboardButton.cs +++ b/src/TgSharp.TL/TL/TLAbsKeyboardButton.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsKeyboardButton : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsLangPackString.cs b/src/TgSharp.TL/TL/TLAbsLangPackString.cs new file mode 100644 index 0000000..0b2802f --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsLangPackString.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsLangPackString : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsMessage.cs b/src/TgSharp.TL/TL/TLAbsMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsMessage.cs rename to src/TgSharp.TL/TL/TLAbsMessage.cs index 8f0ed6e..6ab68ee 100644 --- a/src/TeleSharp.TL/TL/TLAbsMessage.cs +++ b/src/TgSharp.TL/TL/TLAbsMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsMessage : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsMessageAction.cs b/src/TgSharp.TL/TL/TLAbsMessageAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsMessageAction.cs rename to src/TgSharp.TL/TL/TLAbsMessageAction.cs index d231272..4f52acb 100644 --- a/src/TeleSharp.TL/TL/TLAbsMessageAction.cs +++ b/src/TgSharp.TL/TL/TLAbsMessageAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsMessageAction : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsMessageEntity.cs b/src/TgSharp.TL/TL/TLAbsMessageEntity.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsMessageEntity.cs rename to src/TgSharp.TL/TL/TLAbsMessageEntity.cs index d892621..0bb7d4d 100644 --- a/src/TeleSharp.TL/TL/TLAbsMessageEntity.cs +++ b/src/TgSharp.TL/TL/TLAbsMessageEntity.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsMessageEntity : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsMessageMedia.cs b/src/TgSharp.TL/TL/TLAbsMessageMedia.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsMessageMedia.cs rename to src/TgSharp.TL/TL/TLAbsMessageMedia.cs index 7b8bebc..e757761 100644 --- a/src/TeleSharp.TL/TL/TLAbsMessageMedia.cs +++ b/src/TgSharp.TL/TL/TLAbsMessageMedia.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsMessageMedia : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsMessagesFilter.cs b/src/TgSharp.TL/TL/TLAbsMessagesFilter.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsMessagesFilter.cs rename to src/TgSharp.TL/TL/TLAbsMessagesFilter.cs index f89e670..0405b62 100644 --- a/src/TeleSharp.TL/TL/TLAbsMessagesFilter.cs +++ b/src/TgSharp.TL/TL/TLAbsMessagesFilter.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsMessagesFilter : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsNotifyPeer.cs b/src/TgSharp.TL/TL/TLAbsNotifyPeer.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsNotifyPeer.cs rename to src/TgSharp.TL/TL/TLAbsNotifyPeer.cs index 76e3bc4..82fffc9 100644 --- a/src/TeleSharp.TL/TL/TLAbsNotifyPeer.cs +++ b/src/TgSharp.TL/TL/TLAbsNotifyPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsNotifyPeer : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPageBlock.cs b/src/TgSharp.TL/TL/TLAbsPageBlock.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPageBlock.cs rename to src/TgSharp.TL/TL/TLAbsPageBlock.cs index 5928c6e..308d1c3 100644 --- a/src/TeleSharp.TL/TL/TLAbsPageBlock.cs +++ b/src/TgSharp.TL/TL/TLAbsPageBlock.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPageBlock : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsPageListItem.cs b/src/TgSharp.TL/TL/TLAbsPageListItem.cs new file mode 100644 index 0000000..17e9781 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsPageListItem.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsPageListItem : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsPageListOrderedItem.cs b/src/TgSharp.TL/TL/TLAbsPageListOrderedItem.cs new file mode 100644 index 0000000..b84d0fe --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsPageListOrderedItem.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsPageListOrderedItem : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsPasswordKdfAlgo.cs b/src/TgSharp.TL/TL/TLAbsPasswordKdfAlgo.cs new file mode 100644 index 0000000..b886abd --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsPasswordKdfAlgo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsPasswordKdfAlgo : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsPeer.cs b/src/TgSharp.TL/TL/TLAbsPeer.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPeer.cs rename to src/TgSharp.TL/TL/TLAbsPeer.cs index 914dc83..46b1a7d 100644 --- a/src/TeleSharp.TL/TL/TLAbsPeer.cs +++ b/src/TgSharp.TL/TL/TLAbsPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPeer : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPhoneCall.cs b/src/TgSharp.TL/TL/TLAbsPhoneCall.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPhoneCall.cs rename to src/TgSharp.TL/TL/TLAbsPhoneCall.cs index 46faf28..3e3881f 100644 --- a/src/TeleSharp.TL/TL/TLAbsPhoneCall.cs +++ b/src/TgSharp.TL/TL/TLAbsPhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPhoneCall : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPhoneCallDiscardReason.cs b/src/TgSharp.TL/TL/TLAbsPhoneCallDiscardReason.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLAbsPhoneCallDiscardReason.cs rename to src/TgSharp.TL/TL/TLAbsPhoneCallDiscardReason.cs index c6283d6..e44ad01 100644 --- a/src/TeleSharp.TL/TL/TLAbsPhoneCallDiscardReason.cs +++ b/src/TgSharp.TL/TL/TLAbsPhoneCallDiscardReason.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPhoneCallDiscardReason : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPhoto.cs b/src/TgSharp.TL/TL/TLAbsPhoto.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPhoto.cs rename to src/TgSharp.TL/TL/TLAbsPhoto.cs index 4dd7e31..d8200e4 100644 --- a/src/TeleSharp.TL/TL/TLAbsPhoto.cs +++ b/src/TgSharp.TL/TL/TLAbsPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPhoto : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPhotoSize.cs b/src/TgSharp.TL/TL/TLAbsPhotoSize.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPhotoSize.cs rename to src/TgSharp.TL/TL/TLAbsPhotoSize.cs index 7038129..3314d75 100644 --- a/src/TeleSharp.TL/TL/TLAbsPhotoSize.cs +++ b/src/TgSharp.TL/TL/TLAbsPhotoSize.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPhotoSize : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPrivacyKey.cs b/src/TgSharp.TL/TL/TLAbsPrivacyKey.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPrivacyKey.cs rename to src/TgSharp.TL/TL/TLAbsPrivacyKey.cs index 1885650..4428a95 100644 --- a/src/TeleSharp.TL/TL/TLAbsPrivacyKey.cs +++ b/src/TgSharp.TL/TL/TLAbsPrivacyKey.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPrivacyKey : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsPrivacyRule.cs b/src/TgSharp.TL/TL/TLAbsPrivacyRule.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsPrivacyRule.cs rename to src/TgSharp.TL/TL/TLAbsPrivacyRule.cs index f015088..c8c0520 100644 --- a/src/TeleSharp.TL/TL/TLAbsPrivacyRule.cs +++ b/src/TgSharp.TL/TL/TLAbsPrivacyRule.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsPrivacyRule : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsRecentMeUrl.cs b/src/TgSharp.TL/TL/TLAbsRecentMeUrl.cs new file mode 100644 index 0000000..71e1ccf --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsRecentMeUrl.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsRecentMeUrl : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsReplyMarkup.cs b/src/TgSharp.TL/TL/TLAbsReplyMarkup.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsReplyMarkup.cs rename to src/TgSharp.TL/TL/TLAbsReplyMarkup.cs index f7c3be0..de24cd6 100644 --- a/src/TeleSharp.TL/TL/TLAbsReplyMarkup.cs +++ b/src/TgSharp.TL/TL/TLAbsReplyMarkup.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsReplyMarkup : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsReportReason.cs b/src/TgSharp.TL/TL/TLAbsReportReason.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsReportReason.cs rename to src/TgSharp.TL/TL/TLAbsReportReason.cs index 87add4b..c2884d9 100644 --- a/src/TeleSharp.TL/TL/TLAbsReportReason.cs +++ b/src/TgSharp.TL/TL/TLAbsReportReason.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsReportReason : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsRichText.cs b/src/TgSharp.TL/TL/TLAbsRichText.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsRichText.cs rename to src/TgSharp.TL/TL/TLAbsRichText.cs index 5e84f35..3eafead 100644 --- a/src/TeleSharp.TL/TL/TLAbsRichText.cs +++ b/src/TgSharp.TL/TL/TLAbsRichText.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsRichText : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsSecureFile.cs b/src/TgSharp.TL/TL/TLAbsSecureFile.cs new file mode 100644 index 0000000..bae9bed --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsSecureFile.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsSecureFile : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsSecurePasswordKdfAlgo.cs b/src/TgSharp.TL/TL/TLAbsSecurePasswordKdfAlgo.cs new file mode 100644 index 0000000..c6f88aa --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsSecurePasswordKdfAlgo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsSecurePasswordKdfAlgo : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsSecurePlainData.cs b/src/TgSharp.TL/TL/TLAbsSecurePlainData.cs new file mode 100644 index 0000000..d97cc55 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsSecurePlainData.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsSecurePlainData : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsSecureRequiredType.cs b/src/TgSharp.TL/TL/TLAbsSecureRequiredType.cs new file mode 100644 index 0000000..cd8afff --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsSecureRequiredType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsSecureRequiredType : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsSecureValueError.cs b/src/TgSharp.TL/TL/TLAbsSecureValueError.cs new file mode 100644 index 0000000..33310cd --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsSecureValueError.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsSecureValueError : TLObject + { + } +} diff --git a/src/TgSharp.TL/TL/TLAbsSecureValueType.cs b/src/TgSharp.TL/TL/TLAbsSecureValueType.cs new file mode 100644 index 0000000..d16f6fb --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsSecureValueType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsSecureValueType : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsSendMessageAction.cs b/src/TgSharp.TL/TL/TLAbsSendMessageAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsSendMessageAction.cs rename to src/TgSharp.TL/TL/TLAbsSendMessageAction.cs index edcc8ed..f5d1485 100644 --- a/src/TeleSharp.TL/TL/TLAbsSendMessageAction.cs +++ b/src/TgSharp.TL/TL/TLAbsSendMessageAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsSendMessageAction : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs b/src/TgSharp.TL/TL/TLAbsStickerSetCovered.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs rename to src/TgSharp.TL/TL/TLAbsStickerSetCovered.cs index 2a558fb..d40fdd5 100644 --- a/src/TeleSharp.TL/TL/TLAbsStickerSetCovered.cs +++ b/src/TgSharp.TL/TL/TLAbsStickerSetCovered.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsStickerSetCovered : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs b/src/TgSharp.TL/TL/TLAbsTopPeerCategory.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs rename to src/TgSharp.TL/TL/TLAbsTopPeerCategory.cs index 0bf8f11..2115293 100644 --- a/src/TeleSharp.TL/TL/TLAbsTopPeerCategory.cs +++ b/src/TgSharp.TL/TL/TLAbsTopPeerCategory.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsTopPeerCategory : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsUpdate.cs b/src/TgSharp.TL/TL/TLAbsUpdate.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsUpdate.cs rename to src/TgSharp.TL/TL/TLAbsUpdate.cs index 6f71cc3..b06a3e0 100644 --- a/src/TeleSharp.TL/TL/TLAbsUpdate.cs +++ b/src/TgSharp.TL/TL/TLAbsUpdate.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsUpdate : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsUpdates.cs b/src/TgSharp.TL/TL/TLAbsUpdates.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsUpdates.cs rename to src/TgSharp.TL/TL/TLAbsUpdates.cs index 9653aa9..3eb46c9 100644 --- a/src/TeleSharp.TL/TL/TLAbsUpdates.cs +++ b/src/TgSharp.TL/TL/TLAbsUpdates.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsUpdates : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsUrlAuthResult.cs b/src/TgSharp.TL/TL/TLAbsUrlAuthResult.cs new file mode 100644 index 0000000..d359f45 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsUrlAuthResult.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsUrlAuthResult : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsUser.cs b/src/TgSharp.TL/TL/TLAbsUser.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsUser.cs rename to src/TgSharp.TL/TL/TLAbsUser.cs index b9dcb61..5dc41c0 100644 --- a/src/TeleSharp.TL/TL/TLAbsUser.cs +++ b/src/TgSharp.TL/TL/TLAbsUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsUser : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs b/src/TgSharp.TL/TL/TLAbsUserProfilePhoto.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs rename to src/TgSharp.TL/TL/TLAbsUserProfilePhoto.cs index c3c9e05..a2ace6f 100644 --- a/src/TeleSharp.TL/TL/TLAbsUserProfilePhoto.cs +++ b/src/TgSharp.TL/TL/TLAbsUserProfilePhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsUserProfilePhoto : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsUserStatus.cs b/src/TgSharp.TL/TL/TLAbsUserStatus.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsUserStatus.cs rename to src/TgSharp.TL/TL/TLAbsUserStatus.cs index 21ef437..952ec88 100644 --- a/src/TeleSharp.TL/TL/TLAbsUserStatus.cs +++ b/src/TgSharp.TL/TL/TLAbsUserStatus.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsUserStatus : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAbsWallPaper.cs b/src/TgSharp.TL/TL/TLAbsWallPaper.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsWallPaper.cs rename to src/TgSharp.TL/TL/TLAbsWallPaper.cs index a67e4e0..be115b7 100644 --- a/src/TeleSharp.TL/TL/TLAbsWallPaper.cs +++ b/src/TgSharp.TL/TL/TLAbsWallPaper.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsWallPaper : TLObject { diff --git a/src/TgSharp.TL/TL/TLAbsWebDocument.cs b/src/TgSharp.TL/TL/TLAbsWebDocument.cs new file mode 100644 index 0000000..a0acc93 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAbsWebDocument.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + public abstract class TLAbsWebDocument : TLObject + { + } +} diff --git a/src/TeleSharp.TL/TL/TLAbsWebPage.cs b/src/TgSharp.TL/TL/TLAbsWebPage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLAbsWebPage.cs rename to src/TgSharp.TL/TL/TLAbsWebPage.cs index 1433c52..db17a2d 100644 --- a/src/TeleSharp.TL/TL/TLAbsWebPage.cs +++ b/src/TgSharp.TL/TL/TLAbsWebPage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { public abstract class TLAbsWebPage : TLObject { diff --git a/src/TeleSharp.TL/TL/TLAccountDaysTTL.cs b/src/TgSharp.TL/TL/TLAccountDaysTTL.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLAccountDaysTTL.cs rename to src/TgSharp.TL/TL/TLAccountDaysTTL.cs index 8e2b698..50754b3 100644 --- a/src/TeleSharp.TL/TL/TLAccountDaysTTL.cs +++ b/src/TgSharp.TL/TL/TLAccountDaysTTL.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1194283041)] public class TLAccountDaysTTL : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Days { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Days = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Days); - } } } diff --git a/src/TeleSharp.TL/TL/TLAuthorization.cs b/src/TgSharp.TL/TL/TLAuthorization.cs similarity index 84% rename from src/TeleSharp.TL/TL/TLAuthorization.cs rename to src/TgSharp.TL/TL/TLAuthorization.cs index fbf369f..df9dfe3 100644 --- a/src/TeleSharp.TL/TL/TLAuthorization.cs +++ b/src/TgSharp.TL/TL/TLAuthorization.cs @@ -4,22 +4,27 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(2079516406)] + [TLObject(-1392388579)] public class TLAuthorization : TLObject { public override int Constructor { get { - return 2079516406; + return -1392388579; } } - public long Hash { get; set; } public int Flags { get; set; } + public bool Current { get; set; } + public bool OfficialApp { get; set; } + public bool PasswordPending { get; set; } + public long Hash { get; set; } public string DeviceModel { get; set; } public string Platform { get; set; } public string SystemVersion { get; set; } @@ -32,17 +37,18 @@ namespace TeleSharp.TL public string Country { get; set; } public string Region { get; set; } - public void ComputeFlags() { - Flags = 0; - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Hash = br.ReadInt64(); Flags = br.ReadInt32(); + Current = (Flags & 1) != 0; + OfficialApp = (Flags & 2) != 0; + PasswordPending = (Flags & 4) != 0; + Hash = br.ReadInt64(); DeviceModel = StringUtil.Deserialize(br); Platform = StringUtil.Deserialize(br); SystemVersion = StringUtil.Deserialize(br); @@ -54,13 +60,11 @@ namespace TeleSharp.TL Ip = StringUtil.Deserialize(br); Country = StringUtil.Deserialize(br); Region = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(Hash); StringUtil.Serialize(DeviceModel, bw); @@ -74,7 +78,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Ip, bw); StringUtil.Serialize(Country, bw); StringUtil.Serialize(Region, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLAutoDownloadSettings.cs b/src/TgSharp.TL/TL/TLAutoDownloadSettings.cs new file mode 100644 index 0000000..bffc714 --- /dev/null +++ b/src/TgSharp.TL/TL/TLAutoDownloadSettings.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-532532493)] + public class TLAutoDownloadSettings : TLObject + { + public override int Constructor + { + get + { + return -532532493; + } + } + + public int Flags { get; set; } + public bool Disabled { get; set; } + public bool VideoPreloadLarge { get; set; } + public bool AudioPreloadNext { get; set; } + public bool PhonecallsLessData { get; set; } + public int PhotoSizeMax { get; set; } + public int VideoSizeMax { get; set; } + public int FileSizeMax { get; set; } + public int VideoUploadMaxbitrate { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Disabled = (Flags & 1) != 0; + VideoPreloadLarge = (Flags & 2) != 0; + AudioPreloadNext = (Flags & 4) != 0; + PhonecallsLessData = (Flags & 8) != 0; + PhotoSizeMax = br.ReadInt32(); + VideoSizeMax = br.ReadInt32(); + FileSizeMax = br.ReadInt32(); + VideoUploadMaxbitrate = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(PhotoSizeMax); + bw.Write(VideoSizeMax); + bw.Write(FileSizeMax); + bw.Write(VideoUploadMaxbitrate); + } + } +} diff --git a/src/TgSharp.TL/TL/TLBaseThemeArctic.cs b/src/TgSharp.TL/TL/TLBaseThemeArctic.cs new file mode 100644 index 0000000..0840ac0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLBaseThemeArctic.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1527845466)] + public class TLBaseThemeArctic : TLAbsBaseTheme + { + public override int Constructor + { + get + { + return 1527845466; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLBaseThemeClassic.cs b/src/TgSharp.TL/TL/TLBaseThemeClassic.cs new file mode 100644 index 0000000..9c98cbe --- /dev/null +++ b/src/TgSharp.TL/TL/TLBaseThemeClassic.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1012849566)] + public class TLBaseThemeClassic : TLAbsBaseTheme + { + public override int Constructor + { + get + { + return -1012849566; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelRoleEditor.cs b/src/TgSharp.TL/TL/TLBaseThemeDay.cs similarity index 67% rename from src/TeleSharp.TL/TL/TLChannelRoleEditor.cs rename to src/TgSharp.TL/TL/TLBaseThemeDay.cs index 34c9db0..e707f94 100644 --- a/src/TeleSharp.TL/TL/TLChannelRoleEditor.cs +++ b/src/TgSharp.TL/TL/TLBaseThemeDay.cs @@ -4,36 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-2113143156)] - public class TLChannelRoleEditor : TLAbsChannelParticipantRole + [TLObject(-69724536)] + public class TLBaseThemeDay : TLAbsBaseTheme { public override int Constructor { get { - return -2113143156; + return -69724536; } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLBaseThemeNight.cs b/src/TgSharp.TL/TL/TLBaseThemeNight.cs new file mode 100644 index 0000000..8b66763 --- /dev/null +++ b/src/TgSharp.TL/TL/TLBaseThemeNight.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1212997976)] + public class TLBaseThemeNight : TLAbsBaseTheme + { + public override int Constructor + { + get + { + return -1212997976; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLBaseThemeTinted.cs b/src/TgSharp.TL/TL/TLBaseThemeTinted.cs new file mode 100644 index 0000000..ccddd4d --- /dev/null +++ b/src/TgSharp.TL/TL/TLBaseThemeTinted.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1834973166)] + public class TLBaseThemeTinted : TLAbsBaseTheme + { + public override int Constructor + { + get + { + return 1834973166; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLBoolFalse.cs b/src/TgSharp.TL/TL/TLBoolFalse.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLBoolFalse.cs rename to src/TgSharp.TL/TL/TLBoolFalse.cs index 7282348..3aec992 100644 --- a/src/TeleSharp.TL/TL/TLBoolFalse.cs +++ b/src/TgSharp.TL/TL/TLBoolFalse.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1132882121)] public class TLBoolFalse : TLAbsBool @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLBoolTrue.cs b/src/TgSharp.TL/TL/TLBoolTrue.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLBoolTrue.cs rename to src/TgSharp.TL/TL/TLBoolTrue.cs index a96c279..e38b2eb 100644 --- a/src/TeleSharp.TL/TL/TLBoolTrue.cs +++ b/src/TgSharp.TL/TL/TLBoolTrue.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1720552011)] public class TLBoolTrue : TLAbsBool @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLBotCommand.cs b/src/TgSharp.TL/TL/TLBotCommand.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLBotCommand.cs rename to src/TgSharp.TL/TL/TLBotCommand.cs index 0613f68..f58239e 100644 --- a/src/TeleSharp.TL/TL/TLBotCommand.cs +++ b/src/TgSharp.TL/TL/TLBotCommand.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1032140601)] public class TLBotCommand : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Command { get; set; } public string Description { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Command = StringUtil.Deserialize(br); Description = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Command, bw); StringUtil.Serialize(Description, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInfo.cs b/src/TgSharp.TL/TL/TLBotInfo.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLBotInfo.cs rename to src/TgSharp.TL/TL/TLBotInfo.cs index d7acda3..e4062ba 100644 --- a/src/TeleSharp.TL/TL/TLBotInfo.cs +++ b/src/TgSharp.TL/TL/TLBotInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1729618630)] public class TLBotInfo : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL public string Description { get; set; } public TLVector Commands { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL UserId = br.ReadInt32(); Description = StringUtil.Deserialize(br); Commands = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(UserId); StringUtil.Serialize(Description, bw); ObjectUtils.SerializeObject(Commands, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInlineMediaResult.cs b/src/TgSharp.TL/TL/TLBotInlineMediaResult.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLBotInlineMediaResult.cs rename to src/TgSharp.TL/TL/TLBotInlineMediaResult.cs index c6765bd..67bfbca 100644 --- a/src/TeleSharp.TL/TL/TLBotInlineMediaResult.cs +++ b/src/TgSharp.TL/TL/TLBotInlineMediaResult.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(400266251)] public class TLBotInlineMediaResult : TLAbsBotInlineResult @@ -27,15 +29,9 @@ namespace TeleSharp.TL public string Description { get; set; } public TLAbsBotInlineMessage SendMessage { 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -64,13 +60,11 @@ namespace TeleSharp.TL Description = null; SendMessage = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(Id, bw); StringUtil.Serialize(Type, bw); @@ -83,7 +77,6 @@ namespace TeleSharp.TL if ((Flags & 8) != 0) StringUtil.Serialize(Description, bw); ObjectUtils.SerializeObject(SendMessage, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs b/src/TgSharp.TL/TL/TLBotInlineMessageMediaAuto.cs similarity index 61% rename from src/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs rename to src/TgSharp.TL/TL/TLBotInlineMessageMediaAuto.cs index bbaeee4..c6ccac5 100644 --- a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaAuto.cs +++ b/src/TgSharp.TL/TL/TLBotInlineMessageMediaAuto.cs @@ -4,53 +4,57 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(175419739)] + [TLObject(1984755728)] public class TLBotInlineMessageMediaAuto : TLAbsBotInlineMessage { public override int Constructor { get { - return 175419739; + return 1984755728; } } public int Flags { get; set; } - public string Caption { get; set; } + public string Message { get; set; } + public TLVector Entities { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); - Caption = StringUtil.Deserialize(br); + Message = StringUtil.Deserialize(br); + if ((Flags & 2) != 0) + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + else + Entities = null; + if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - StringUtil.Serialize(Caption, bw); + StringUtil.Serialize(Message, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Entities, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs b/src/TgSharp.TL/TL/TLBotInlineMessageMediaContact.cs similarity index 84% rename from src/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs rename to src/TgSharp.TL/TL/TLBotInlineMessageMediaContact.cs index efb067e..c4e01b4 100644 --- a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaContact.cs +++ b/src/TgSharp.TL/TL/TLBotInlineMessageMediaContact.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(904770772)] + [TLObject(416402882)] public class TLBotInlineMessageMediaContact : TLAbsBotInlineMessage { public override int Constructor { get { - return 904770772; + return 416402882; } } @@ -22,14 +24,12 @@ namespace TeleSharp.TL public string PhoneNumber { get; set; } public string FirstName { get; set; } public string LastName { get; set; } + public string Vcard { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -38,25 +38,24 @@ namespace TeleSharp.TL PhoneNumber = StringUtil.Deserialize(br); FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); + Vcard = StringUtil.Deserialize(br); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); + StringUtil.Serialize(Vcard, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs b/src/TgSharp.TL/TL/TLBotInlineMessageMediaGeo.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs rename to src/TgSharp.TL/TL/TLBotInlineMessageMediaGeo.cs index caf8bda..ce6aac8 100644 --- a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaGeo.cs +++ b/src/TgSharp.TL/TL/TLBotInlineMessageMediaGeo.cs @@ -4,53 +4,52 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(982505656)] + [TLObject(-1222451611)] public class TLBotInlineMessageMediaGeo : TLAbsBotInlineMessage { public override int Constructor { get { - return 982505656; + return -1222451611; } } public int Flags { get; set; } public TLAbsGeoPoint Geo { get; set; } + public int Period { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); + Period = br.ReadInt32(); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(Geo, bw); + bw.Write(Period); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs b/src/TgSharp.TL/TL/TLBotInlineMessageMediaVenue.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs rename to src/TgSharp.TL/TL/TLBotInlineMessageMediaVenue.cs index ee1e589..e379779 100644 --- a/src/TeleSharp.TL/TL/TLBotInlineMessageMediaVenue.cs +++ b/src/TgSharp.TL/TL/TLBotInlineMessageMediaVenue.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1130767150)] + [TLObject(-1970903652)] public class TLBotInlineMessageMediaVenue : TLAbsBotInlineMessage { public override int Constructor { get { - return 1130767150; + return -1970903652; } } @@ -24,14 +26,12 @@ namespace TeleSharp.TL public string Address { get; set; } public string Provider { get; set; } public string VenueId { get; set; } + public string VenueType { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,27 +42,26 @@ namespace TeleSharp.TL Address = StringUtil.Deserialize(br); Provider = StringUtil.Deserialize(br); VenueId = StringUtil.Deserialize(br); + VenueType = StringUtil.Deserialize(br); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { 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(VenueId, bw); + StringUtil.Serialize(VenueType, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLBotInlineMessageText.cs b/src/TgSharp.TL/TL/TLBotInlineMessageText.cs similarity index 84% rename from src/TeleSharp.TL/TL/TLBotInlineMessageText.cs rename to src/TgSharp.TL/TL/TLBotInlineMessageText.cs index 7e8a319..a49bfd3 100644 --- a/src/TeleSharp.TL/TL/TLBotInlineMessageText.cs +++ b/src/TgSharp.TL/TL/TLBotInlineMessageText.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1937807902)] public class TLBotInlineMessageText : TLAbsBotInlineMessage @@ -24,14 +26,9 @@ namespace TeleSharp.TL public TLVector Entities { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 1) : (Flags & ~1); - Flags = Entities != null ? (Flags | 2) : (Flags & ~2); - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -49,21 +46,17 @@ namespace TeleSharp.TL else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { 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(ReplyMarkup, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLBotInlineResult.cs b/src/TgSharp.TL/TL/TLBotInlineResult.cs new file mode 100644 index 0000000..5542661 --- /dev/null +++ b/src/TgSharp.TL/TL/TLBotInlineResult.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(295067450)] + public class TLBotInlineResult : TLAbsBotInlineResult + { + public override int Constructor + { + get + { + return 295067450; + } + } + + 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 TLAbsWebDocument Thumb { get; set; } + public TLAbsWebDocument Content { get; set; } + public TLAbsBotInlineMessage SendMessage { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + 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; + + if ((Flags & 4) != 0) + Description = StringUtil.Deserialize(br); + else + Description = null; + + if ((Flags & 8) != 0) + Url = StringUtil.Deserialize(br); + else + Url = null; + + if ((Flags & 16) != 0) + Thumb = (TLAbsWebDocument)ObjectUtils.DeserializeObject(br); + else + Thumb = null; + + if ((Flags & 32) != 0) + Content = (TLAbsWebDocument)ObjectUtils.DeserializeObject(br); + else + Content = null; + + SendMessage = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + 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) + ObjectUtils.SerializeObject(Thumb, bw); + if ((Flags & 32) != 0) + ObjectUtils.SerializeObject(Content, bw); + ObjectUtils.SerializeObject(SendMessage, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLCdnConfig.cs b/src/TgSharp.TL/TL/TLCdnConfig.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLCdnConfig.cs rename to src/TgSharp.TL/TL/TLCdnConfig.cs index f658db1..c477f38 100644 --- a/src/TeleSharp.TL/TL/TLCdnConfig.cs +++ b/src/TgSharp.TL/TL/TLCdnConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1462101002)] public class TLCdnConfig : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector PublicKeys { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PublicKeys = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(PublicKeys, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLCdnPublicKey.cs b/src/TgSharp.TL/TL/TLCdnPublicKey.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLCdnPublicKey.cs rename to src/TgSharp.TL/TL/TLCdnPublicKey.cs index 3b59eca..385891d 100644 --- a/src/TeleSharp.TL/TL/TLCdnPublicKey.cs +++ b/src/TgSharp.TL/TL/TLCdnPublicKey.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-914167110)] public class TLCdnPublicKey : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int DcId { get; set; } public string PublicKey { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { DcId = br.ReadInt32(); PublicKey = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(DcId); StringUtil.Serialize(PublicKey, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLChannel.cs b/src/TgSharp.TL/TL/TLChannel.cs similarity index 55% rename from src/TeleSharp.TL/TL/TLChannel.cs rename to src/TgSharp.TL/TL/TLChannel.cs index b38719c..303cc00 100644 --- a/src/TeleSharp.TL/TL/TLChannel.cs +++ b/src/TgSharp.TL/TL/TLChannel.cs @@ -4,33 +4,35 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1588737454)] + [TLObject(-753232354)] public class TLChannel : TLAbsChat { public override int Constructor { get { - return -1588737454; + return -753232354; } } 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 bool Scam { get; set; } + public bool HasLink { get; set; } + public bool HasGeo { get; set; } + public bool SlowmodeEnabled { get; set; } public int Id { get; set; } public long? AccessHash { get; set; } public string Title { get; set; } @@ -38,45 +40,32 @@ namespace TeleSharp.TL public TLAbsChatPhoto Photo { get; set; } public int Date { get; set; } public int Version { get; set; } - public string RestrictionReason { get; set; } - + public TLVector RestrictionReason { get; set; } + public TLChatAdminRights AdminRights { get; set; } + public TLChatBannedRights BannedRights { get; set; } + public TLChatBannedRights DefaultBannedRights { get; set; } + public int? ParticipantsCount { 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 = AccessHash != null ? (Flags | 8192) : (Flags & ~8192); - Flags = Username != null ? (Flags | 64) : (Flags & ~64); - Flags = RestrictionReason != null ? (Flags | 512) : (Flags & ~512); - + // do nothing } 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; + Scam = (Flags & 524288) != 0; + HasLink = (Flags & 1048576) != 0; + HasGeo = (Flags & 2097152) != 0; + SlowmodeEnabled = (Flags & 4194304) != 0; Id = br.ReadInt32(); if ((Flags & 8192) != 0) AccessHash = br.ReadInt64(); @@ -93,30 +82,36 @@ namespace TeleSharp.TL Date = br.ReadInt32(); Version = br.ReadInt32(); if ((Flags & 512) != 0) - RestrictionReason = StringUtil.Deserialize(br); + RestrictionReason = (TLVector)ObjectUtils.DeserializeVector(br); else RestrictionReason = null; + if ((Flags & 16384) != 0) + AdminRights = (TLChatAdminRights)ObjectUtils.DeserializeObject(br); + else + AdminRights = null; + + if ((Flags & 32768) != 0) + BannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + else + BannedRights = null; + + if ((Flags & 262144) != 0) + DefaultBannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + else + DefaultBannedRights = null; + + if ((Flags & 131072) != 0) + ParticipantsCount = br.ReadInt32(); + else + ParticipantsCount = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - - - - - - - - - bw.Write(Id); if ((Flags & 8192) != 0) bw.Write(AccessHash.Value); @@ -127,8 +122,15 @@ namespace TeleSharp.TL bw.Write(Date); bw.Write(Version); if ((Flags & 512) != 0) - StringUtil.Serialize(RestrictionReason, bw); - + ObjectUtils.SerializeObject(RestrictionReason, bw); + if ((Flags & 16384) != 0) + ObjectUtils.SerializeObject(AdminRights, bw); + if ((Flags & 32768) != 0) + ObjectUtils.SerializeObject(BannedRights, bw); + if ((Flags & 262144) != 0) + ObjectUtils.SerializeObject(DefaultBannedRights, bw); + if ((Flags & 131072) != 0) + bw.Write(ParticipantsCount.Value); } } } diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantKicked.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEvent.cs similarity index 59% rename from src/TeleSharp.TL/TL/TLChannelParticipantKicked.cs rename to src/TgSharp.TL/TL/TLChannelAdminLogEvent.cs index 8559924..7432f82 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantKicked.cs +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEvent.cs @@ -4,45 +4,47 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1933187430)] - public class TLChannelParticipantKicked : TLAbsChannelParticipant + [TLObject(995769920)] + public class TLChannelAdminLogEvent : TLObject { public override int Constructor { get { - return -1933187430; + return 995769920; } } - public int UserId { get; set; } - public int KickedBy { get; set; } + public long Id { get; set; } public int Date { get; set; } - + public int UserId { get; set; } + public TLAbsChannelAdminLogEventAction Action { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - UserId = br.ReadInt32(); - KickedBy = br.ReadInt32(); + Id = br.ReadInt64(); Date = br.ReadInt32(); - + UserId = br.ReadInt32(); + Action = (TLAbsChannelAdminLogEventAction)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(UserId); - bw.Write(KickedBy); + bw.Write(Id); bw.Write(Date); - + bw.Write(UserId); + ObjectUtils.SerializeObject(Action, bw); } } } diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeAbout.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeAbout.cs new file mode 100644 index 0000000..63b166e --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeAbout.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1427671598)] + public class TLChannelAdminLogEventActionChangeAbout : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1427671598; + } + } + + public string PrevValue { get; set; } + public string NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevValue = StringUtil.Deserialize(br); + NewValue = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(PrevValue, bw); + StringUtil.Serialize(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeLinkedChat.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeLinkedChat.cs new file mode 100644 index 0000000..155b63b --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeLinkedChat.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1569748965)] + public class TLChannelAdminLogEventActionChangeLinkedChat : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -1569748965; + } + } + + public int PrevValue { get; set; } + public int NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevValue = br.ReadInt32(); + NewValue = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(PrevValue); + bw.Write(NewValue); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeLocation.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeLocation.cs new file mode 100644 index 0000000..149fd63 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeLocation.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(241923758)] + public class TLChannelAdminLogEventActionChangeLocation : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 241923758; + } + } + + public TLAbsChannelLocation PrevValue { get; set; } + public TLAbsChannelLocation NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevValue = (TLAbsChannelLocation)ObjectUtils.DeserializeObject(br); + NewValue = (TLAbsChannelLocation)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevValue, bw); + ObjectUtils.SerializeObject(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangePhoto.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangePhoto.cs new file mode 100644 index 0000000..8f96699 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangePhoto.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1129042607)] + public class TLChannelAdminLogEventActionChangePhoto : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1129042607; + } + } + + public TLAbsPhoto PrevPhoto { get; set; } + public TLAbsPhoto NewPhoto { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevPhoto = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); + NewPhoto = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevPhoto, bw); + ObjectUtils.SerializeObject(NewPhoto, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeStickerSet.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeStickerSet.cs new file mode 100644 index 0000000..8f4d17e --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeStickerSet.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1312568665)] + public class TLChannelAdminLogEventActionChangeStickerSet : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -1312568665; + } + } + + public TLAbsInputStickerSet PrevStickerset { get; set; } + public TLAbsInputStickerSet NewStickerset { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevStickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); + NewStickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevStickerset, bw); + ObjectUtils.SerializeObject(NewStickerset, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeTitle.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeTitle.cs new file mode 100644 index 0000000..022eedd --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeTitle.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-421545947)] + public class TLChannelAdminLogEventActionChangeTitle : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -421545947; + } + } + + public string PrevValue { get; set; } + public string NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevValue = StringUtil.Deserialize(br); + NewValue = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(PrevValue, bw); + StringUtil.Serialize(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeUsername.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeUsername.cs new file mode 100644 index 0000000..e74f1e5 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionChangeUsername.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1783299128)] + public class TLChannelAdminLogEventActionChangeUsername : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1783299128; + } + } + + public string PrevValue { get; set; } + public string NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevValue = StringUtil.Deserialize(br); + NewValue = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(PrevValue, bw); + StringUtil.Serialize(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionDefaultBannedRights.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionDefaultBannedRights.cs new file mode 100644 index 0000000..c0e18aa --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionDefaultBannedRights.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(771095562)] + public class TLChannelAdminLogEventActionDefaultBannedRights : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 771095562; + } + } + + public TLChatBannedRights PrevBannedRights { get; set; } + public TLChatBannedRights NewBannedRights { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevBannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + NewBannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevBannedRights, bw); + ObjectUtils.SerializeObject(NewBannedRights, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionDeleteMessage.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionDeleteMessage.cs new file mode 100644 index 0000000..e7a52d8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionDeleteMessage.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1121994683)] + public class TLChannelAdminLogEventActionDeleteMessage : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1121994683; + } + } + + public TLAbsMessage Message { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Message, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionEditMessage.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionEditMessage.cs new file mode 100644 index 0000000..83f80bc --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionEditMessage.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1889215493)] + public class TLChannelAdminLogEventActionEditMessage : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1889215493; + } + } + + public TLAbsMessage PrevMessage { get; set; } + public TLAbsMessage NewMessage { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevMessage = (TLAbsMessage)ObjectUtils.DeserializeObject(br); + NewMessage = (TLAbsMessage)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevMessage, bw); + ObjectUtils.SerializeObject(NewMessage, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantInvite.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantInvite.cs new file mode 100644 index 0000000..d0db654 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantInvite.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-484690728)] + public class TLChannelAdminLogEventActionParticipantInvite : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -484690728; + } + } + + public TLAbsChannelParticipant Participant { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Participant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Participant, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantJoin.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantJoin.cs new file mode 100644 index 0000000..6b08eea --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantJoin.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(405815507)] + public class TLChannelAdminLogEventActionParticipantJoin : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 405815507; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantLeave.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantLeave.cs new file mode 100644 index 0000000..99e57da --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantLeave.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-124291086)] + public class TLChannelAdminLogEventActionParticipantLeave : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -124291086; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantToggleAdmin.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantToggleAdmin.cs new file mode 100644 index 0000000..5e27618 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantToggleAdmin.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-714643696)] + public class TLChannelAdminLogEventActionParticipantToggleAdmin : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -714643696; + } + } + + public TLAbsChannelParticipant PrevParticipant { get; set; } + public TLAbsChannelParticipant NewParticipant { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevParticipant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); + NewParticipant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevParticipant, bw); + ObjectUtils.SerializeObject(NewParticipant, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantToggleBan.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantToggleBan.cs new file mode 100644 index 0000000..ae434f6 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionParticipantToggleBan.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-422036098)] + public class TLChannelAdminLogEventActionParticipantToggleBan : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -422036098; + } + } + + public TLAbsChannelParticipant PrevParticipant { get; set; } + public TLAbsChannelParticipant NewParticipant { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevParticipant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); + NewParticipant = (TLAbsChannelParticipant)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PrevParticipant, bw); + ObjectUtils.SerializeObject(NewParticipant, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionStopPoll.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionStopPoll.cs new file mode 100644 index 0000000..00d20cb --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionStopPoll.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1895328189)] + public class TLChannelAdminLogEventActionStopPoll : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -1895328189; + } + } + + public TLAbsMessage Message { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Message, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleInvites.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleInvites.cs new file mode 100644 index 0000000..0329be3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleInvites.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(460916654)] + public class TLChannelAdminLogEventActionToggleInvites : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 460916654; + } + } + + public bool NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + NewValue = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BoolUtil.Serialize(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionTogglePreHistoryHidden.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionTogglePreHistoryHidden.cs new file mode 100644 index 0000000..3fb84c4 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionTogglePreHistoryHidden.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1599903217)] + public class TLChannelAdminLogEventActionTogglePreHistoryHidden : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1599903217; + } + } + + public bool NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + NewValue = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BoolUtil.Serialize(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleSignatures.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleSignatures.cs new file mode 100644 index 0000000..19ff4c4 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleSignatures.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(648939889)] + public class TLChannelAdminLogEventActionToggleSignatures : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 648939889; + } + } + + public bool NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + NewValue = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BoolUtil.Serialize(NewValue, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleSlowMode.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleSlowMode.cs new file mode 100644 index 0000000..1ab9675 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionToggleSlowMode.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1401984889)] + public class TLChannelAdminLogEventActionToggleSlowMode : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return 1401984889; + } + } + + public int PrevValue { get; set; } + public int NewValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PrevValue = br.ReadInt32(); + NewValue = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(PrevValue); + bw.Write(NewValue); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventActionUpdatePinned.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionUpdatePinned.cs new file mode 100644 index 0000000..56419af --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventActionUpdatePinned.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-370660328)] + public class TLChannelAdminLogEventActionUpdatePinned : TLAbsChannelAdminLogEventAction + { + public override int Constructor + { + get + { + return -370660328; + } + } + + public TLAbsMessage Message { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Message, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChannelAdminLogEventsFilter.cs b/src/TgSharp.TL/TL/TLChannelAdminLogEventsFilter.cs new file mode 100644 index 0000000..40f1331 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelAdminLogEventsFilter.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-368018716)] + public class TLChannelAdminLogEventsFilter : TLObject + { + public override int Constructor + { + get + { + return -368018716; + } + } + + public int Flags { get; set; } + public bool Join { get; set; } + public bool Leave { get; set; } + public bool Invite { get; set; } + public bool Ban { get; set; } + public bool Unban { get; set; } + public bool Kick { get; set; } + public bool Unkick { get; set; } + public bool Promote { get; set; } + public bool Demote { get; set; } + public bool Info { get; set; } + public bool Settings { get; set; } + public bool Pinned { get; set; } + public bool Edit { get; set; } + public bool Delete { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Join = (Flags & 1) != 0; + Leave = (Flags & 2) != 0; + Invite = (Flags & 4) != 0; + Ban = (Flags & 8) != 0; + Unban = (Flags & 16) != 0; + Kick = (Flags & 32) != 0; + Unkick = (Flags & 64) != 0; + Promote = (Flags & 128) != 0; + Demote = (Flags & 256) != 0; + Info = (Flags & 512) != 0; + Settings = (Flags & 1024) != 0; + Pinned = (Flags & 2048) != 0; + Edit = (Flags & 4096) != 0; + Delete = (Flags & 8192) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelForbidden.cs b/src/TgSharp.TL/TL/TLChannelForbidden.cs similarity index 75% rename from src/TeleSharp.TL/TL/TLChannelForbidden.cs rename to src/TgSharp.TL/TL/TLChannelForbidden.cs index 743b4dc..db30fec 100644 --- a/src/TeleSharp.TL/TL/TLChannelForbidden.cs +++ b/src/TgSharp.TL/TL/TLChannelForbidden.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-2059962289)] + [TLObject(681420594)] public class TLChannelForbidden : TLAbsChat { public override int Constructor { get { - return -2059962289; + return 681420594; } } @@ -24,14 +26,11 @@ namespace TeleSharp.TL public int Id { get; set; } public long AccessHash { get; set; } public string Title { get; set; } - + public int? UntilDate { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Broadcast ? (Flags | 32) : (Flags & ~32); - Flags = Megagroup ? (Flags | 256) : (Flags & ~256); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,20 +41,22 @@ namespace TeleSharp.TL Id = br.ReadInt32(); AccessHash = br.ReadInt64(); Title = StringUtil.Deserialize(br); + if ((Flags & 65536) != 0) + UntilDate = br.ReadInt32(); + else + UntilDate = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(Id); bw.Write(AccessHash); StringUtil.Serialize(Title, bw); - + if ((Flags & 65536) != 0) + bw.Write(UntilDate.Value); } } } diff --git a/src/TeleSharp.TL/TL/TLChannelFull.cs b/src/TgSharp.TL/TL/TLChannelFull.cs similarity index 52% rename from src/TeleSharp.TL/TL/TLChannelFull.cs rename to src/TgSharp.TL/TL/TLChannelFull.cs index 319eed0..956f765 100644 --- a/src/TeleSharp.TL/TL/TLChannelFull.cs +++ b/src/TgSharp.TL/TL/TLChannelFull.cs @@ -4,52 +4,59 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1009430225)] + [TLObject(763976820)] public class TLChannelFull : TLAbsChatFull { public override int Constructor { get { - return -1009430225; + return 763976820; } } public int Flags { get; set; } public bool CanViewParticipants { get; set; } public bool CanSetUsername { get; set; } + public bool CanSetStickers { get; set; } + public bool HiddenPrehistory { get; set; } + public bool CanViewStats { get; set; } + public bool CanSetLocation { get; set; } + public bool HasScheduled { get; set; } public int Id { get; set; } public string About { get; set; } public int? ParticipantsCount { get; set; } public int? AdminsCount { get; set; } public int? KickedCount { get; set; } + public int? BannedCount { get; set; } + public int? OnlineCount { get; set; } public int ReadInboxMaxId { get; set; } public int ReadOutboxMaxId { get; set; } public int UnreadCount { get; set; } public TLAbsPhoto ChatPhoto { get; set; } - public TLAbsPeerNotifySettings NotifySettings { get; set; } + public TLPeerNotifySettings NotifySettings { get; set; } public TLAbsExportedChatInvite ExportedInvite { get; set; } public TLVector BotInfo { get; set; } public int? MigratedFromChatId { get; set; } public int? MigratedFromMaxId { get; set; } public int? PinnedMsgId { get; set; } - + public TLStickerSet Stickerset { get; set; } + public int? AvailableMinId { get; set; } + public int? FolderId { get; set; } + public int? LinkedChatId { get; set; } + public TLAbsChannelLocation Location { get; set; } + public int? SlowmodeSeconds { get; set; } + public int? SlowmodeNextSendDate { get; set; } + public int Pts { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = CanViewParticipants ? (Flags | 8) : (Flags & ~8); - Flags = CanSetUsername ? (Flags | 64) : (Flags & ~64); - Flags = ParticipantsCount != null ? (Flags | 1) : (Flags & ~1); - Flags = AdminsCount != null ? (Flags | 2) : (Flags & ~2); - Flags = KickedCount != null ? (Flags | 4) : (Flags & ~4); - Flags = MigratedFromChatId != null ? (Flags | 16) : (Flags & ~16); - Flags = MigratedFromMaxId != null ? (Flags | 16) : (Flags & ~16); - Flags = PinnedMsgId != null ? (Flags | 32) : (Flags & ~32); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -57,6 +64,11 @@ namespace TeleSharp.TL Flags = br.ReadInt32(); CanViewParticipants = (Flags & 8) != 0; CanSetUsername = (Flags & 64) != 0; + CanSetStickers = (Flags & 128) != 0; + HiddenPrehistory = (Flags & 1024) != 0; + CanViewStats = (Flags & 4096) != 0; + CanSetLocation = (Flags & 65536) != 0; + HasScheduled = (Flags & 524288) != 0; Id = br.ReadInt32(); About = StringUtil.Deserialize(br); if ((Flags & 1) != 0) @@ -74,11 +86,21 @@ namespace TeleSharp.TL else KickedCount = null; + if ((Flags & 4) != 0) + BannedCount = br.ReadInt32(); + else + BannedCount = null; + + if ((Flags & 8192) != 0) + OnlineCount = br.ReadInt32(); + else + OnlineCount = null; + ReadInboxMaxId = br.ReadInt32(); ReadOutboxMaxId = br.ReadInt32(); UnreadCount = br.ReadInt32(); ChatPhoto = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); - NotifySettings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); + NotifySettings = (TLPeerNotifySettings)ObjectUtils.DeserializeObject(br); ExportedInvite = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); BotInfo = (TLVector)ObjectUtils.DeserializeVector(br); if ((Flags & 16) != 0) @@ -96,16 +118,48 @@ namespace TeleSharp.TL else PinnedMsgId = null; + if ((Flags & 256) != 0) + Stickerset = (TLStickerSet)ObjectUtils.DeserializeObject(br); + else + Stickerset = null; + if ((Flags & 512) != 0) + AvailableMinId = br.ReadInt32(); + else + AvailableMinId = null; + + if ((Flags & 2048) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + + if ((Flags & 16384) != 0) + LinkedChatId = br.ReadInt32(); + else + LinkedChatId = null; + + if ((Flags & 32768) != 0) + Location = (TLAbsChannelLocation)ObjectUtils.DeserializeObject(br); + else + Location = null; + + if ((Flags & 131072) != 0) + SlowmodeSeconds = br.ReadInt32(); + else + SlowmodeSeconds = null; + + if ((Flags & 262144) != 0) + SlowmodeNextSendDate = br.ReadInt32(); + else + SlowmodeNextSendDate = null; + + Pts = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(Id); StringUtil.Serialize(About, bw); if ((Flags & 1) != 0) @@ -114,6 +168,10 @@ namespace TeleSharp.TL bw.Write(AdminsCount.Value); if ((Flags & 4) != 0) bw.Write(KickedCount.Value); + if ((Flags & 4) != 0) + bw.Write(BannedCount.Value); + if ((Flags & 8192) != 0) + bw.Write(OnlineCount.Value); bw.Write(ReadInboxMaxId); bw.Write(ReadOutboxMaxId); bw.Write(UnreadCount); @@ -127,7 +185,21 @@ namespace TeleSharp.TL bw.Write(MigratedFromMaxId.Value); if ((Flags & 32) != 0) bw.Write(PinnedMsgId.Value); - + if ((Flags & 256) != 0) + ObjectUtils.SerializeObject(Stickerset, bw); + if ((Flags & 512) != 0) + bw.Write(AvailableMinId.Value); + if ((Flags & 2048) != 0) + bw.Write(FolderId.Value); + if ((Flags & 16384) != 0) + bw.Write(LinkedChatId.Value); + if ((Flags & 32768) != 0) + ObjectUtils.SerializeObject(Location, bw); + if ((Flags & 131072) != 0) + bw.Write(SlowmodeSeconds.Value); + if ((Flags & 262144) != 0) + bw.Write(SlowmodeNextSendDate.Value); + bw.Write(Pts); } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaDocument.cs b/src/TgSharp.TL/TL/TLChannelLocation.cs similarity index 51% rename from src/TeleSharp.TL/TL/TLMessageMediaDocument.cs rename to src/TgSharp.TL/TL/TLChannelLocation.cs index 80ba11a..4ff7903 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaDocument.cs +++ b/src/TgSharp.TL/TL/TLChannelLocation.cs @@ -4,42 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-203411800)] - public class TLMessageMediaDocument : TLAbsMessageMedia + [TLObject(547062491)] + public class TLChannelLocation : TLAbsChannelLocation { public override int Constructor { get { - return -203411800; + return 547062491; } } - public TLAbsDocument Document { get; set; } - public string Caption { get; set; } - + public TLAbsGeoPoint GeoPoint { get; set; } + public string Address { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - Caption = StringUtil.Deserialize(br); - + GeoPoint = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); + Address = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ObjectUtils.SerializeObject(Document, bw); - StringUtil.Serialize(Caption, bw); - + ObjectUtils.SerializeObject(GeoPoint, bw); + StringUtil.Serialize(Address, bw); } } } diff --git a/src/TgSharp.TL/TL/TLChannelLocationEmpty.cs b/src/TgSharp.TL/TL/TLChannelLocationEmpty.cs new file mode 100644 index 0000000..ffd1b71 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelLocationEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1078612597)] + public class TLChannelLocationEmpty : TLAbsChannelLocation + { + public override int Constructor + { + get + { + return -1078612597; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelMessagesFilter.cs b/src/TgSharp.TL/TL/TLChannelMessagesFilter.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLChannelMessagesFilter.cs rename to src/TgSharp.TL/TL/TLChannelMessagesFilter.cs index c07bc3a..f745dca 100644 --- a/src/TeleSharp.TL/TL/TLChannelMessagesFilter.cs +++ b/src/TgSharp.TL/TL/TLChannelMessagesFilter.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-847783593)] public class TLChannelMessagesFilter : TLAbsChannelMessagesFilter @@ -22,12 +24,9 @@ namespace TeleSharp.TL public bool ExcludeNewMessages { get; set; } public TLVector Ranges { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ExcludeNewMessages ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,17 +34,13 @@ namespace TeleSharp.TL Flags = br.ReadInt32(); ExcludeNewMessages = (Flags & 2) != 0; Ranges = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Ranges, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs b/src/TgSharp.TL/TL/TLChannelMessagesFilterEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs rename to src/TgSharp.TL/TL/TLChannelMessagesFilterEmpty.cs index 597e651..f06fb73 100644 --- a/src/TeleSharp.TL/TL/TLChannelMessagesFilterEmpty.cs +++ b/src/TgSharp.TL/TL/TLChannelMessagesFilterEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1798033689)] public class TLChannelMessagesFilterEmpty : TLAbsChannelMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLChannelParticipant.cs b/src/TgSharp.TL/TL/TLChannelParticipant.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLChannelParticipant.cs rename to src/TgSharp.TL/TL/TLChannelParticipant.cs index 2e47d62..a16a1e9 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipant.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipant.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(367766557)] public class TLChannelParticipant : TLAbsChannelParticipant @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); bw.Write(Date); - } } } diff --git a/src/TgSharp.TL/TL/TLChannelParticipantAdmin.cs b/src/TgSharp.TL/TL/TLChannelParticipantAdmin.cs new file mode 100644 index 0000000..cc8000b --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelParticipantAdmin.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-859915345)] + public class TLChannelParticipantAdmin : TLAbsChannelParticipant + { + public override int Constructor + { + get + { + return -859915345; + } + } + + public int Flags { get; set; } + public bool CanEdit { get; set; } + public bool Self { get; set; } + public int UserId { get; set; } + public int? InviterId { get; set; } + public int PromotedBy { get; set; } + public int Date { get; set; } + public TLChatAdminRights AdminRights { get; set; } + public string Rank { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + CanEdit = (Flags & 1) != 0; + Self = (Flags & 2) != 0; + UserId = br.ReadInt32(); + if ((Flags & 2) != 0) + InviterId = br.ReadInt32(); + else + InviterId = null; + + PromotedBy = br.ReadInt32(); + Date = br.ReadInt32(); + AdminRights = (TLChatAdminRights)ObjectUtils.DeserializeObject(br); + if ((Flags & 4) != 0) + Rank = StringUtil.Deserialize(br); + else + Rank = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(UserId); + if ((Flags & 2) != 0) + bw.Write(InviterId.Value); + bw.Write(PromotedBy); + bw.Write(Date); + ObjectUtils.SerializeObject(AdminRights, bw); + if ((Flags & 4) != 0) + StringUtil.Serialize(Rank, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantModerator.cs b/src/TgSharp.TL/TL/TLChannelParticipantBanned.cs similarity index 51% rename from src/TeleSharp.TL/TL/TLChannelParticipantModerator.cs rename to src/TgSharp.TL/TL/TLChannelParticipantBanned.cs index 61b4dfc..627ae00 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantModerator.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipantBanned.cs @@ -4,45 +4,52 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1861910545)] - public class TLChannelParticipantModerator : TLAbsChannelParticipant + [TLObject(470789295)] + public class TLChannelParticipantBanned : TLAbsChannelParticipant { public override int Constructor { get { - return -1861910545; + return 470789295; } } + public int Flags { get; set; } + public bool Left { get; set; } public int UserId { get; set; } - public int InviterId { get; set; } + public int KickedBy { get; set; } public int Date { get; set; } - + public TLChatBannedRights BannedRights { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Left = (Flags & 1) != 0; UserId = br.ReadInt32(); - InviterId = br.ReadInt32(); + KickedBy = br.ReadInt32(); Date = br.ReadInt32(); - + BannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(UserId); - bw.Write(InviterId); + bw.Write(KickedBy); bw.Write(Date); - + ObjectUtils.SerializeObject(BannedRights, bw); } } } diff --git a/src/TgSharp.TL/TL/TLChannelParticipantCreator.cs b/src/TgSharp.TL/TL/TLChannelParticipantCreator.cs new file mode 100644 index 0000000..73057aa --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelParticipantCreator.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2138237532)] + public class TLChannelParticipantCreator : TLAbsChannelParticipant + { + public override int Constructor + { + get + { + return -2138237532; + } + } + + public int Flags { get; set; } + public int UserId { get; set; } + public string Rank { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + UserId = br.ReadInt32(); + if ((Flags & 1) != 0) + Rank = StringUtil.Deserialize(br); + else + Rank = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(UserId); + if ((Flags & 1) != 0) + StringUtil.Serialize(Rank, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantSelf.cs b/src/TgSharp.TL/TL/TLChannelParticipantSelf.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLChannelParticipantSelf.cs rename to src/TgSharp.TL/TL/TLChannelParticipantSelf.cs index 538c99e..0f786e3 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantSelf.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipantSelf.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1557620115)] public class TLChannelParticipantSelf : TLAbsChannelParticipant @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int InviterId { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL UserId = br.ReadInt32(); InviterId = br.ReadInt32(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(UserId); bw.Write(InviterId); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs b/src/TgSharp.TL/TL/TLChannelParticipantsAdmins.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs rename to src/TgSharp.TL/TL/TLChannelParticipantsAdmins.cs index b880c87..4002c48 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantsAdmins.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipantsAdmins.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1268741783)] public class TLChannelParticipantsAdmins : TLAbsChannelParticipantsFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLChannelParticipantsBanned.cs b/src/TgSharp.TL/TL/TLChannelParticipantsBanned.cs new file mode 100644 index 0000000..ebb192d --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelParticipantsBanned.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(338142689)] + public class TLChannelParticipantsBanned : TLAbsChannelParticipantsFilter + { + public override int Constructor + { + get + { + return 338142689; + } + } + + public string Q { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Q = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Q, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantsBots.cs b/src/TgSharp.TL/TL/TLChannelParticipantsBots.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLChannelParticipantsBots.cs rename to src/TgSharp.TL/TL/TLChannelParticipantsBots.cs index 48b3bad..0f3c25d 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantsBots.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipantsBots.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1328445861)] public class TLChannelParticipantsBots : TLAbsChannelParticipantsFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLChannelParticipantsContacts.cs b/src/TgSharp.TL/TL/TLChannelParticipantsContacts.cs new file mode 100644 index 0000000..73c6fb7 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelParticipantsContacts.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1150621555)] + public class TLChannelParticipantsContacts : TLAbsChannelParticipantsFilter + { + public override int Constructor + { + get + { + return -1150621555; + } + } + + public string Q { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Q = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Q, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs b/src/TgSharp.TL/TL/TLChannelParticipantsKicked.cs similarity index 70% rename from src/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs rename to src/TgSharp.TL/TL/TLChannelParticipantsKicked.cs index 5aa217d..b66916f 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantsKicked.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipantsKicked.cs @@ -4,36 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1010285434)] + [TLObject(-1548400251)] public class TLChannelParticipantsKicked : TLAbsChannelParticipantsFilter { public override int Constructor { get { - return 1010285434; + return -1548400251; } } - + public string Q { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + Q = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + StringUtil.Serialize(Q, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs b/src/TgSharp.TL/TL/TLChannelParticipantsRecent.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs rename to src/TgSharp.TL/TL/TLChannelParticipantsRecent.cs index ed6b15f..1d715fd 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantsRecent.cs +++ b/src/TgSharp.TL/TL/TLChannelParticipantsRecent.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-566281095)] public class TLChannelParticipantsRecent : TLAbsChannelParticipantsFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLChannelParticipantsSearch.cs b/src/TgSharp.TL/TL/TLChannelParticipantsSearch.cs new file mode 100644 index 0000000..5a77377 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChannelParticipantsSearch.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(106343499)] + public class TLChannelParticipantsSearch : TLAbsChannelParticipantsFilter + { + public override int Constructor + { + get + { + return 106343499; + } + } + + public string Q { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Q = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Q, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChat.cs b/src/TgSharp.TL/TL/TLChat.cs similarity index 71% rename from src/TeleSharp.TL/TL/TLChat.cs rename to src/TgSharp.TL/TL/TLChat.cs index 1280a83..5983fb0 100644 --- a/src/TeleSharp.TL/TL/TLChat.cs +++ b/src/TgSharp.TL/TL/TLChat.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-652419756)] + [TLObject(1004149726)] public class TLChat : TLAbsChat { public override int Constructor { get { - return -652419756; + return 1004149726; } } @@ -22,8 +24,6 @@ namespace TeleSharp.TL public bool Creator { get; set; } public bool Kicked { get; set; } public bool Left { get; set; } - public bool AdminsEnabled { get; set; } - public bool Admin { get; set; } public bool Deactivated { get; set; } public int Id { get; set; } public string Title { get; set; } @@ -32,19 +32,12 @@ namespace TeleSharp.TL public int Date { get; set; } public int Version { get; set; } public TLAbsInputChannel MigratedTo { get; set; } - + public TLChatAdminRights AdminRights { get; set; } + public TLChatBannedRights DefaultBannedRights { 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 = AdminsEnabled ? (Flags | 8) : (Flags & ~8); - Flags = Admin ? (Flags | 16) : (Flags & ~16); - Flags = Deactivated ? (Flags | 32) : (Flags & ~32); - Flags = MigratedTo != null ? (Flags | 64) : (Flags & ~64); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -53,8 +46,6 @@ namespace TeleSharp.TL Creator = (Flags & 1) != 0; Kicked = (Flags & 2) != 0; Left = (Flags & 4) != 0; - AdminsEnabled = (Flags & 8) != 0; - Admin = (Flags & 16) != 0; Deactivated = (Flags & 32) != 0; Id = br.ReadInt32(); Title = StringUtil.Deserialize(br); @@ -67,20 +58,22 @@ namespace TeleSharp.TL else MigratedTo = null; + if ((Flags & 16384) != 0) + AdminRights = (TLChatAdminRights)ObjectUtils.DeserializeObject(br); + else + AdminRights = null; + + if ((Flags & 262144) != 0) + DefaultBannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + else + DefaultBannedRights = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - - - bw.Write(Id); StringUtil.Serialize(Title, bw); ObjectUtils.SerializeObject(Photo, bw); @@ -89,7 +82,10 @@ namespace TeleSharp.TL bw.Write(Version); if ((Flags & 64) != 0) ObjectUtils.SerializeObject(MigratedTo, bw); - + if ((Flags & 16384) != 0) + ObjectUtils.SerializeObject(AdminRights, bw); + if ((Flags & 262144) != 0) + ObjectUtils.SerializeObject(DefaultBannedRights, bw); } } } diff --git a/src/TgSharp.TL/TL/TLChatAdminRights.cs b/src/TgSharp.TL/TL/TLChatAdminRights.cs new file mode 100644 index 0000000..a91b312 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChatAdminRights.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1605510357)] + public class TLChatAdminRights : TLObject + { + public override int Constructor + { + get + { + return 1605510357; + } + } + + public int Flags { get; set; } + public bool ChangeInfo { get; set; } + public bool PostMessages { get; set; } + public bool EditMessages { get; set; } + public bool DeleteMessages { get; set; } + public bool BanUsers { get; set; } + public bool InviteUsers { get; set; } + public bool PinMessages { get; set; } + public bool AddAdmins { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + ChangeInfo = (Flags & 1) != 0; + PostMessages = (Flags & 2) != 0; + EditMessages = (Flags & 4) != 0; + DeleteMessages = (Flags & 8) != 0; + BanUsers = (Flags & 16) != 0; + InviteUsers = (Flags & 32) != 0; + PinMessages = (Flags & 128) != 0; + AddAdmins = (Flags & 512) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + } +} diff --git a/src/TgSharp.TL/TL/TLChatBannedRights.cs b/src/TgSharp.TL/TL/TLChatBannedRights.cs new file mode 100644 index 0000000..b98e737 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChatBannedRights.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1626209256)] + public class TLChatBannedRights : TLObject + { + public override int Constructor + { + get + { + return -1626209256; + } + } + + public int Flags { get; set; } + public bool ViewMessages { get; set; } + public bool SendMessages { get; set; } + public bool SendMedia { get; set; } + public bool SendStickers { get; set; } + public bool SendGifs { get; set; } + public bool SendGames { get; set; } + public bool SendInline { get; set; } + public bool EmbedLinks { get; set; } + public bool SendPolls { get; set; } + public bool ChangeInfo { get; set; } + public bool InviteUsers { get; set; } + public bool PinMessages { get; set; } + public int UntilDate { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + ViewMessages = (Flags & 1) != 0; + SendMessages = (Flags & 2) != 0; + SendMedia = (Flags & 4) != 0; + SendStickers = (Flags & 8) != 0; + SendGifs = (Flags & 16) != 0; + SendGames = (Flags & 32) != 0; + SendInline = (Flags & 64) != 0; + EmbedLinks = (Flags & 128) != 0; + SendPolls = (Flags & 256) != 0; + ChangeInfo = (Flags & 1024) != 0; + InviteUsers = (Flags & 32768) != 0; + PinMessages = (Flags & 131072) != 0; + UntilDate = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(UntilDate); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChatEmpty.cs b/src/TgSharp.TL/TL/TLChatEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLChatEmpty.cs rename to src/TgSharp.TL/TL/TLChatEmpty.cs index 03229a0..28a8a40 100644 --- a/src/TeleSharp.TL/TL/TLChatEmpty.cs +++ b/src/TgSharp.TL/TL/TLChatEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1683826688)] public class TLChatEmpty : TLAbsChat @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatForbidden.cs b/src/TgSharp.TL/TL/TLChatForbidden.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLChatForbidden.cs rename to src/TgSharp.TL/TL/TLChatForbidden.cs index de78bc9..447406f 100644 --- a/src/TeleSharp.TL/TL/TLChatForbidden.cs +++ b/src/TgSharp.TL/TL/TLChatForbidden.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(120753115)] public class TLChatForbidden : TLAbsChat @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Id { get; set; } public string Title { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); StringUtil.Serialize(Title, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLChatFull.cs b/src/TgSharp.TL/TL/TLChatFull.cs new file mode 100644 index 0000000..621511c --- /dev/null +++ b/src/TgSharp.TL/TL/TLChatFull.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(461151667)] + public class TLChatFull : TLAbsChatFull + { + public override int Constructor + { + get + { + return 461151667; + } + } + + public int Flags { get; set; } + public bool CanSetUsername { get; set; } + public bool HasScheduled { get; set; } + public int Id { get; set; } + public string About { get; set; } + public TLAbsChatParticipants Participants { get; set; } + public TLAbsPhoto ChatPhoto { get; set; } + public TLPeerNotifySettings NotifySettings { get; set; } + public TLAbsExportedChatInvite ExportedInvite { get; set; } + public TLVector BotInfo { get; set; } + public int? PinnedMsgId { get; set; } + public int? FolderId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + CanSetUsername = (Flags & 128) != 0; + HasScheduled = (Flags & 256) != 0; + Id = br.ReadInt32(); + About = StringUtil.Deserialize(br); + Participants = (TLAbsChatParticipants)ObjectUtils.DeserializeObject(br); + if ((Flags & 4) != 0) + ChatPhoto = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); + else + ChatPhoto = null; + + NotifySettings = (TLPeerNotifySettings)ObjectUtils.DeserializeObject(br); + ExportedInvite = (TLAbsExportedChatInvite)ObjectUtils.DeserializeObject(br); + if ((Flags & 8) != 0) + BotInfo = (TLVector)ObjectUtils.DeserializeVector(br); + else + BotInfo = null; + + if ((Flags & 64) != 0) + PinnedMsgId = br.ReadInt32(); + else + PinnedMsgId = null; + + if ((Flags & 2048) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(Id); + StringUtil.Serialize(About, bw); + ObjectUtils.SerializeObject(Participants, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(ChatPhoto, bw); + ObjectUtils.SerializeObject(NotifySettings, bw); + ObjectUtils.SerializeObject(ExportedInvite, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(BotInfo, bw); + if ((Flags & 64) != 0) + bw.Write(PinnedMsgId.Value); + if ((Flags & 2048) != 0) + bw.Write(FolderId.Value); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChatInvite.cs b/src/TgSharp.TL/TL/TLChatInvite.cs similarity index 73% rename from src/TeleSharp.TL/TL/TLChatInvite.cs rename to src/TgSharp.TL/TL/TLChatInvite.cs index b36a4ce..d2c7cf3 100644 --- a/src/TeleSharp.TL/TL/TLChatInvite.cs +++ b/src/TgSharp.TL/TL/TLChatInvite.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-613092008)] + [TLObject(-540871282)] public class TLChatInvite : TLAbsChatInvite { public override int Constructor { get { - return -613092008; + return -540871282; } } @@ -24,20 +26,13 @@ namespace TeleSharp.TL public bool Public { get; set; } public bool Megagroup { get; set; } public string Title { get; set; } - public TLAbsChatPhoto Photo { get; set; } + public TLAbsPhoto Photo { get; set; } public int ParticipantsCount { 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -48,31 +43,24 @@ namespace TeleSharp.TL Public = (Flags & 4) != 0; Megagroup = (Flags & 8) != 0; Title = StringUtil.Deserialize(br); - Photo = (TLAbsChatPhoto)ObjectUtils.DeserializeObject(br); + Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); ParticipantsCount = br.ReadInt32(); if ((Flags & 16) != 0) Participants = (TLVector)ObjectUtils.DeserializeVector(br); else Participants = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - StringUtil.Serialize(Title, bw); ObjectUtils.SerializeObject(Photo, bw); bw.Write(ParticipantsCount); if ((Flags & 16) != 0) ObjectUtils.SerializeObject(Participants, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatInviteAlready.cs b/src/TgSharp.TL/TL/TLChatInviteAlready.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLChatInviteAlready.cs rename to src/TgSharp.TL/TL/TLChatInviteAlready.cs index 5616d10..838d432 100644 --- a/src/TeleSharp.TL/TL/TLChatInviteAlready.cs +++ b/src/TgSharp.TL/TL/TLChatInviteAlready.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1516793212)] public class TLChatInviteAlready : TLAbsChatInvite @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsChat Chat { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Chat = (TLAbsChat)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Chat, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatInviteEmpty.cs b/src/TgSharp.TL/TL/TLChatInviteEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLChatInviteEmpty.cs rename to src/TgSharp.TL/TL/TLChatInviteEmpty.cs index 34b59f0..d282628 100644 --- a/src/TeleSharp.TL/TL/TLChatInviteEmpty.cs +++ b/src/TgSharp.TL/TL/TLChatInviteEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1776236393)] public class TLChatInviteEmpty : TLAbsExportedChatInvite @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLChatInviteExported.cs b/src/TgSharp.TL/TL/TLChatInviteExported.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLChatInviteExported.cs rename to src/TgSharp.TL/TL/TLChatInviteExported.cs index 051a3e7..a8450b7 100644 --- a/src/TeleSharp.TL/TL/TLChatInviteExported.cs +++ b/src/TgSharp.TL/TL/TLChatInviteExported.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-64092740)] public class TLChatInviteExported : TLAbsExportedChatInvite @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Link { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Link = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Link, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLChatOnlines.cs b/src/TgSharp.TL/TL/TLChatOnlines.cs new file mode 100644 index 0000000..0041f90 --- /dev/null +++ b/src/TgSharp.TL/TL/TLChatOnlines.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-264117680)] + public class TLChatOnlines : TLObject + { + public override int Constructor + { + get + { + return -264117680; + } + } + + public int Onlines { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Onlines = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Onlines); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChatParticipant.cs b/src/TgSharp.TL/TL/TLChatParticipant.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLChatParticipant.cs rename to src/TgSharp.TL/TL/TLChatParticipant.cs index b875628..7f82ce5 100644 --- a/src/TeleSharp.TL/TL/TLChatParticipant.cs +++ b/src/TgSharp.TL/TL/TLChatParticipant.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-925415106)] public class TLChatParticipant : TLAbsChatParticipant @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int InviterId { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL UserId = br.ReadInt32(); InviterId = br.ReadInt32(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(UserId); bw.Write(InviterId); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatParticipantAdmin.cs b/src/TgSharp.TL/TL/TLChatParticipantAdmin.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLChatParticipantAdmin.cs rename to src/TgSharp.TL/TL/TLChatParticipantAdmin.cs index fa8799e..27d93e4 100644 --- a/src/TeleSharp.TL/TL/TLChatParticipantAdmin.cs +++ b/src/TgSharp.TL/TL/TLChatParticipantAdmin.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-489233354)] public class TLChatParticipantAdmin : TLAbsChatParticipant @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int InviterId { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL UserId = br.ReadInt32(); InviterId = br.ReadInt32(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(UserId); bw.Write(InviterId); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatParticipantCreator.cs b/src/TgSharp.TL/TL/TLChatParticipantCreator.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLChatParticipantCreator.cs rename to src/TgSharp.TL/TL/TLChatParticipantCreator.cs index add2362..6fa28b9 100644 --- a/src/TeleSharp.TL/TL/TLChatParticipantCreator.cs +++ b/src/TgSharp.TL/TL/TLChatParticipantCreator.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-636267638)] public class TLChatParticipantCreator : TLAbsChatParticipant @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int UserId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(UserId); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatParticipants.cs b/src/TgSharp.TL/TL/TLChatParticipants.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLChatParticipants.cs rename to src/TgSharp.TL/TL/TLChatParticipants.cs index f59a6b5..f421856 100644 --- a/src/TeleSharp.TL/TL/TLChatParticipants.cs +++ b/src/TgSharp.TL/TL/TLChatParticipants.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1061556205)] public class TLChatParticipants : TLAbsChatParticipants @@ -22,10 +24,9 @@ namespace TeleSharp.TL public TLVector Participants { get; set; } public int Version { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL ChatId = br.ReadInt32(); Participants = (TLVector)ObjectUtils.DeserializeVector(br); Version = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(ChatId); ObjectUtils.SerializeObject(Participants, bw); bw.Write(Version); - } } } diff --git a/src/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs b/src/TgSharp.TL/TL/TLChatParticipantsForbidden.cs similarity index 87% rename from src/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs rename to src/TgSharp.TL/TL/TLChatParticipantsForbidden.cs index 3bf68ec..67d833a 100644 --- a/src/TeleSharp.TL/TL/TLChatParticipantsForbidden.cs +++ b/src/TgSharp.TL/TL/TLChatParticipantsForbidden.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-57668565)] public class TLChatParticipantsForbidden : TLAbsChatParticipants @@ -22,12 +24,9 @@ namespace TeleSharp.TL public int ChatId { get; set; } public TLAbsChatParticipant SelfParticipant { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = SelfParticipant != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,18 +38,15 @@ namespace TeleSharp.TL else SelfParticipant = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(ChatId); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(SelfParticipant, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLChatPhoto.cs b/src/TgSharp.TL/TL/TLChatPhoto.cs new file mode 100644 index 0000000..9d1c0ee --- /dev/null +++ b/src/TgSharp.TL/TL/TLChatPhoto.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1197267925)] + public class TLChatPhoto : TLAbsChatPhoto + { + public override int Constructor + { + get + { + return 1197267925; + } + } + + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoSmall { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoBig { get; set; } + public int DcId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoSmall = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoBig = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); + DcId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PhotoSmall, bw); + ObjectUtils.SerializeObject(PhotoBig, bw); + bw.Write(DcId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChatPhotoEmpty.cs b/src/TgSharp.TL/TL/TLChatPhotoEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLChatPhotoEmpty.cs rename to src/TgSharp.TL/TL/TLChatPhotoEmpty.cs index cea4e99..a54e81f 100644 --- a/src/TeleSharp.TL/TL/TLChatPhotoEmpty.cs +++ b/src/TgSharp.TL/TL/TLChatPhotoEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(935395612)] public class TLChatPhotoEmpty : TLAbsChatPhoto @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLCodeSettings.cs b/src/TgSharp.TL/TL/TLCodeSettings.cs new file mode 100644 index 0000000..59d5b7c --- /dev/null +++ b/src/TgSharp.TL/TL/TLCodeSettings.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-557924733)] + public class TLCodeSettings : TLObject + { + public override int Constructor + { + get + { + return -557924733; + } + } + + public int Flags { get; set; } + public bool AllowFlashcall { get; set; } + public bool CurrentNumber { get; set; } + public bool AllowAppHash { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + AllowFlashcall = (Flags & 1) != 0; + CurrentNumber = (Flags & 2) != 0; + AllowAppHash = (Flags & 16) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLConfig.cs b/src/TgSharp.TL/TL/TLConfig.cs similarity index 50% rename from src/TeleSharp.TL/TL/TLConfig.cs rename to src/TgSharp.TL/TL/TLConfig.cs index 3be05d0..b1dbbed 100644 --- a/src/TeleSharp.TL/TL/TLConfig.cs +++ b/src/TgSharp.TL/TL/TLConfig.cs @@ -4,27 +4,36 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-882895228)] + [TLObject(856375399)] public class TLConfig : TLObject { public override int Constructor { get { - return -882895228; + return 856375399; } } public int Flags { get; set; } public bool PhonecallsEnabled { get; set; } + public bool DefaultP2pContacts { get; set; } + public bool PreloadFeaturedStickers { get; set; } + public bool IgnorePhoneEntities { get; set; } + public bool RevokePmInbox { get; set; } + public bool BlockedMode { get; set; } + public bool PfsEnabled { get; set; } public int Date { get; set; } public int Expires { get; set; } public bool TestMode { get; set; } public int ThisDc { get; set; } public TLVector DcOptions { get; set; } + public string DcTxtDomainName { get; set; } public int ChatSizeMax { get; set; } public int MegagroupSizeMax { get; set; } public int ForwardedCountMax { get; set; } @@ -34,40 +43,57 @@ namespace TeleSharp.TL public int OnlineCloudTimeoutMs { get; set; } public int NotifyCloudDelayMs { get; set; } public int NotifyDefaultDelayMs { get; set; } - public int ChatBigSize { get; set; } public int PushChatPeriodMs { get; set; } public int PushChatLimit { get; set; } public int SavedGifsLimit { get; set; } public int EditTimeLimit { get; set; } + public int RevokeTimeLimit { get; set; } + public int RevokePmTimeLimit { get; set; } public int RatingEDecay { get; set; } public int StickersRecentLimit { get; set; } + public int StickersFavedLimit { get; set; } + public int ChannelsReadMediaPeriod { get; set; } public int? TmpSessions { get; set; } public int PinnedDialogsCountMax { get; set; } + public int PinnedInfolderCountMax { get; set; } public int CallReceiveTimeoutMs { get; set; } public int CallRingTimeoutMs { get; set; } public int CallConnectTimeoutMs { get; set; } public int CallPacketTimeoutMs { get; set; } public string MeUrlPrefix { get; set; } - public TLVector DisabledFeatures { get; set; } - + public string AutoupdateUrlPrefix { get; set; } + public string GifSearchUsername { get; set; } + public string VenueSearchUsername { get; set; } + public string ImgSearchUsername { get; set; } + public string StaticMapsProvider { get; set; } + public int CaptionLengthMax { get; set; } + public int MessageLengthMax { get; set; } + public int WebfileDcId { get; set; } + public string SuggestedLangCode { get; set; } + public int? LangPackVersion { get; set; } + public int? BaseLangPackVersion { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = PhonecallsEnabled ? (Flags | 2) : (Flags & ~2); - Flags = TmpSessions != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); PhonecallsEnabled = (Flags & 2) != 0; + DefaultP2pContacts = (Flags & 8) != 0; + PreloadFeaturedStickers = (Flags & 16) != 0; + IgnorePhoneEntities = (Flags & 32) != 0; + RevokePmInbox = (Flags & 64) != 0; + BlockedMode = (Flags & 256) != 0; + PfsEnabled = (Flags & 8192) != 0; Date = br.ReadInt32(); Expires = br.ReadInt32(); TestMode = BoolUtil.Deserialize(br); ThisDc = br.ReadInt32(); DcOptions = (TLVector)ObjectUtils.DeserializeVector(br); + DcTxtDomainName = StringUtil.Deserialize(br); ChatSizeMax = br.ReadInt32(); MegagroupSizeMax = br.ReadInt32(); ForwardedCountMax = br.ReadInt32(); @@ -77,39 +103,83 @@ namespace TeleSharp.TL OnlineCloudTimeoutMs = br.ReadInt32(); NotifyCloudDelayMs = br.ReadInt32(); NotifyDefaultDelayMs = br.ReadInt32(); - ChatBigSize = br.ReadInt32(); PushChatPeriodMs = br.ReadInt32(); PushChatLimit = br.ReadInt32(); SavedGifsLimit = br.ReadInt32(); EditTimeLimit = br.ReadInt32(); + RevokeTimeLimit = br.ReadInt32(); + RevokePmTimeLimit = br.ReadInt32(); RatingEDecay = br.ReadInt32(); StickersRecentLimit = br.ReadInt32(); + StickersFavedLimit = br.ReadInt32(); + ChannelsReadMediaPeriod = br.ReadInt32(); if ((Flags & 1) != 0) TmpSessions = br.ReadInt32(); else TmpSessions = null; PinnedDialogsCountMax = br.ReadInt32(); + PinnedInfolderCountMax = br.ReadInt32(); CallReceiveTimeoutMs = br.ReadInt32(); CallRingTimeoutMs = br.ReadInt32(); CallConnectTimeoutMs = br.ReadInt32(); CallPacketTimeoutMs = br.ReadInt32(); MeUrlPrefix = StringUtil.Deserialize(br); - DisabledFeatures = (TLVector)ObjectUtils.DeserializeVector(br); + if ((Flags & 128) != 0) + AutoupdateUrlPrefix = StringUtil.Deserialize(br); + else + AutoupdateUrlPrefix = null; + + if ((Flags & 512) != 0) + GifSearchUsername = StringUtil.Deserialize(br); + else + GifSearchUsername = null; + + if ((Flags & 1024) != 0) + VenueSearchUsername = StringUtil.Deserialize(br); + else + VenueSearchUsername = null; + + if ((Flags & 2048) != 0) + ImgSearchUsername = StringUtil.Deserialize(br); + else + ImgSearchUsername = null; + + if ((Flags & 4096) != 0) + StaticMapsProvider = StringUtil.Deserialize(br); + else + StaticMapsProvider = null; + + CaptionLengthMax = br.ReadInt32(); + MessageLengthMax = br.ReadInt32(); + WebfileDcId = br.ReadInt32(); + if ((Flags & 4) != 0) + SuggestedLangCode = StringUtil.Deserialize(br); + else + SuggestedLangCode = null; + + if ((Flags & 4) != 0) + LangPackVersion = br.ReadInt32(); + else + LangPackVersion = null; + + if ((Flags & 4) != 0) + BaseLangPackVersion = br.ReadInt32(); + else + BaseLangPackVersion = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Date); bw.Write(Expires); BoolUtil.Serialize(TestMode, bw); bw.Write(ThisDc); ObjectUtils.SerializeObject(DcOptions, bw); + StringUtil.Serialize(DcTxtDomainName, bw); bw.Write(ChatSizeMax); bw.Write(MegagroupSizeMax); bw.Write(ForwardedCountMax); @@ -119,23 +189,44 @@ namespace TeleSharp.TL bw.Write(OnlineCloudTimeoutMs); bw.Write(NotifyCloudDelayMs); bw.Write(NotifyDefaultDelayMs); - bw.Write(ChatBigSize); bw.Write(PushChatPeriodMs); bw.Write(PushChatLimit); bw.Write(SavedGifsLimit); bw.Write(EditTimeLimit); + bw.Write(RevokeTimeLimit); + bw.Write(RevokePmTimeLimit); bw.Write(RatingEDecay); bw.Write(StickersRecentLimit); + bw.Write(StickersFavedLimit); + bw.Write(ChannelsReadMediaPeriod); if ((Flags & 1) != 0) bw.Write(TmpSessions.Value); bw.Write(PinnedDialogsCountMax); + bw.Write(PinnedInfolderCountMax); bw.Write(CallReceiveTimeoutMs); bw.Write(CallRingTimeoutMs); bw.Write(CallConnectTimeoutMs); bw.Write(CallPacketTimeoutMs); StringUtil.Serialize(MeUrlPrefix, bw); - ObjectUtils.SerializeObject(DisabledFeatures, bw); - + if ((Flags & 128) != 0) + StringUtil.Serialize(AutoupdateUrlPrefix, bw); + if ((Flags & 512) != 0) + StringUtil.Serialize(GifSearchUsername, bw); + if ((Flags & 1024) != 0) + StringUtil.Serialize(VenueSearchUsername, bw); + if ((Flags & 2048) != 0) + StringUtil.Serialize(ImgSearchUsername, bw); + if ((Flags & 4096) != 0) + StringUtil.Serialize(StaticMapsProvider, bw); + bw.Write(CaptionLengthMax); + bw.Write(MessageLengthMax); + bw.Write(WebfileDcId); + if ((Flags & 4) != 0) + StringUtil.Serialize(SuggestedLangCode, bw); + if ((Flags & 4) != 0) + bw.Write(LangPackVersion.Value); + if ((Flags & 4) != 0) + bw.Write(BaseLangPackVersion.Value); } } } diff --git a/src/TeleSharp.TL/TL/TLContact.cs b/src/TgSharp.TL/TL/TLContact.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLContact.cs rename to src/TgSharp.TL/TL/TLContact.cs index 7d6c78b..8f88295 100644 --- a/src/TeleSharp.TL/TL/TLContact.cs +++ b/src/TgSharp.TL/TL/TLContact.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-116274796)] public class TLContact : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public bool Mutual { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Mutual = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); BoolUtil.Serialize(Mutual, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLContactBlocked.cs b/src/TgSharp.TL/TL/TLContactBlocked.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLContactBlocked.cs rename to src/TgSharp.TL/TL/TLContactBlocked.cs index 016472c..08a7ba9 100644 --- a/src/TeleSharp.TL/TL/TLContactBlocked.cs +++ b/src/TgSharp.TL/TL/TLContactBlocked.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1444661369)] public class TLContactBlocked : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLContactStatus.cs b/src/TgSharp.TL/TL/TLContactStatus.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLContactStatus.cs rename to src/TgSharp.TL/TL/TLContactStatus.cs index 1b5cbf6..0f8996d 100644 --- a/src/TeleSharp.TL/TL/TLContactStatus.cs +++ b/src/TgSharp.TL/TL/TLContactStatus.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-748155807)] public class TLContactStatus : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public TLAbsUserStatus Status { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Status = (TLAbsUserStatus)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); ObjectUtils.SerializeObject(Status, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLDataJSON.cs b/src/TgSharp.TL/TL/TLDataJSON.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLDataJSON.cs rename to src/TgSharp.TL/TL/TLDataJSON.cs index 21ccf37..57d09c2 100644 --- a/src/TeleSharp.TL/TL/TLDataJSON.cs +++ b/src/TgSharp.TL/TL/TLDataJSON.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2104790276)] public class TLDataJSON : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Data { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Data = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Data, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLDcOption.cs b/src/TgSharp.TL/TL/TLDcOption.cs similarity index 73% rename from src/TeleSharp.TL/TL/TLDcOption.cs rename to src/TgSharp.TL/TL/TLDcOption.cs index ebaee23..c1ed32d 100644 --- a/src/TeleSharp.TL/TL/TLDcOption.cs +++ b/src/TgSharp.TL/TL/TLDcOption.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(98092748)] + [TLObject(414687501)] public class TLDcOption : TLObject { public override int Constructor { get { - return 98092748; + return 414687501; } } @@ -23,19 +25,15 @@ namespace TeleSharp.TL public bool MediaOnly { get; set; } public bool TcpoOnly { get; set; } public bool Cdn { get; set; } + public bool Static { get; set; } public int Id { get; set; } public string IpAddress { get; set; } public int Port { get; set; } - + public byte[] Secret { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Ipv6 ? (Flags | 1) : (Flags & ~1); - Flags = MediaOnly ? (Flags | 2) : (Flags & ~2); - Flags = TcpoOnly ? (Flags | 4) : (Flags & ~4); - Flags = Cdn ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -45,25 +43,26 @@ namespace TeleSharp.TL MediaOnly = (Flags & 2) != 0; TcpoOnly = (Flags & 4) != 0; Cdn = (Flags & 8) != 0; + Static = (Flags & 16) != 0; Id = br.ReadInt32(); IpAddress = StringUtil.Deserialize(br); Port = br.ReadInt32(); + if ((Flags & 1024) != 0) + Secret = BytesUtil.Deserialize(br); + else + Secret = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - bw.Write(Id); StringUtil.Serialize(IpAddress, bw); bw.Write(Port); - + if ((Flags & 1024) != 0) + BytesUtil.Serialize(Secret, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLDialog.cs b/src/TgSharp.TL/TL/TLDialog.cs similarity index 71% rename from src/TeleSharp.TL/TL/TLDialog.cs rename to src/TgSharp.TL/TL/TLDialog.cs index 2d8e65c..45e9927 100644 --- a/src/TeleSharp.TL/TL/TLDialog.cs +++ b/src/TgSharp.TL/TL/TLDialog.cs @@ -4,51 +4,53 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1728035348)] - public class TLDialog : TLObject + [TLObject(739712882)] + public class TLDialog : TLAbsDialog { public override int Constructor { get { - return 1728035348; + return 739712882; } } public int Flags { get; set; } public bool Pinned { get; set; } + public bool UnreadMark { get; set; } public TLAbsPeer Peer { get; set; } public int TopMessage { get; set; } public int ReadInboxMaxId { get; set; } public int ReadOutboxMaxId { get; set; } public int UnreadCount { get; set; } - public TLAbsPeerNotifySettings NotifySettings { get; set; } + public int UnreadMentionsCount { get; set; } + public TLPeerNotifySettings NotifySettings { get; set; } public int? Pts { get; set; } public TLAbsDraftMessage Draft { get; set; } - + public int? FolderId { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Pinned ? (Flags | 4) : (Flags & ~4); - Flags = Pts != null ? (Flags | 1) : (Flags & ~1); - Flags = Draft != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Pinned = (Flags & 4) != 0; + UnreadMark = (Flags & 8) != 0; Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); TopMessage = br.ReadInt32(); ReadInboxMaxId = br.ReadInt32(); ReadOutboxMaxId = br.ReadInt32(); UnreadCount = br.ReadInt32(); - NotifySettings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); + UnreadMentionsCount = br.ReadInt32(); + NotifySettings = (TLPeerNotifySettings)ObjectUtils.DeserializeObject(br); if ((Flags & 1) != 0) Pts = br.ReadInt32(); else @@ -59,26 +61,30 @@ namespace TeleSharp.TL else Draft = null; + if ((Flags & 16) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Peer, bw); bw.Write(TopMessage); bw.Write(ReadInboxMaxId); bw.Write(ReadOutboxMaxId); bw.Write(UnreadCount); + bw.Write(UnreadMentionsCount); ObjectUtils.SerializeObject(NotifySettings, bw); if ((Flags & 1) != 0) bw.Write(Pts.Value); if ((Flags & 2) != 0) ObjectUtils.SerializeObject(Draft, bw); - + if ((Flags & 16) != 0) + bw.Write(FolderId.Value); } } } diff --git a/src/TgSharp.TL/TL/TLDialogFolder.cs b/src/TgSharp.TL/TL/TLDialogFolder.cs new file mode 100644 index 0000000..b6de109 --- /dev/null +++ b/src/TgSharp.TL/TL/TLDialogFolder.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1908216652)] + public class TLDialogFolder : TLAbsDialog + { + public override int Constructor + { + get + { + return 1908216652; + } + } + + public int Flags { get; set; } + public bool Pinned { get; set; } + public TLFolder Folder { get; set; } + public TLAbsPeer Peer { get; set; } + public int TopMessage { get; set; } + public int UnreadMutedPeersCount { get; set; } + public int UnreadUnmutedPeersCount { get; set; } + public int UnreadMutedMessagesCount { get; set; } + public int UnreadUnmutedMessagesCount { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Pinned = (Flags & 4) != 0; + Folder = (TLFolder)ObjectUtils.DeserializeObject(br); + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + TopMessage = br.ReadInt32(); + UnreadMutedPeersCount = br.ReadInt32(); + UnreadUnmutedPeersCount = br.ReadInt32(); + UnreadMutedMessagesCount = br.ReadInt32(); + UnreadUnmutedMessagesCount = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Folder, bw); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(TopMessage); + bw.Write(UnreadMutedPeersCount); + bw.Write(UnreadUnmutedPeersCount); + bw.Write(UnreadMutedMessagesCount); + bw.Write(UnreadUnmutedMessagesCount); + } + } +} diff --git a/src/TgSharp.TL/TL/TLDialogPeer.cs b/src/TgSharp.TL/TL/TLDialogPeer.cs new file mode 100644 index 0000000..25a3175 --- /dev/null +++ b/src/TgSharp.TL/TL/TLDialogPeer.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-445792507)] + public class TLDialogPeer : TLAbsDialogPeer + { + public override int Constructor + { + get + { + return -445792507; + } + } + + public TLAbsPeer Peer { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLDialogPeerFolder.cs b/src/TgSharp.TL/TL/TLDialogPeerFolder.cs new file mode 100644 index 0000000..a064dfa --- /dev/null +++ b/src/TgSharp.TL/TL/TLDialogPeerFolder.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1363483106)] + public class TLDialogPeerFolder : TLAbsDialogPeer + { + public override int Constructor + { + get + { + return 1363483106; + } + } + + public int FolderId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + FolderId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(FolderId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLDocument.cs b/src/TgSharp.TL/TL/TLDocument.cs similarity index 66% rename from src/TeleSharp.TL/TL/TLDocument.cs rename to src/TgSharp.TL/TL/TLDocument.cs index 20414eb..7893d43 100644 --- a/src/TeleSharp.TL/TL/TLDocument.cs +++ b/src/TgSharp.TL/TL/TLDocument.cs @@ -4,63 +4,70 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-2027738169)] + [TLObject(-1683841855)] public class TLDocument : TLAbsDocument { public override int Constructor { get { - return -2027738169; + return -1683841855; } } + public int Flags { get; set; } public long Id { get; set; } public long AccessHash { get; set; } + public byte[] FileReference { get; set; } public int Date { get; set; } public string MimeType { get; set; } public int Size { get; set; } - public TLAbsPhotoSize Thumb { get; set; } + public TLVector Thumbs { get; set; } public int DcId { get; set; } - public int Version { get; set; } public TLVector Attributes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); Id = br.ReadInt64(); AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); Date = br.ReadInt32(); MimeType = StringUtil.Deserialize(br); Size = br.ReadInt32(); - Thumb = (TLAbsPhotoSize)ObjectUtils.DeserializeObject(br); - DcId = br.ReadInt32(); - Version = br.ReadInt32(); - Attributes = (TLVector)ObjectUtils.DeserializeVector(br); + if ((Flags & 1) != 0) + Thumbs = (TLVector)ObjectUtils.DeserializeVector(br); + else + Thumbs = null; + DcId = br.ReadInt32(); + Attributes = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(Id); bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); bw.Write(Date); StringUtil.Serialize(MimeType, bw); bw.Write(Size); - ObjectUtils.SerializeObject(Thumb, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Thumbs, bw); bw.Write(DcId); - bw.Write(Version); ObjectUtils.SerializeObject(Attributes, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs b/src/TgSharp.TL/TL/TLDocumentAttributeAnimated.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeAnimated.cs index e090031..ee90c4d 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeAnimated.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeAnimated.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(297109817)] public class TLDocumentAttributeAnimated : TLAbsDocumentAttribute @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs b/src/TgSharp.TL/TL/TLDocumentAttributeAudio.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeAudio.cs index 2241eb2..18f7e5d 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeAudio.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeAudio.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1739392570)] public class TLDocumentAttributeAudio : TLAbsDocumentAttribute @@ -25,15 +27,9 @@ namespace TeleSharp.TL 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -56,15 +52,12 @@ namespace TeleSharp.TL else Waveform = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Duration); if ((Flags & 1) != 0) StringUtil.Serialize(Title, bw); @@ -72,7 +65,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Performer, bw); if ((Flags & 4) != 0) BytesUtil.Serialize(Waveform, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs b/src/TgSharp.TL/TL/TLDocumentAttributeFilename.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeFilename.cs index b6713b6..5fe96eb 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeFilename.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeFilename.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(358154344)] public class TLDocumentAttributeFilename : TLAbsDocumentAttribute @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string FileName { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { FileName = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(FileName, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs b/src/TgSharp.TL/TL/TLDocumentAttributeHasStickers.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeHasStickers.cs index a31049f..ef2723e 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeHasStickers.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeHasStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1744710921)] public class TLDocumentAttributeHasStickers : TLAbsDocumentAttribute @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs b/src/TgSharp.TL/TL/TLDocumentAttributeImageSize.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeImageSize.cs index ffe9ecf..5a9b144 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeImageSize.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeImageSize.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1815593308)] public class TLDocumentAttributeImageSize : TLAbsDocumentAttribute @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int W { get; set; } public int H { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { W = br.ReadInt32(); H = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(W); bw.Write(H); - } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs b/src/TgSharp.TL/TL/TLDocumentAttributeSticker.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeSticker.cs index e0bb9b4..6fa7627 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeSticker.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeSticker.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1662637586)] public class TLDocumentAttributeSticker : TLAbsDocumentAttribute @@ -24,13 +26,9 @@ namespace TeleSharp.TL public TLAbsInputStickerSet Stickerset { get; set; } public TLMaskCoords MaskCoords { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Mask ? (Flags | 2) : (Flags & ~2); - Flags = MaskCoords != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -44,20 +42,16 @@ namespace TeleSharp.TL else MaskCoords = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - StringUtil.Serialize(Alt, bw); ObjectUtils.SerializeObject(Stickerset, bw); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(MaskCoords, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs b/src/TgSharp.TL/TL/TLDocumentAttributeVideo.cs similarity index 87% rename from src/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs rename to src/TgSharp.TL/TL/TLDocumentAttributeVideo.cs index d9333d8..f33a785 100644 --- a/src/TeleSharp.TL/TL/TLDocumentAttributeVideo.cs +++ b/src/TgSharp.TL/TL/TLDocumentAttributeVideo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(250621158)] public class TLDocumentAttributeVideo : TLAbsDocumentAttribute @@ -20,38 +22,33 @@ namespace TeleSharp.TL public int Flags { get; set; } public bool RoundMessage { get; set; } + public bool SupportsStreaming { get; set; } public int Duration { get; set; } public int W { get; set; } public int H { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = RoundMessage ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); RoundMessage = (Flags & 1) != 0; + SupportsStreaming = (Flags & 2) != 0; Duration = br.ReadInt32(); W = br.ReadInt32(); H = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Duration); bw.Write(W); bw.Write(H); - } } } diff --git a/src/TeleSharp.TL/TL/TLDocumentEmpty.cs b/src/TgSharp.TL/TL/TLDocumentEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLDocumentEmpty.cs rename to src/TgSharp.TL/TL/TLDocumentEmpty.cs index 498114b..263855b 100644 --- a/src/TeleSharp.TL/TL/TLDocumentEmpty.cs +++ b/src/TgSharp.TL/TL/TLDocumentEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(922273905)] public class TLDocumentEmpty : TLAbsDocument @@ -20,23 +22,20 @@ namespace TeleSharp.TL public long Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLDraftMessage.cs b/src/TgSharp.TL/TL/TLDraftMessage.cs similarity index 85% rename from src/TeleSharp.TL/TL/TLDraftMessage.cs rename to src/TgSharp.TL/TL/TLDraftMessage.cs index 6331f98..f42703b 100644 --- a/src/TeleSharp.TL/TL/TLDraftMessage.cs +++ b/src/TgSharp.TL/TL/TLDraftMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-40996577)] public class TLDraftMessage : TLAbsDraftMessage @@ -25,14 +27,9 @@ namespace TeleSharp.TL public TLVector Entities { get; set; } public int Date { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 2) : (Flags & ~2); - Flags = ReplyToMsgId != null ? (Flags | 1) : (Flags & ~1); - Flags = Entities != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -51,22 +48,18 @@ namespace TeleSharp.TL Entities = null; Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - if ((Flags & 1) != 0) bw.Write(ReplyToMsgId.Value); StringUtil.Serialize(Message, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(Entities, bw); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLDraftMessageEmpty.cs b/src/TgSharp.TL/TL/TLDraftMessageEmpty.cs similarity index 55% rename from src/TeleSharp.TL/TL/TLDraftMessageEmpty.cs rename to src/TgSharp.TL/TL/TLDraftMessageEmpty.cs index a5d31cf..b576128 100644 --- a/src/TeleSharp.TL/TL/TLDraftMessageEmpty.cs +++ b/src/TgSharp.TL/TL/TLDraftMessageEmpty.cs @@ -4,36 +4,46 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1169445179)] + [TLObject(453805082)] public class TLDraftMessageEmpty : TLAbsDraftMessage { public override int Constructor { get { - return -1169445179; + return 453805082; } } - + public int Flags { get; set; } + public int? Date { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + Date = br.ReadInt32(); + else + Date = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + bw.Write(Flags); + if ((Flags & 1) != 0) + bw.Write(Date.Value); } } } diff --git a/src/TgSharp.TL/TL/TLEmojiKeyword.cs b/src/TgSharp.TL/TL/TLEmojiKeyword.cs new file mode 100644 index 0000000..ccfee74 --- /dev/null +++ b/src/TgSharp.TL/TL/TLEmojiKeyword.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-709641735)] + public class TLEmojiKeyword : TLAbsEmojiKeyword + { + public override int Constructor + { + get + { + return -709641735; + } + } + + public string Keyword { get; set; } + public TLVector Emoticons { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Keyword = StringUtil.Deserialize(br); + Emoticons = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Keyword, bw); + ObjectUtils.SerializeObject(Emoticons, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLEmojiKeywordDeleted.cs b/src/TgSharp.TL/TL/TLEmojiKeywordDeleted.cs new file mode 100644 index 0000000..b69b578 --- /dev/null +++ b/src/TgSharp.TL/TL/TLEmojiKeywordDeleted.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(594408994)] + public class TLEmojiKeywordDeleted : TLAbsEmojiKeyword + { + public override int Constructor + { + get + { + return 594408994; + } + } + + public string Keyword { get; set; } + public TLVector Emoticons { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Keyword = StringUtil.Deserialize(br); + Emoticons = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Keyword, bw); + ObjectUtils.SerializeObject(Emoticons, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLEmojiKeywordsDifference.cs b/src/TgSharp.TL/TL/TLEmojiKeywordsDifference.cs new file mode 100644 index 0000000..cda93ea --- /dev/null +++ b/src/TgSharp.TL/TL/TLEmojiKeywordsDifference.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1556570557)] + public class TLEmojiKeywordsDifference : TLObject + { + public override int Constructor + { + get + { + return 1556570557; + } + } + + public string LangCode { get; set; } + public int FromVersion { get; set; } + public int Version { get; set; } + public TLVector Keywords { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCode = StringUtil.Deserialize(br); + FromVersion = br.ReadInt32(); + Version = br.ReadInt32(); + Keywords = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangCode, bw); + bw.Write(FromVersion); + bw.Write(Version); + ObjectUtils.SerializeObject(Keywords, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs b/src/TgSharp.TL/TL/TLEmojiLanguage.cs similarity index 61% rename from src/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs rename to src/TgSharp.TL/TL/TLEmojiLanguage.cs index 98f33c8..f9030d4 100644 --- a/src/TeleSharp.TL/TL/Auth/TLCheckedPhone.cs +++ b/src/TgSharp.TL/TL/TLEmojiLanguage.cs @@ -4,39 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Auth + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-2128698738)] - public class TLCheckedPhone : TLObject + [TLObject(-1275374751)] + public class TLEmojiLanguage : TLObject { public override int Constructor { get { - return -2128698738; + return -1275374751; } } - public bool PhoneRegistered { get; set; } - + public string LangCode { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - PhoneRegistered = BoolUtil.Deserialize(br); - + LangCode = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BoolUtil.Serialize(PhoneRegistered, bw); - + StringUtil.Serialize(LangCode, bw); } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLPaymentVerficationNeeded.cs b/src/TgSharp.TL/TL/TLEmojiURL.cs similarity index 77% rename from src/TeleSharp.TL/TL/Payments/TLPaymentVerficationNeeded.cs rename to src/TgSharp.TL/TL/TLEmojiURL.cs index 314f0f7..b911472 100644 --- a/src/TeleSharp.TL/TL/Payments/TLPaymentVerficationNeeded.cs +++ b/src/TgSharp.TL/TL/TLEmojiURL.cs @@ -4,39 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Payments + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1800845601)] - public class TLPaymentVerficationNeeded : TLAbsPaymentResult + [TLObject(-1519029347)] + public class TLEmojiURL : TLObject { public override int Constructor { get { - return 1800845601; + return -1519029347; } } public string Url { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Url = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Url, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedChat.cs b/src/TgSharp.TL/TL/TLEncryptedChat.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLEncryptedChat.cs rename to src/TgSharp.TL/TL/TLEncryptedChat.cs index 7e6dd01..3bd3ea2 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedChat.cs +++ b/src/TgSharp.TL/TL/TLEncryptedChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-94974410)] public class TLEncryptedChat : TLAbsEncryptedChat @@ -26,10 +28,9 @@ namespace TeleSharp.TL public byte[] GAOrB { get; set; } public long KeyFingerprint { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,7 +42,6 @@ namespace TeleSharp.TL ParticipantId = br.ReadInt32(); GAOrB = BytesUtil.Deserialize(br); KeyFingerprint = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -54,7 +54,6 @@ namespace TeleSharp.TL bw.Write(ParticipantId); BytesUtil.Serialize(GAOrB, bw); bw.Write(KeyFingerprint); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs b/src/TgSharp.TL/TL/TLEncryptedChatDiscarded.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs rename to src/TgSharp.TL/TL/TLEncryptedChatDiscarded.cs index 4c7fbf1..76a0ac7 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedChatDiscarded.cs +++ b/src/TgSharp.TL/TL/TLEncryptedChatDiscarded.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(332848423)] public class TLEncryptedChatDiscarded : TLAbsEncryptedChat @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs b/src/TgSharp.TL/TL/TLEncryptedChatEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs rename to src/TgSharp.TL/TL/TLEncryptedChatEmpty.cs index 56d2c4b..848be5d 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedChatEmpty.cs +++ b/src/TgSharp.TL/TL/TLEncryptedChatEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1417756512)] public class TLEncryptedChatEmpty : TLAbsEncryptedChat @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedChatRequested.cs b/src/TgSharp.TL/TL/TLEncryptedChatRequested.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLEncryptedChatRequested.cs rename to src/TgSharp.TL/TL/TLEncryptedChatRequested.cs index 2fcd99f..f2270c3 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedChatRequested.cs +++ b/src/TgSharp.TL/TL/TLEncryptedChatRequested.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-931638658)] public class TLEncryptedChatRequested : TLAbsEncryptedChat @@ -25,10 +27,9 @@ namespace TeleSharp.TL public int ParticipantId { get; set; } public byte[] GA { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,7 +40,6 @@ namespace TeleSharp.TL AdminId = br.ReadInt32(); ParticipantId = br.ReadInt32(); GA = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -51,7 +51,6 @@ namespace TeleSharp.TL bw.Write(AdminId); bw.Write(ParticipantId); BytesUtil.Serialize(GA, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs b/src/TgSharp.TL/TL/TLEncryptedChatWaiting.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs rename to src/TgSharp.TL/TL/TLEncryptedChatWaiting.cs index 779fade..fd4e1ce 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedChatWaiting.cs +++ b/src/TgSharp.TL/TL/TLEncryptedChatWaiting.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1006044124)] public class TLEncryptedChatWaiting : TLAbsEncryptedChat @@ -24,10 +26,9 @@ namespace TeleSharp.TL public int AdminId { get; set; } public int ParticipantId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL Date = br.ReadInt32(); AdminId = br.ReadInt32(); ParticipantId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL bw.Write(Date); bw.Write(AdminId); bw.Write(ParticipantId); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedFile.cs b/src/TgSharp.TL/TL/TLEncryptedFile.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLEncryptedFile.cs rename to src/TgSharp.TL/TL/TLEncryptedFile.cs index 0ff0649..9314f9d 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedFile.cs +++ b/src/TgSharp.TL/TL/TLEncryptedFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1248893260)] public class TLEncryptedFile : TLAbsEncryptedFile @@ -24,10 +26,9 @@ namespace TeleSharp.TL public int DcId { get; set; } public int KeyFingerprint { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL Size = br.ReadInt32(); DcId = br.ReadInt32(); KeyFingerprint = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL bw.Write(Size); bw.Write(DcId); bw.Write(KeyFingerprint); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs b/src/TgSharp.TL/TL/TLEncryptedFileEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs rename to src/TgSharp.TL/TL/TLEncryptedFileEmpty.cs index d1735f2..cc04aea 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedFileEmpty.cs +++ b/src/TgSharp.TL/TL/TLEncryptedFileEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1038136962)] public class TLEncryptedFileEmpty : TLAbsEncryptedFile @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedMessage.cs b/src/TgSharp.TL/TL/TLEncryptedMessage.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLEncryptedMessage.cs rename to src/TgSharp.TL/TL/TLEncryptedMessage.cs index 49604e4..1173679 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedMessage.cs +++ b/src/TgSharp.TL/TL/TLEncryptedMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-317144808)] public class TLEncryptedMessage : TLAbsEncryptedMessage @@ -24,10 +26,9 @@ namespace TeleSharp.TL public byte[] Bytes { get; set; } public TLAbsEncryptedFile File { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL Date = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); File = (TLAbsEncryptedFile)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL bw.Write(Date); BytesUtil.Serialize(Bytes, bw); ObjectUtils.SerializeObject(File, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLEncryptedMessageService.cs b/src/TgSharp.TL/TL/TLEncryptedMessageService.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLEncryptedMessageService.cs rename to src/TgSharp.TL/TL/TLEncryptedMessageService.cs index 02d0670..8f40dd9 100644 --- a/src/TeleSharp.TL/TL/TLEncryptedMessageService.cs +++ b/src/TgSharp.TL/TL/TLEncryptedMessageService.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(594758406)] public class TLEncryptedMessageService : TLAbsEncryptedMessage @@ -23,10 +25,9 @@ namespace TeleSharp.TL public int Date { get; set; } public byte[] Bytes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL ChatId = br.ReadInt32(); Date = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(ChatId); bw.Write(Date); BytesUtil.Serialize(Bytes, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLError.cs b/src/TgSharp.TL/TL/TLError.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLError.cs rename to src/TgSharp.TL/TL/TLError.cs index 4443f81..bfbb73f 100644 --- a/src/TeleSharp.TL/TL/TLError.cs +++ b/src/TgSharp.TL/TL/TLError.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-994444869)] public class TLError : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Code { get; set; } public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Code = br.ReadInt32(); Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Code); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLExportedMessageLink.cs b/src/TgSharp.TL/TL/TLExportedMessageLink.cs similarity index 72% rename from src/TeleSharp.TL/TL/TLExportedMessageLink.cs rename to src/TgSharp.TL/TL/TLExportedMessageLink.cs index 9640469..2ca0160 100644 --- a/src/TeleSharp.TL/TL/TLExportedMessageLink.cs +++ b/src/TgSharp.TL/TL/TLExportedMessageLink.cs @@ -4,39 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(524838915)] + [TLObject(1571494644)] public class TLExportedMessageLink : TLObject { public override int Constructor { get { - return 524838915; + return 1571494644; } } public string Link { get; set; } - + public string Html { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Link = StringUtil.Deserialize(br); - + Html = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Link, bw); - + StringUtil.Serialize(Html, bw); } } } diff --git a/src/TgSharp.TL/TL/TLFileHash.cs b/src/TgSharp.TL/TL/TLFileHash.cs new file mode 100644 index 0000000..be60ad3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLFileHash.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1648543603)] + public class TLFileHash : TLObject + { + public override int Constructor + { + get + { + return 1648543603; + } + } + + public int Offset { get; set; } + public int Limit { get; set; } + public byte[] Hash { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + Limit = br.ReadInt32(); + Hash = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + bw.Write(Limit); + BytesUtil.Serialize(Hash, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLFileLocationUnavailable.cs b/src/TgSharp.TL/TL/TLFileLocationToBeDeprecated.cs similarity index 72% rename from src/TeleSharp.TL/TL/TLFileLocationUnavailable.cs rename to src/TgSharp.TL/TL/TLFileLocationToBeDeprecated.cs index f46b9d6..ee2b88a 100644 --- a/src/TeleSharp.TL/TL/TLFileLocationUnavailable.cs +++ b/src/TgSharp.TL/TL/TLFileLocationToBeDeprecated.cs @@ -4,36 +4,34 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(2086234950)] - public class TLFileLocationUnavailable : TLAbsFileLocation + [TLObject(-1132476723)] + public class TLFileLocationToBeDeprecated : TLObject { public override int Constructor { get { - return 2086234950; + return -1132476723; } } public long VolumeId { get; set; } public int LocalId { get; set; } - public long Secret { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { VolumeId = br.ReadInt64(); LocalId = br.ReadInt32(); - Secret = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -41,8 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(VolumeId); bw.Write(LocalId); - bw.Write(Secret); - } } } diff --git a/src/TgSharp.TL/TL/TLFolder.cs b/src/TgSharp.TL/TL/TLFolder.cs new file mode 100644 index 0000000..19861a4 --- /dev/null +++ b/src/TgSharp.TL/TL/TLFolder.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-11252123)] + public class TLFolder : TLObject + { + public override int Constructor + { + get + { + return -11252123; + } + } + + public int Flags { get; set; } + public bool AutofillNewBroadcasts { get; set; } + public bool AutofillPublicGroups { get; set; } + public bool AutofillNewCorrespondents { get; set; } + public int Id { get; set; } + public string Title { get; set; } + public TLAbsChatPhoto Photo { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + AutofillNewBroadcasts = (Flags & 1) != 0; + AutofillPublicGroups = (Flags & 2) != 0; + AutofillNewCorrespondents = (Flags & 4) != 0; + Id = br.ReadInt32(); + Title = StringUtil.Deserialize(br); + if ((Flags & 8) != 0) + Photo = (TLAbsChatPhoto)ObjectUtils.DeserializeObject(br); + else + Photo = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(Id); + StringUtil.Serialize(Title, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Photo, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLFolderPeer.cs b/src/TgSharp.TL/TL/TLFolderPeer.cs new file mode 100644 index 0000000..568c8f3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLFolderPeer.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-373643672)] + public class TLFolderPeer : TLObject + { + public override int Constructor + { + get + { + return -373643672; + } + } + + public TLAbsPeer Peer { get; set; } + public int FolderId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + FolderId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(FolderId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLFoundGif.cs b/src/TgSharp.TL/TL/TLFoundGif.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLFoundGif.cs rename to src/TgSharp.TL/TL/TLFoundGif.cs index d785578..1cae33e 100644 --- a/src/TeleSharp.TL/TL/TLFoundGif.cs +++ b/src/TgSharp.TL/TL/TLFoundGif.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(372165663)] public class TLFoundGif : TLAbsFoundGif @@ -25,10 +27,9 @@ namespace TeleSharp.TL public int W { get; set; } public int H { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,7 +40,6 @@ namespace TeleSharp.TL ContentType = StringUtil.Deserialize(br); W = br.ReadInt32(); H = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -51,7 +51,6 @@ namespace TeleSharp.TL StringUtil.Serialize(ContentType, bw); bw.Write(W); bw.Write(H); - } } } diff --git a/src/TeleSharp.TL/TL/TLFoundGifCached.cs b/src/TgSharp.TL/TL/TLFoundGifCached.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLFoundGifCached.cs rename to src/TgSharp.TL/TL/TLFoundGifCached.cs index d7d14dd..d86578e 100644 --- a/src/TeleSharp.TL/TL/TLFoundGifCached.cs +++ b/src/TgSharp.TL/TL/TLFoundGifCached.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1670052855)] public class TLFoundGifCached : TLAbsFoundGif @@ -22,10 +24,9 @@ namespace TeleSharp.TL public TLAbsPhoto Photo { get; set; } public TLAbsDocument Document { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Url = StringUtil.Deserialize(br); Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Url, bw); ObjectUtils.SerializeObject(Photo, bw); ObjectUtils.SerializeObject(Document, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLGame.cs b/src/TgSharp.TL/TL/TLGame.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLGame.cs rename to src/TgSharp.TL/TL/TLGame.cs index 190e3d5..c15058d 100644 --- a/src/TeleSharp.TL/TL/TLGame.cs +++ b/src/TgSharp.TL/TL/TLGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1107729093)] public class TLGame : TLObject @@ -27,12 +29,9 @@ namespace TeleSharp.TL public TLAbsPhoto Photo { get; set; } public TLAbsDocument Document { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Document != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -49,13 +48,11 @@ namespace TeleSharp.TL else Document = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(Id); bw.Write(AccessHash); @@ -65,7 +62,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Photo, bw); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Document, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLGeoPoint.cs b/src/TgSharp.TL/TL/TLGeoPoint.cs similarity index 75% rename from src/TeleSharp.TL/TL/TLGeoPoint.cs rename to src/TgSharp.TL/TL/TLGeoPoint.cs index a8063cc..8e83ef8 100644 --- a/src/TeleSharp.TL/TL/TLGeoPoint.cs +++ b/src/TgSharp.TL/TL/TLGeoPoint.cs @@ -4,34 +4,36 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(541710092)] + [TLObject(43446532)] public class TLGeoPoint : TLAbsGeoPoint { public override int Constructor { get { - return 541710092; + return 43446532; } } public double Long { get; set; } public double Lat { get; set; } - + public long AccessHash { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Long = br.ReadDouble(); Lat = br.ReadDouble(); - + AccessHash = br.ReadInt64(); } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +41,7 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Long); bw.Write(Lat); - + bw.Write(AccessHash); } } } diff --git a/src/TeleSharp.TL/TL/TLGeoPointEmpty.cs b/src/TgSharp.TL/TL/TLGeoPointEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLGeoPointEmpty.cs rename to src/TgSharp.TL/TL/TLGeoPointEmpty.cs index 9caaffc..ef28993 100644 --- a/src/TeleSharp.TL/TL/TLGeoPointEmpty.cs +++ b/src/TgSharp.TL/TL/TLGeoPointEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(286776671)] public class TLGeoPointEmpty : TLAbsGeoPoint @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLHighScore.cs b/src/TgSharp.TL/TL/TLHighScore.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLHighScore.cs rename to src/TgSharp.TL/TL/TLHighScore.cs index a04d510..351eac0 100644 --- a/src/TeleSharp.TL/TL/TLHighScore.cs +++ b/src/TgSharp.TL/TL/TLHighScore.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1493171408)] public class TLHighScore : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int UserId { get; set; } public int Score { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Pos = br.ReadInt32(); UserId = br.ReadInt32(); Score = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Pos); bw.Write(UserId); bw.Write(Score); - } } } diff --git a/src/TeleSharp.TL/TL/TLImportedContact.cs b/src/TgSharp.TL/TL/TLImportedContact.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLImportedContact.cs rename to src/TgSharp.TL/TL/TLImportedContact.cs index 98e6f2b..2042b5f 100644 --- a/src/TeleSharp.TL/TL/TLImportedContact.cs +++ b/src/TgSharp.TL/TL/TLImportedContact.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-805141448)] public class TLImportedContact : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public long ClientId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); ClientId = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); bw.Write(ClientId); - } } } diff --git a/src/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs b/src/TgSharp.TL/TL/TLInlineBotSwitchPM.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs rename to src/TgSharp.TL/TL/TLInlineBotSwitchPM.cs index 33438d4..61fbf4f 100644 --- a/src/TeleSharp.TL/TL/TLInlineBotSwitchPM.cs +++ b/src/TgSharp.TL/TL/TLInlineBotSwitchPM.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1008755359)] public class TLInlineBotSwitchPM : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Text { get; set; } public string StartParam { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); StartParam = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Text, bw); StringUtil.Serialize(StartParam, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputAppEvent.cs b/src/TgSharp.TL/TL/TLInputAppEvent.cs similarity index 75% rename from src/TeleSharp.TL/TL/TLInputAppEvent.cs rename to src/TgSharp.TL/TL/TLInputAppEvent.cs index a934669..8d39d27 100644 --- a/src/TeleSharp.TL/TL/TLInputAppEvent.cs +++ b/src/TgSharp.TL/TL/TLInputAppEvent.cs @@ -4,29 +4,30 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1996904104)] + [TLObject(488313413)] public class TLInputAppEvent : TLObject { public override int Constructor { get { - return 1996904104; + return 488313413; } } public double Time { get; set; } public string Type { get; set; } public long Peer { get; set; } - public string Data { get; set; } - + public TLAbsJSONValue Data { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,8 +35,7 @@ namespace TeleSharp.TL Time = br.ReadDouble(); Type = StringUtil.Deserialize(br); Peer = br.ReadInt64(); - Data = StringUtil.Deserialize(br); - + Data = (TLAbsJSONValue)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -44,8 +44,7 @@ namespace TeleSharp.TL bw.Write(Time); StringUtil.Serialize(Type, bw); bw.Write(Peer); - StringUtil.Serialize(Data, bw); - + ObjectUtils.SerializeObject(Data, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageGame.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageGame.cs index b606855..b9d3433 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageGame.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1262639204)] public class TLInputBotInlineMessageGame : TLAbsInputBotInlineMessage @@ -21,12 +23,9 @@ namespace TeleSharp.TL public int Flags { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,17 +36,14 @@ namespace TeleSharp.TL else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageID.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageID.cs index 0f36631..9ad1018 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageID.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageID.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1995686519)] public class TLInputBotInlineMessageID : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL DcId = br.ReadInt32(); Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(DcId); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs similarity index 62% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs index 023b964..2e33103 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaAuto.cs @@ -4,53 +4,57 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(691006739)] + [TLObject(864077702)] public class TLInputBotInlineMessageMediaAuto : TLAbsInputBotInlineMessage { public override int Constructor { get { - return 691006739; + return 864077702; } } public int Flags { get; set; } - public string Caption { get; set; } + public string Message { get; set; } + public TLVector Entities { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); - Caption = StringUtil.Deserialize(br); + Message = StringUtil.Deserialize(br); + if ((Flags & 2) != 0) + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + else + Entities = null; + if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - StringUtil.Serialize(Caption, bw); + StringUtil.Serialize(Message, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Entities, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs similarity index 84% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs index 2ee2fa7..4f22541 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaContact.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(766443943)] + [TLObject(-1494368259)] public class TLInputBotInlineMessageMediaContact : TLAbsInputBotInlineMessage { public override int Constructor { get { - return 766443943; + return -1494368259; } } @@ -22,14 +24,12 @@ namespace TeleSharp.TL public string PhoneNumber { get; set; } public string FirstName { get; set; } public string LastName { get; set; } + public string Vcard { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -38,25 +38,24 @@ namespace TeleSharp.TL PhoneNumber = StringUtil.Deserialize(br); FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); + Vcard = StringUtil.Deserialize(br); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); + StringUtil.Serialize(Vcard, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs index 4f578f6..f2f14cb 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaGeo.cs @@ -4,53 +4,52 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-190472735)] + [TLObject(-1045340827)] public class TLInputBotInlineMessageMediaGeo : TLAbsInputBotInlineMessage { public override int Constructor { get { - return -190472735; + return -1045340827; } } public int Flags { get; set; } public TLAbsInputGeoPoint GeoPoint { get; set; } + public int Period { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); + Period = br.ReadInt32(); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(GeoPoint, bw); + bw.Write(Period); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs index 59bd462..d02f3b9 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageMediaVenue.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1431327288)] + [TLObject(1098628881)] public class TLInputBotInlineMessageMediaVenue : TLAbsInputBotInlineMessage { public override int Constructor { get { - return -1431327288; + return 1098628881; } } @@ -24,14 +26,12 @@ namespace TeleSharp.TL public string Address { get; set; } public string Provider { get; set; } public string VenueId { get; set; } + public string VenueType { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,27 +42,26 @@ namespace TeleSharp.TL Address = StringUtil.Deserialize(br); Provider = StringUtil.Deserialize(br); VenueId = StringUtil.Deserialize(br); + VenueType = StringUtil.Deserialize(br); if ((Flags & 4) != 0) ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br); else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(GeoPoint, bw); StringUtil.Serialize(Title, bw); StringUtil.Serialize(Address, bw); StringUtil.Serialize(Provider, bw); StringUtil.Serialize(VenueId, bw); + StringUtil.Serialize(VenueType, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs b/src/TgSharp.TL/TL/TLInputBotInlineMessageText.cs similarity index 84% rename from src/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs rename to src/TgSharp.TL/TL/TLInputBotInlineMessageText.cs index 186196c..9fb09f8 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineMessageText.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineMessageText.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1036876423)] public class TLInputBotInlineMessageText : TLAbsInputBotInlineMessage @@ -24,14 +26,9 @@ namespace TeleSharp.TL public TLVector Entities { get; set; } public TLAbsReplyMarkup ReplyMarkup { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NoWebpage ? (Flags | 1) : (Flags & ~1); - Flags = Entities != null ? (Flags | 2) : (Flags & ~2); - Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -49,21 +46,17 @@ namespace TeleSharp.TL else ReplyMarkup = null; - } public override void SerializeBody(BinaryWriter bw) { 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(ReplyMarkup, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineResult.cs b/src/TgSharp.TL/TL/TLInputBotInlineResult.cs similarity index 50% rename from src/TeleSharp.TL/TL/TLInputBotInlineResult.cs rename to src/TgSharp.TL/TL/TLInputBotInlineResult.cs index 09dea40..5b44d2d 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineResult.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineResult.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(750510426)] + [TLObject(-2000710887)] public class TLInputBotInlineResult : TLAbsInputBotInlineResult { public override int Constructor { get { - return 750510426; + return -2000710887; } } @@ -24,28 +26,13 @@ namespace TeleSharp.TL public string Title { get; set; } public string Description { get; set; } public string Url { get; set; } - public string ThumbUrl { get; set; } - public string ContentUrl { get; set; } - public string ContentType { get; set; } - public int? W { get; set; } - public int? H { get; set; } - public int? Duration { get; set; } + public TLInputWebDocument Thumb { get; set; } + public TLInputWebDocument Content { get; set; } public TLAbsInputBotInlineMessage SendMessage { 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 = ThumbUrl != null ? (Flags | 16) : (Flags & ~16); - Flags = ContentUrl != null ? (Flags | 32) : (Flags & ~32); - Flags = ContentType != 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -69,43 +56,21 @@ namespace TeleSharp.TL Url = null; if ((Flags & 16) != 0) - ThumbUrl = StringUtil.Deserialize(br); + Thumb = (TLInputWebDocument)ObjectUtils.DeserializeObject(br); else - ThumbUrl = null; + Thumb = null; if ((Flags & 32) != 0) - ContentUrl = StringUtil.Deserialize(br); + Content = (TLInputWebDocument)ObjectUtils.DeserializeObject(br); else - ContentUrl = null; - - if ((Flags & 32) != 0) - ContentType = StringUtil.Deserialize(br); - else - ContentType = null; - - if ((Flags & 64) != 0) - W = br.ReadInt32(); - else - W = null; - - if ((Flags & 64) != 0) - H = br.ReadInt32(); - else - H = null; - - if ((Flags & 128) != 0) - Duration = br.ReadInt32(); - else - Duration = null; + Content = null; SendMessage = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(Id, bw); StringUtil.Serialize(Type, bw); @@ -116,19 +81,10 @@ namespace TeleSharp.TL if ((Flags & 8) != 0) StringUtil.Serialize(Url, bw); if ((Flags & 16) != 0) - StringUtil.Serialize(ThumbUrl, bw); + ObjectUtils.SerializeObject(Thumb, bw); if ((Flags & 32) != 0) - StringUtil.Serialize(ContentUrl, bw); - if ((Flags & 32) != 0) - StringUtil.Serialize(ContentType, 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(Content, bw); ObjectUtils.SerializeObject(SendMessage, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs b/src/TgSharp.TL/TL/TLInputBotInlineResultDocument.cs similarity index 89% rename from src/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs rename to src/TgSharp.TL/TL/TLInputBotInlineResultDocument.cs index a673c2a..f9e94f7 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineResultDocument.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-459324)] public class TLInputBotInlineResultDocument : TLAbsInputBotInlineResult @@ -26,13 +28,9 @@ namespace TeleSharp.TL public TLAbsInputDocument Document { get; set; } public TLAbsInputBotInlineMessage SendMessage { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Title != null ? (Flags | 2) : (Flags & ~2); - Flags = Description != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -52,13 +50,11 @@ namespace TeleSharp.TL Document = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); SendMessage = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(Id, bw); StringUtil.Serialize(Type, bw); @@ -68,7 +64,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Description, bw); ObjectUtils.SerializeObject(Document, bw); ObjectUtils.SerializeObject(SendMessage, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs b/src/TgSharp.TL/TL/TLInputBotInlineResultGame.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs rename to src/TgSharp.TL/TL/TLInputBotInlineResultGame.cs index a9cc37c..33c1471 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineResultGame.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineResultGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1336154098)] public class TLInputBotInlineResultGame : TLAbsInputBotInlineResult @@ -22,10 +24,9 @@ namespace TeleSharp.TL public string ShortName { get; set; } public TLAbsInputBotInlineMessage SendMessage { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Id = StringUtil.Deserialize(br); ShortName = StringUtil.Deserialize(br); SendMessage = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Id, bw); StringUtil.Serialize(ShortName, bw); ObjectUtils.SerializeObject(SendMessage, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs b/src/TgSharp.TL/TL/TLInputBotInlineResultPhoto.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs rename to src/TgSharp.TL/TL/TLInputBotInlineResultPhoto.cs index ab9a237..4d982e6 100644 --- a/src/TeleSharp.TL/TL/TLInputBotInlineResultPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputBotInlineResultPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1462213465)] public class TLInputBotInlineResultPhoto : TLAbsInputBotInlineResult @@ -23,10 +25,9 @@ namespace TeleSharp.TL public TLAbsInputPhoto Photo { get; set; } public TLAbsInputBotInlineMessage SendMessage { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Type = StringUtil.Deserialize(br); Photo = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); SendMessage = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Type, bw); ObjectUtils.SerializeObject(Photo, bw); ObjectUtils.SerializeObject(SendMessage, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputChannel.cs b/src/TgSharp.TL/TL/TLInputChannel.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputChannel.cs rename to src/TgSharp.TL/TL/TLInputChannel.cs index b2424cc..b0c7870 100644 --- a/src/TeleSharp.TL/TL/TLInputChannel.cs +++ b/src/TgSharp.TL/TL/TLInputChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1343524562)] public class TLInputChannel : TLAbsInputChannel @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int ChannelId { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(ChannelId); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputChannelEmpty.cs b/src/TgSharp.TL/TL/TLInputChannelEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputChannelEmpty.cs rename to src/TgSharp.TL/TL/TLInputChannelEmpty.cs index 886a76a..24dce53 100644 --- a/src/TeleSharp.TL/TL/TLInputChannelEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputChannelEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-292807034)] public class TLInputChannelEmpty : TLAbsInputChannel @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputChannelFromMessage.cs b/src/TgSharp.TL/TL/TLInputChannelFromMessage.cs new file mode 100644 index 0000000..001221e --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputChannelFromMessage.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(707290417)] + public class TLInputChannelFromMessage : TLAbsInputChannel + { + public override int Constructor + { + get + { + return 707290417; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public int ChannelId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + ChannelId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + bw.Write(ChannelId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputChatPhoto.cs b/src/TgSharp.TL/TL/TLInputChatPhoto.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputChatPhoto.cs rename to src/TgSharp.TL/TL/TLInputChatPhoto.cs index 4a5454d..c3b6917 100644 --- a/src/TeleSharp.TL/TL/TLInputChatPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputChatPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1991004873)] public class TLInputChatPhoto : TLAbsInputChatPhoto @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputPhoto Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs b/src/TgSharp.TL/TL/TLInputChatPhotoEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs rename to src/TgSharp.TL/TL/TLInputChatPhotoEmpty.cs index 38ef207..4cbf496 100644 --- a/src/TeleSharp.TL/TL/TLInputChatPhotoEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputChatPhotoEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(480546647)] public class TLInputChatPhotoEmpty : TLAbsInputChatPhoto @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs b/src/TgSharp.TL/TL/TLInputChatUploadedPhoto.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs rename to src/TgSharp.TL/TL/TLInputChatUploadedPhoto.cs index 7bdf099..b2abc00 100644 --- a/src/TeleSharp.TL/TL/TLInputChatUploadedPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputChatUploadedPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1837345356)] public class TLInputChatUploadedPhoto : TLAbsInputChatPhoto @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputFile File { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { File = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(File, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputCheckPasswordEmpty.cs b/src/TgSharp.TL/TL/TLInputCheckPasswordEmpty.cs new file mode 100644 index 0000000..278a999 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputCheckPasswordEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1736378792)] + public class TLInputCheckPasswordEmpty : TLAbsInputCheckPasswordSRP + { + public override int Constructor + { + get + { + return -1736378792; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputCheckPasswordSRP.cs b/src/TgSharp.TL/TL/TLInputCheckPasswordSRP.cs new file mode 100644 index 0000000..40d7137 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputCheckPasswordSRP.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-763367294)] + public class TLInputCheckPasswordSRP : TLAbsInputCheckPasswordSRP + { + public override int Constructor + { + get + { + return -763367294; + } + } + + public long SrpId { get; set; } + public byte[] A { get; set; } + public byte[] M1 { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + SrpId = br.ReadInt64(); + A = BytesUtil.Deserialize(br); + M1 = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(SrpId); + BytesUtil.Serialize(A, bw); + BytesUtil.Serialize(M1, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputClientProxy.cs b/src/TgSharp.TL/TL/TLInputClientProxy.cs new file mode 100644 index 0000000..7b03f30 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputClientProxy.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1968737087)] + public class TLInputClientProxy : TLObject + { + public override int Constructor + { + get + { + return 1968737087; + } + } + + public string Address { get; set; } + public int Port { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Address = StringUtil.Deserialize(br); + Port = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Address, bw); + bw.Write(Port); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputDialogPeer.cs b/src/TgSharp.TL/TL/TLInputDialogPeer.cs new file mode 100644 index 0000000..459a8f0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputDialogPeer.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-55902537)] + public class TLInputDialogPeer : TLAbsInputDialogPeer + { + public override int Constructor + { + get + { + return -55902537; + } + } + + public TLAbsInputPeer Peer { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputDialogPeerFolder.cs b/src/TgSharp.TL/TL/TLInputDialogPeerFolder.cs new file mode 100644 index 0000000..ceb6b48 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputDialogPeerFolder.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1684014375)] + public class TLInputDialogPeerFolder : TLAbsInputDialogPeer + { + public override int Constructor + { + get + { + return 1684014375; + } + } + + public int FolderId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + FolderId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(FolderId); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputDocument.cs b/src/TgSharp.TL/TL/TLInputDocument.cs new file mode 100644 index 0000000..5899b16 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputDocument.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(448771445)] + public class TLInputDocument : TLAbsInputDocument + { + public override int Constructor + { + get + { + return 448771445; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + public byte[] FileReference { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputDocumentEmpty.cs b/src/TgSharp.TL/TL/TLInputDocumentEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputDocumentEmpty.cs rename to src/TgSharp.TL/TL/TLInputDocumentEmpty.cs index b5fa786..087f582 100644 --- a/src/TeleSharp.TL/TL/TLInputDocumentEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputDocumentEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1928391342)] public class TLInputDocumentEmpty : TLAbsInputDocument @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputDocumentFileLocation.cs b/src/TgSharp.TL/TL/TLInputDocumentFileLocation.cs new file mode 100644 index 0000000..534d6df --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputDocumentFileLocation.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1160743548)] + public class TLInputDocumentFileLocation : TLAbsInputFileLocation + { + public override int Constructor + { + get + { + return -1160743548; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + public byte[] FileReference { get; set; } + public string ThumbSize { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); + ThumbSize = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); + StringUtil.Serialize(ThumbSize, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputEncryptedChat.cs b/src/TgSharp.TL/TL/TLInputEncryptedChat.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputEncryptedChat.cs rename to src/TgSharp.TL/TL/TLInputEncryptedChat.cs index 9202b17..18d14c2 100644 --- a/src/TeleSharp.TL/TL/TLInputEncryptedChat.cs +++ b/src/TgSharp.TL/TL/TLInputEncryptedChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-247351839)] public class TLInputEncryptedChat : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int ChatId { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(ChatId); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputEncryptedFile.cs b/src/TgSharp.TL/TL/TLInputEncryptedFile.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputEncryptedFile.cs rename to src/TgSharp.TL/TL/TLInputEncryptedFile.cs index d00291f..68bfd80 100644 --- a/src/TeleSharp.TL/TL/TLInputEncryptedFile.cs +++ b/src/TgSharp.TL/TL/TLInputEncryptedFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1511503333)] public class TLInputEncryptedFile : TLAbsInputEncryptedFile @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs b/src/TgSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs rename to src/TgSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs index 8f032fa..166fdb2 100644 --- a/src/TeleSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs +++ b/src/TgSharp.TL/TL/TLInputEncryptedFileBigUploaded.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(767652808)] public class TLInputEncryptedFileBigUploaded : TLAbsInputEncryptedFile @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Parts { get; set; } public int KeyFingerprint { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Id = br.ReadInt64(); Parts = br.ReadInt32(); KeyFingerprint = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Id); bw.Write(Parts); bw.Write(KeyFingerprint); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs b/src/TgSharp.TL/TL/TLInputEncryptedFileEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs rename to src/TgSharp.TL/TL/TLInputEncryptedFileEmpty.cs index 0768ad0..6c4e0c5 100644 --- a/src/TeleSharp.TL/TL/TLInputEncryptedFileEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputEncryptedFileEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(406307684)] public class TLInputEncryptedFileEmpty : TLAbsInputEncryptedFile @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs b/src/TgSharp.TL/TL/TLInputEncryptedFileLocation.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs rename to src/TgSharp.TL/TL/TLInputEncryptedFileLocation.cs index 11e5e3e..57bf30b 100644 --- a/src/TeleSharp.TL/TL/TLInputEncryptedFileLocation.cs +++ b/src/TgSharp.TL/TL/TLInputEncryptedFileLocation.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-182231723)] public class TLInputEncryptedFileLocation : TLAbsInputFileLocation @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs b/src/TgSharp.TL/TL/TLInputEncryptedFileUploaded.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs rename to src/TgSharp.TL/TL/TLInputEncryptedFileUploaded.cs index 0a328ae..7c622f1 100644 --- a/src/TeleSharp.TL/TL/TLInputEncryptedFileUploaded.cs +++ b/src/TgSharp.TL/TL/TLInputEncryptedFileUploaded.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1690108678)] public class TLInputEncryptedFileUploaded : TLAbsInputEncryptedFile @@ -23,10 +25,9 @@ namespace TeleSharp.TL public string Md5Checksum { get; set; } public int KeyFingerprint { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Parts = br.ReadInt32(); Md5Checksum = StringUtil.Deserialize(br); KeyFingerprint = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(Parts); StringUtil.Serialize(Md5Checksum, bw); bw.Write(KeyFingerprint); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputFile.cs b/src/TgSharp.TL/TL/TLInputFile.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLInputFile.cs rename to src/TgSharp.TL/TL/TLInputFile.cs index 32ae7a3..f4c7b3c 100644 --- a/src/TeleSharp.TL/TL/TLInputFile.cs +++ b/src/TgSharp.TL/TL/TLInputFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-181407105)] public class TLInputFile : TLAbsInputFile @@ -23,10 +25,9 @@ namespace TeleSharp.TL public string Name { get; set; } public string Md5Checksum { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Parts = br.ReadInt32(); Name = StringUtil.Deserialize(br); Md5Checksum = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(Parts); StringUtil.Serialize(Name, bw); StringUtil.Serialize(Md5Checksum, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputFileBig.cs b/src/TgSharp.TL/TL/TLInputFileBig.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInputFileBig.cs rename to src/TgSharp.TL/TL/TLInputFileBig.cs index d46c8ca..54907a1 100644 --- a/src/TeleSharp.TL/TL/TLInputFileBig.cs +++ b/src/TgSharp.TL/TL/TLInputFileBig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-95482955)] public class TLInputFileBig : TLAbsInputFile @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Parts { get; set; } public string Name { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Id = br.ReadInt64(); Parts = br.ReadInt32(); Name = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Id); bw.Write(Parts); StringUtil.Serialize(Name, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputFileLocation.cs b/src/TgSharp.TL/TL/TLInputFileLocation.cs similarity index 76% rename from src/TeleSharp.TL/TL/TLInputFileLocation.cs rename to src/TgSharp.TL/TL/TLInputFileLocation.cs index 1585fc7..8a5d3df 100644 --- a/src/TeleSharp.TL/TL/TLInputFileLocation.cs +++ b/src/TgSharp.TL/TL/TLInputFileLocation.cs @@ -4,28 +4,30 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(342061462)] + [TLObject(-539317279)] public class TLInputFileLocation : TLAbsInputFileLocation { public override int Constructor { get { - return 342061462; + return -539317279; } } public long VolumeId { get; set; } public int LocalId { get; set; } public long Secret { get; set; } - + public byte[] FileReference { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +35,7 @@ namespace TeleSharp.TL VolumeId = br.ReadInt64(); LocalId = br.ReadInt32(); Secret = br.ReadInt64(); - + FileReference = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +44,7 @@ namespace TeleSharp.TL bw.Write(VolumeId); bw.Write(LocalId); bw.Write(Secret); - + BytesUtil.Serialize(FileReference, bw); } } } diff --git a/src/TgSharp.TL/TL/TLInputFolderPeer.cs b/src/TgSharp.TL/TL/TLInputFolderPeer.cs new file mode 100644 index 0000000..71a4c1c --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputFolderPeer.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-70073706)] + public class TLInputFolderPeer : TLObject + { + public override int Constructor + { + get + { + return -70073706; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int FolderId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + FolderId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(FolderId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputGameID.cs b/src/TgSharp.TL/TL/TLInputGameID.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputGameID.cs rename to src/TgSharp.TL/TL/TLInputGameID.cs index f580671..d9ea89e 100644 --- a/src/TeleSharp.TL/TL/TLInputGameID.cs +++ b/src/TgSharp.TL/TL/TLInputGameID.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(53231223)] public class TLInputGameID : TLAbsInputGame @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputGameShortName.cs b/src/TgSharp.TL/TL/TLInputGameShortName.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInputGameShortName.cs rename to src/TgSharp.TL/TL/TLInputGameShortName.cs index 7d3a3d0..6756ce1 100644 --- a/src/TeleSharp.TL/TL/TLInputGameShortName.cs +++ b/src/TgSharp.TL/TL/TLInputGameShortName.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1020139510)] public class TLInputGameShortName : TLAbsInputGame @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsInputUser BotId { get; set; } public string ShortName { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { BotId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); ShortName = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(BotId, bw); StringUtil.Serialize(ShortName, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputGeoPoint.cs b/src/TgSharp.TL/TL/TLInputGeoPoint.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputGeoPoint.cs rename to src/TgSharp.TL/TL/TLInputGeoPoint.cs index b594833..ea4e42f 100644 --- a/src/TeleSharp.TL/TL/TLInputGeoPoint.cs +++ b/src/TgSharp.TL/TL/TLInputGeoPoint.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-206066487)] public class TLInputGeoPoint : TLAbsInputGeoPoint @@ -21,17 +23,15 @@ namespace TeleSharp.TL public double Lat { get; set; } public double Long { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Lat = br.ReadDouble(); Long = br.ReadDouble(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Lat); bw.Write(Long); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs b/src/TgSharp.TL/TL/TLInputGeoPointEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs rename to src/TgSharp.TL/TL/TLInputGeoPointEmpty.cs index 765e72a..9fa2fdf 100644 --- a/src/TeleSharp.TL/TL/TLInputGeoPointEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputGeoPointEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-457104426)] public class TLInputGeoPointEmpty : TLAbsInputGeoPoint @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputKeyboardButtonUrlAuth.cs b/src/TgSharp.TL/TL/TLInputKeyboardButtonUrlAuth.cs new file mode 100644 index 0000000..6fe543d --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputKeyboardButtonUrlAuth.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-802258988)] + public class TLInputKeyboardButtonUrlAuth : TLAbsKeyboardButton + { + public override int Constructor + { + get + { + return -802258988; + } + } + + public int Flags { get; set; } + public bool RequestWriteAccess { get; set; } + public string Text { get; set; } + public string FwdText { get; set; } + public string Url { get; set; } + public TLAbsInputUser Bot { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + RequestWriteAccess = (Flags & 1) != 0; + Text = StringUtil.Deserialize(br); + if ((Flags & 2) != 0) + FwdText = StringUtil.Deserialize(br); + else + FwdText = null; + + Url = StringUtil.Deserialize(br); + Bot = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Text, bw); + if ((Flags & 2) != 0) + StringUtil.Serialize(FwdText, bw); + StringUtil.Serialize(Url, bw); + ObjectUtils.SerializeObject(Bot, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMediaContact.cs b/src/TgSharp.TL/TL/TLInputMediaContact.cs similarity index 79% rename from src/TeleSharp.TL/TL/TLInputMediaContact.cs rename to src/TgSharp.TL/TL/TLInputMediaContact.cs index 2796740..dacff5d 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaContact.cs +++ b/src/TgSharp.TL/TL/TLInputMediaContact.cs @@ -4,28 +4,30 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1494984313)] + [TLObject(-122978821)] public class TLInputMediaContact : TLAbsInputMedia { public override int Constructor { get { - return -1494984313; + return -122978821; } } public string PhoneNumber { get; set; } public string FirstName { get; set; } public string LastName { get; set; } - + public string Vcard { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +35,7 @@ namespace TeleSharp.TL PhoneNumber = StringUtil.Deserialize(br); FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); - + Vcard = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +44,7 @@ namespace TeleSharp.TL StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); - + StringUtil.Serialize(Vcard, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaDocument.cs b/src/TgSharp.TL/TL/TLInputMediaDocument.cs similarity index 60% rename from src/TeleSharp.TL/TL/TLInputMediaDocument.cs rename to src/TgSharp.TL/TL/TLInputMediaDocument.cs index 98e3807..900ec49 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaDocument.cs +++ b/src/TgSharp.TL/TL/TLInputMediaDocument.cs @@ -4,42 +4,49 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(444068508)] + [TLObject(598418386)] public class TLInputMediaDocument : TLAbsInputMedia { public override int Constructor { get { - return 444068508; + return 598418386; } } + public int Flags { get; set; } public TLAbsInputDocument Id { get; set; } - public string Caption { get; set; } - + public int? TtlSeconds { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); Id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); - Caption = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(Id, bw); - StringUtil.Serialize(Caption, bw); - + if ((Flags & 1) != 0) + bw.Write(TtlSeconds.Value); } } } diff --git a/src/TgSharp.TL/TL/TLInputMediaDocumentExternal.cs b/src/TgSharp.TL/TL/TLInputMediaDocumentExternal.cs new file mode 100644 index 0000000..61ef2b8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMediaDocumentExternal.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-78455655)] + public class TLInputMediaDocumentExternal : TLAbsInputMedia + { + public override int Constructor + { + get + { + return -78455655; + } + } + + public int Flags { get; set; } + public string Url { get; set; } + public int? TtlSeconds { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Url = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Url, bw); + if ((Flags & 1) != 0) + bw.Write(TtlSeconds.Value); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMediaEmpty.cs b/src/TgSharp.TL/TL/TLInputMediaEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLInputMediaEmpty.cs rename to src/TgSharp.TL/TL/TLInputMediaEmpty.cs index eb9e65f..b044cd5 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputMediaEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1771768449)] public class TLInputMediaEmpty : TLAbsInputMedia @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaGame.cs b/src/TgSharp.TL/TL/TLInputMediaGame.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputMediaGame.cs rename to src/TgSharp.TL/TL/TLInputMediaGame.cs index 11bc17e..b3abc61 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaGame.cs +++ b/src/TgSharp.TL/TL/TLInputMediaGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-750828557)] public class TLInputMediaGame : TLAbsInputMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputGame Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputGame)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputMediaGeoLive.cs b/src/TgSharp.TL/TL/TLInputMediaGeoLive.cs new file mode 100644 index 0000000..890ccad --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMediaGeoLive.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-833715459)] + public class TLInputMediaGeoLive : TLAbsInputMedia + { + public override int Constructor + { + get + { + return -833715459; + } + } + + public int Flags { get; set; } + public bool Stopped { get; set; } + public TLAbsInputGeoPoint GeoPoint { get; set; } + public int? Period { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Stopped = (Flags & 1) != 0; + GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); + if ((Flags & 2) != 0) + Period = br.ReadInt32(); + else + Period = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(GeoPoint, bw); + if ((Flags & 2) != 0) + bw.Write(Period.Value); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs b/src/TgSharp.TL/TL/TLInputMediaGeoPoint.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs rename to src/TgSharp.TL/TL/TLInputMediaGeoPoint.cs index 84bc603..f91a367 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaGeoPoint.cs +++ b/src/TgSharp.TL/TL/TLInputMediaGeoPoint.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-104578748)] public class TLInputMediaGeoPoint : TLAbsInputMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputGeoPoint GeoPoint { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(GeoPoint, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaGifExternal.cs b/src/TgSharp.TL/TL/TLInputMediaGifExternal.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInputMediaGifExternal.cs rename to src/TgSharp.TL/TL/TLInputMediaGifExternal.cs index 1928149..1d0c030 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaGifExternal.cs +++ b/src/TgSharp.TL/TL/TLInputMediaGifExternal.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1212395773)] public class TLInputMediaGifExternal : TLAbsInputMedia @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Url { get; set; } public string Q { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Url = StringUtil.Deserialize(br); Q = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Url, bw); StringUtil.Serialize(Q, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaInvoice.cs b/src/TgSharp.TL/TL/TLInputMediaInvoice.cs similarity index 85% rename from src/TeleSharp.TL/TL/TLInputMediaInvoice.cs rename to src/TgSharp.TL/TL/TLInputMediaInvoice.cs index 1e63dec..0aca78d 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaInvoice.cs +++ b/src/TgSharp.TL/TL/TLInputMediaInvoice.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1844103547)] + [TLObject(-186607933)] public class TLInputMediaInvoice : TLAbsInputMedia { public override int Constructor { get { - return -1844103547; + return -186607933; } } @@ -25,14 +27,12 @@ namespace TeleSharp.TL public TLInvoice Invoice { get; set; } public byte[] Payload { get; set; } public string Provider { get; set; } + public TLDataJSON ProviderData { get; set; } public string StartParam { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Photo != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -48,14 +48,13 @@ namespace TeleSharp.TL Invoice = (TLInvoice)ObjectUtils.DeserializeObject(br); Payload = BytesUtil.Deserialize(br); Provider = StringUtil.Deserialize(br); + ProviderData = (TLDataJSON)ObjectUtils.DeserializeObject(br); StartParam = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(Title, bw); StringUtil.Serialize(Description, bw); @@ -64,8 +63,8 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Invoice, bw); BytesUtil.Serialize(Payload, bw); StringUtil.Serialize(Provider, bw); + ObjectUtils.SerializeObject(ProviderData, bw); StringUtil.Serialize(StartParam, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaPhoto.cs b/src/TgSharp.TL/TL/TLInputMediaPhoto.cs similarity index 60% rename from src/TeleSharp.TL/TL/TLInputMediaPhoto.cs rename to src/TgSharp.TL/TL/TLInputMediaPhoto.cs index 4c81fd3..a5be246 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputMediaPhoto.cs @@ -4,42 +4,49 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-373312269)] + [TLObject(-1279654347)] public class TLInputMediaPhoto : TLAbsInputMedia { public override int Constructor { get { - return -373312269; + return -1279654347; } } + public int Flags { get; set; } public TLAbsInputPhoto Id { get; set; } - public string Caption { get; set; } - + public int? TtlSeconds { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); Id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - Caption = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(Id, bw); - StringUtil.Serialize(Caption, bw); - + if ((Flags & 1) != 0) + bw.Write(TtlSeconds.Value); } } } diff --git a/src/TgSharp.TL/TL/TLInputMediaPhotoExternal.cs b/src/TgSharp.TL/TL/TLInputMediaPhotoExternal.cs new file mode 100644 index 0000000..382ce56 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMediaPhotoExternal.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-440664550)] + public class TLInputMediaPhotoExternal : TLAbsInputMedia + { + public override int Constructor + { + get + { + return -440664550; + } + } + + public int Flags { get; set; } + public string Url { get; set; } + public int? TtlSeconds { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Url = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Url, bw); + if ((Flags & 1) != 0) + bw.Write(TtlSeconds.Value); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputMediaPoll.cs b/src/TgSharp.TL/TL/TLInputMediaPoll.cs new file mode 100644 index 0000000..4cdb07c --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMediaPoll.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(112424539)] + public class TLInputMediaPoll : TLAbsInputMedia + { + public override int Constructor + { + get + { + return 112424539; + } + } + + public TLPoll Poll { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Poll = (TLPoll)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Poll, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs b/src/TgSharp.TL/TL/TLInputMediaUploadedDocument.cs similarity index 67% rename from src/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs rename to src/TgSharp.TL/TL/TLInputMediaUploadedDocument.cs index a20ac15..c737bbf 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs +++ b/src/TgSharp.TL/TL/TLInputMediaUploadedDocument.cs @@ -4,62 +4,73 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-797904407)] + [TLObject(1530447553)] public class TLInputMediaUploadedDocument : TLAbsInputMedia { public override int Constructor { get { - return -797904407; + return 1530447553; } } public int Flags { get; set; } + public bool NosoundVideo { get; set; } public TLAbsInputFile File { get; set; } + public TLAbsInputFile Thumb { get; set; } public string MimeType { get; set; } public TLVector Attributes { get; set; } - public string Caption { get; set; } public TLVector Stickers { get; set; } - + public int? TtlSeconds { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Stickers != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); + NosoundVideo = (Flags & 8) != 0; File = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); + if ((Flags & 4) != 0) + Thumb = (TLAbsInputFile)ObjectUtils.DeserializeObject(br); + else + Thumb = null; + MimeType = StringUtil.Deserialize(br); Attributes = (TLVector)ObjectUtils.DeserializeVector(br); - Caption = StringUtil.Deserialize(br); if ((Flags & 1) != 0) Stickers = (TLVector)ObjectUtils.DeserializeVector(br); else Stickers = null; + if ((Flags & 2) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(File, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(Thumb, bw); StringUtil.Serialize(MimeType, bw); ObjectUtils.SerializeObject(Attributes, bw); - StringUtil.Serialize(Caption, bw); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Stickers, bw); - + if ((Flags & 2) != 0) + bw.Write(TtlSeconds.Value); } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs b/src/TgSharp.TL/TL/TLInputMediaUploadedPhoto.cs similarity index 76% rename from src/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs rename to src/TgSharp.TL/TL/TLInputMediaUploadedPhoto.cs index 0854243..897b0f8 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaUploadedPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputMediaUploadedPhoto.cs @@ -4,56 +4,57 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1661770481)] + [TLObject(505969924)] public class TLInputMediaUploadedPhoto : TLAbsInputMedia { public override int Constructor { get { - return 1661770481; + return 505969924; } } public int Flags { get; set; } public TLAbsInputFile File { get; set; } - public string Caption { get; set; } public TLVector Stickers { get; set; } - + public int? TtlSeconds { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Stickers != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } 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; + if ((Flags & 2) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(File, bw); - StringUtil.Serialize(Caption, bw); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Stickers, bw); - + if ((Flags & 2) != 0) + bw.Write(TtlSeconds.Value); } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaVenue.cs b/src/TgSharp.TL/TL/TLInputMediaVenue.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMediaVenue.cs rename to src/TgSharp.TL/TL/TLInputMediaVenue.cs index c2e024a..920faf3 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaVenue.cs +++ b/src/TgSharp.TL/TL/TLInputMediaVenue.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(673687578)] + [TLObject(-1052959727)] public class TLInputMediaVenue : TLAbsInputMedia { public override int Constructor { get { - return 673687578; + return -1052959727; } } @@ -23,11 +25,11 @@ namespace TeleSharp.TL public string Address { get; set; } public string Provider { get; set; } public string VenueId { get; set; } - + public string VenueType { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +39,7 @@ namespace TeleSharp.TL Address = StringUtil.Deserialize(br); Provider = StringUtil.Deserialize(br); VenueId = StringUtil.Deserialize(br); - + VenueType = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +50,7 @@ namespace TeleSharp.TL StringUtil.Serialize(Address, bw); StringUtil.Serialize(Provider, bw); StringUtil.Serialize(VenueId, bw); - + StringUtil.Serialize(VenueType, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs b/src/TgSharp.TL/TL/TLInputMessageEntityMentionName.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs rename to src/TgSharp.TL/TL/TLInputMessageEntityMentionName.cs index ceee225..6d9ca6f 100644 --- a/src/TeleSharp.TL/TL/TLInputMessageEntityMentionName.cs +++ b/src/TgSharp.TL/TL/TLInputMessageEntityMentionName.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(546203849)] public class TLInputMessageEntityMentionName : TLAbsMessageEntity @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Length { get; set; } public TLAbsInputUser UserId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Offset = br.ReadInt32(); Length = br.ReadInt32(); UserId = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Offset); bw.Write(Length); ObjectUtils.SerializeObject(UserId, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputMessageID.cs b/src/TgSharp.TL/TL/TLInputMessageID.cs new file mode 100644 index 0000000..2be7fef --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMessageID.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1502174430)] + public class TLInputMessageID : TLAbsInputMessage + { + public override int Constructor + { + get + { + return -1502174430; + } + } + + public int Id { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputMessagePinned.cs b/src/TgSharp.TL/TL/TLInputMessagePinned.cs new file mode 100644 index 0000000..8f50dc0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMessagePinned.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2037963464)] + public class TLInputMessagePinned : TLAbsInputMessage + { + public override int Constructor + { + get + { + return -2037963464; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputMessageReplyTo.cs b/src/TgSharp.TL/TL/TLInputMessageReplyTo.cs new file mode 100644 index 0000000..c5a9316 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMessageReplyTo.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1160215659)] + public class TLInputMessageReplyTo : TLAbsInputMessage + { + public override int Constructor + { + get + { + return -1160215659; + } + } + + public int Id { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs index e0e50b4..c2a5026 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterChatPhotos.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(975236280)] public class TLInputMessagesFilterChatPhotos : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputMessagesFilterContacts.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterContacts.cs new file mode 100644 index 0000000..93e33ae --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterContacts.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-530392189)] + public class TLInputMessagesFilterContacts : TLAbsMessagesFilter + { + public override int Constructor + { + get + { + return -530392189; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterDocument.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterDocument.cs index a94c03e..be98ce2 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterDocument.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterDocument.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1629621880)] public class TLInputMessagesFilterDocument : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterEmpty.cs index 38ab571..064b6bc 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1474492012)] public class TLInputMessagesFilterEmpty : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputMessagesFilterGeo.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterGeo.cs new file mode 100644 index 0000000..54d04c5 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterGeo.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-419271411)] + public class TLInputMessagesFilterGeo : TLAbsMessagesFilter + { + public override int Constructor + { + get + { + return -419271411; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterGif.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterGif.cs index 859a973..9c9313a 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterGif.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterGif.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-3644025)] public class TLInputMessagesFilterGif : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterMusic.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterMusic.cs index 28a86fe..841c327 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterMusic.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterMusic.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(928101534)] public class TLInputMessagesFilterMusic : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputMessagesFilterMyMentions.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterMyMentions.cs new file mode 100644 index 0000000..9f48901 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterMyMentions.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1040652646)] + public class TLInputMessagesFilterMyMentions : TLAbsMessagesFilter + { + public override int Constructor + { + get + { + return -1040652646; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhoneCalls.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterPhoneCalls.cs similarity index 84% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterPhoneCalls.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterPhoneCalls.cs index 891851b..a83dc0c 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhoneCalls.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterPhoneCalls.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2134272152)] public class TLInputMessagesFilterPhoneCalls : TLAbsMessagesFilter @@ -21,28 +23,21 @@ namespace TeleSharp.TL public int Flags { get; set; } public bool Missed { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Missed ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Missed = (Flags & 1) != 0; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs index 4cc17e5..8453efb 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterPhotoVideo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1458172132)] public class TLInputMessagesFilterPhotoVideo : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterPhotos.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterPhotos.cs index ae49c77..ba2357b 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterPhotos.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterPhotos.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1777752804)] public class TLInputMessagesFilterPhotos : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterRoundVideo.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterRoundVideo.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterRoundVideo.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterRoundVideo.cs index d7fc258..fa8bda0 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterRoundVideo.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterRoundVideo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1253451181)] public class TLInputMessagesFilterRoundVideo : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterRoundVoice.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterRoundVoice.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterRoundVoice.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterRoundVoice.cs index 8d6bf1d..ab6fac2 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterRoundVoice.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterRoundVoice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2054952868)] public class TLInputMessagesFilterRoundVoice : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterUrl.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterUrl.cs index 6fb42b5..78cab66 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterUrl.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterUrl.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2129714567)] public class TLInputMessagesFilterUrl : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterVideo.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterVideo.cs index 8f714a6..531172e 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterVideo.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterVideo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1614803355)] public class TLInputMessagesFilterVideo : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs b/src/TgSharp.TL/TL/TLInputMessagesFilterVoice.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs rename to src/TgSharp.TL/TL/TLInputMessagesFilterVoice.cs index 8f55014..db8185a 100644 --- a/src/TeleSharp.TL/TL/TLInputMessagesFilterVoice.cs +++ b/src/TgSharp.TL/TL/TLInputMessagesFilterVoice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1358283666)] public class TLInputMessagesFilterVoice : TLAbsMessagesFilter @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputNotifyBroadcasts.cs b/src/TgSharp.TL/TL/TLInputNotifyBroadcasts.cs new file mode 100644 index 0000000..abc3445 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputNotifyBroadcasts.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1311015810)] + public class TLInputNotifyBroadcasts : TLAbsInputNotifyPeer + { + public override int Constructor + { + get + { + return -1311015810; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputNotifyChats.cs b/src/TgSharp.TL/TL/TLInputNotifyChats.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputNotifyChats.cs rename to src/TgSharp.TL/TL/TLInputNotifyChats.cs index f997223..def73a6 100644 --- a/src/TeleSharp.TL/TL/TLInputNotifyChats.cs +++ b/src/TgSharp.TL/TL/TLInputNotifyChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1251338318)] public class TLInputNotifyChats : TLAbsInputNotifyPeer @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputNotifyPeer.cs b/src/TgSharp.TL/TL/TLInputNotifyPeer.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputNotifyPeer.cs rename to src/TgSharp.TL/TL/TLInputNotifyPeer.cs index ab761bc..ac29446 100644 --- a/src/TeleSharp.TL/TL/TLInputNotifyPeer.cs +++ b/src/TgSharp.TL/TL/TLInputNotifyPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1195615476)] public class TLInputNotifyPeer : TLAbsInputNotifyPeer @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputPeer Peer { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputNotifyUsers.cs b/src/TgSharp.TL/TL/TLInputNotifyUsers.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputNotifyUsers.cs rename to src/TgSharp.TL/TL/TLInputNotifyUsers.cs index e896b47..ce52130 100644 --- a/src/TeleSharp.TL/TL/TLInputNotifyUsers.cs +++ b/src/TgSharp.TL/TL/TLInputNotifyUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(423314455)] public class TLInputNotifyUsers : TLAbsInputNotifyPeer @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputPaymentCredentials.cs b/src/TgSharp.TL/TL/TLInputPaymentCredentials.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLInputPaymentCredentials.cs rename to src/TgSharp.TL/TL/TLInputPaymentCredentials.cs index 18e4cf8..3c39cf9 100644 --- a/src/TeleSharp.TL/TL/TLInputPaymentCredentials.cs +++ b/src/TgSharp.TL/TL/TLInputPaymentCredentials.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(873977640)] public class TLInputPaymentCredentials : TLAbsInputPaymentCredentials @@ -22,12 +24,9 @@ namespace TeleSharp.TL public bool Save { get; set; } public TLDataJSON Data { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Save ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,17 +34,13 @@ namespace TeleSharp.TL Flags = br.ReadInt32(); Save = (Flags & 1) != 0; Data = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Data, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputPaymentCredentialsAndroidPay.cs b/src/TgSharp.TL/TL/TLInputPaymentCredentialsAndroidPay.cs new file mode 100644 index 0000000..0488c6d --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPaymentCredentialsAndroidPay.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-905587442)] + public class TLInputPaymentCredentialsAndroidPay : TLAbsInputPaymentCredentials + { + public override int Constructor + { + get + { + return -905587442; + } + } + + public TLDataJSON PaymentToken { get; set; } + public string GoogleTransactionId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PaymentToken = (TLDataJSON)ObjectUtils.DeserializeObject(br); + GoogleTransactionId = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PaymentToken, bw); + StringUtil.Serialize(GoogleTransactionId, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputPaymentCredentialsApplePay.cs b/src/TgSharp.TL/TL/TLInputPaymentCredentialsApplePay.cs new file mode 100644 index 0000000..745e71c --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPaymentCredentialsApplePay.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(178373535)] + public class TLInputPaymentCredentialsApplePay : TLAbsInputPaymentCredentials + { + public override int Constructor + { + get + { + return 178373535; + } + } + + public TLDataJSON PaymentData { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PaymentData = (TLDataJSON)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(PaymentData, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPaymentCredentialsSaved.cs b/src/TgSharp.TL/TL/TLInputPaymentCredentialsSaved.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLInputPaymentCredentialsSaved.cs rename to src/TgSharp.TL/TL/TLInputPaymentCredentialsSaved.cs index 7548463..a596c09 100644 --- a/src/TeleSharp.TL/TL/TLInputPaymentCredentialsSaved.cs +++ b/src/TgSharp.TL/TL/TLInputPaymentCredentialsSaved.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1056001329)] public class TLInputPaymentCredentialsSaved : TLAbsInputPaymentCredentials @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Id { get; set; } public byte[] TmpPassword { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = StringUtil.Deserialize(br); TmpPassword = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Id, bw); BytesUtil.Serialize(TmpPassword, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputPeerChannel.cs b/src/TgSharp.TL/TL/TLInputPeerChannel.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputPeerChannel.cs rename to src/TgSharp.TL/TL/TLInputPeerChannel.cs index 9f6b41e..d013de8 100644 --- a/src/TeleSharp.TL/TL/TLInputPeerChannel.cs +++ b/src/TgSharp.TL/TL/TLInputPeerChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(548253432)] public class TLInputPeerChannel : TLAbsInputPeer @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int ChannelId { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(ChannelId); bw.Write(AccessHash); - } } } diff --git a/src/TgSharp.TL/TL/TLInputPeerChannelFromMessage.cs b/src/TgSharp.TL/TL/TLInputPeerChannelFromMessage.cs new file mode 100644 index 0000000..234907e --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPeerChannelFromMessage.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1667893317)] + public class TLInputPeerChannelFromMessage : TLAbsInputPeer + { + public override int Constructor + { + get + { + return -1667893317; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public int ChannelId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + ChannelId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + bw.Write(ChannelId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPeerChat.cs b/src/TgSharp.TL/TL/TLInputPeerChat.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLInputPeerChat.cs rename to src/TgSharp.TL/TL/TLInputPeerChat.cs index bf48b3a..6faddb1 100644 --- a/src/TeleSharp.TL/TL/TLInputPeerChat.cs +++ b/src/TgSharp.TL/TL/TLInputPeerChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(396093539)] public class TLInputPeerChat : TLAbsInputPeer @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int ChatId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputPeerEmpty.cs b/src/TgSharp.TL/TL/TLInputPeerEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLInputPeerEmpty.cs rename to src/TgSharp.TL/TL/TLInputPeerEmpty.cs index b30e5cb..7729d21 100644 --- a/src/TeleSharp.TL/TL/TLInputPeerEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputPeerEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2134579434)] public class TLInputPeerEmpty : TLAbsInputPeer @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputPeerNotifySettings.cs b/src/TgSharp.TL/TL/TLInputPeerNotifySettings.cs new file mode 100644 index 0000000..0a3d277 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPeerNotifySettings.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1673717362)] + public class TLInputPeerNotifySettings : TLObject + { + public override int Constructor + { + get + { + return -1673717362; + } + } + + public int Flags { get; set; } + public bool? ShowPreviews { get; set; } + public bool? Silent { get; set; } + public int? MuteUntil { get; set; } + public string Sound { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + ShowPreviews = BoolUtil.Deserialize(br); + else + ShowPreviews = null; + + if ((Flags & 2) != 0) + Silent = BoolUtil.Deserialize(br); + else + Silent = null; + + if ((Flags & 4) != 0) + MuteUntil = br.ReadInt32(); + else + MuteUntil = null; + + if ((Flags & 8) != 0) + Sound = StringUtil.Deserialize(br); + else + Sound = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + BoolUtil.Serialize(ShowPreviews.Value, bw); + if ((Flags & 2) != 0) + BoolUtil.Serialize(Silent.Value, bw); + if ((Flags & 4) != 0) + bw.Write(MuteUntil.Value); + if ((Flags & 8) != 0) + StringUtil.Serialize(Sound, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputPeerPhotoFileLocation.cs b/src/TgSharp.TL/TL/TLInputPeerPhotoFileLocation.cs new file mode 100644 index 0000000..a744e6c --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPeerPhotoFileLocation.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(668375447)] + public class TLInputPeerPhotoFileLocation : TLAbsInputFileLocation + { + public override int Constructor + { + get + { + return 668375447; + } + } + + public int Flags { get; set; } + public bool Big { get; set; } + public TLAbsInputPeer Peer { get; set; } + public long VolumeId { get; set; } + public int LocalId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Big = (Flags & 1) != 0; + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + VolumeId = br.ReadInt64(); + LocalId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(VolumeId); + bw.Write(LocalId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPeerSelf.cs b/src/TgSharp.TL/TL/TLInputPeerSelf.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLInputPeerSelf.cs rename to src/TgSharp.TL/TL/TLInputPeerSelf.cs index ae1de40..20e70d1 100644 --- a/src/TeleSharp.TL/TL/TLInputPeerSelf.cs +++ b/src/TgSharp.TL/TL/TLInputPeerSelf.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2107670217)] public class TLInputPeerSelf : TLAbsInputPeer @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputPeerUser.cs b/src/TgSharp.TL/TL/TLInputPeerUser.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputPeerUser.cs rename to src/TgSharp.TL/TL/TLInputPeerUser.cs index 57e4ad1..b9cb132 100644 --- a/src/TeleSharp.TL/TL/TLInputPeerUser.cs +++ b/src/TgSharp.TL/TL/TLInputPeerUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2072935910)] public class TLInputPeerUser : TLAbsInputPeer @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); bw.Write(AccessHash); - } } } diff --git a/src/TgSharp.TL/TL/TLInputPeerUserFromMessage.cs b/src/TgSharp.TL/TL/TLInputPeerUserFromMessage.cs new file mode 100644 index 0000000..750839e --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPeerUserFromMessage.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(398123750)] + public class TLInputPeerUserFromMessage : TLAbsInputPeer + { + public override int Constructor + { + get + { + return 398123750; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public int UserId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + UserId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + bw.Write(UserId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPhoneCall.cs b/src/TgSharp.TL/TL/TLInputPhoneCall.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputPhoneCall.cs rename to src/TgSharp.TL/TL/TLInputPhoneCall.cs index 8d76220..dacb6c5 100644 --- a/src/TeleSharp.TL/TL/TLInputPhoneCall.cs +++ b/src/TgSharp.TL/TL/TLInputPhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(506920429)] public class TLInputPhoneCall : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputPhoneContact.cs b/src/TgSharp.TL/TL/TLInputPhoneContact.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLInputPhoneContact.cs rename to src/TgSharp.TL/TL/TLInputPhoneContact.cs index 1a53b78..7ef6db0 100644 --- a/src/TeleSharp.TL/TL/TLInputPhoneContact.cs +++ b/src/TgSharp.TL/TL/TLInputPhoneContact.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-208488460)] public class TLInputPhoneContact : TLObject @@ -23,10 +25,9 @@ namespace TeleSharp.TL public string FirstName { get; set; } public string LastName { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Phone = StringUtil.Deserialize(br); FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Phone, bw); StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputPhoto.cs b/src/TgSharp.TL/TL/TLInputPhoto.cs new file mode 100644 index 0000000..4aaaebd --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPhoto.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1001634122)] + public class TLInputPhoto : TLAbsInputPhoto + { + public override int Constructor + { + get + { + return 1001634122; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + public byte[] FileReference { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPhotoEmpty.cs b/src/TgSharp.TL/TL/TLInputPhotoEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLInputPhotoEmpty.cs rename to src/TgSharp.TL/TL/TLInputPhotoEmpty.cs index e86298b..2125edc 100644 --- a/src/TeleSharp.TL/TL/TLInputPhotoEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputPhotoEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(483901197)] public class TLInputPhotoEmpty : TLAbsInputPhoto @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputPhotoFileLocation.cs b/src/TgSharp.TL/TL/TLInputPhotoFileLocation.cs new file mode 100644 index 0000000..103f276 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPhotoFileLocation.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1075322878)] + public class TLInputPhotoFileLocation : TLAbsInputFileLocation + { + public override int Constructor + { + get + { + return 1075322878; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + public byte[] FileReference { get; set; } + public string ThumbSize { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); + ThumbSize = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); + StringUtil.Serialize(ThumbSize, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputPhotoLegacyFileLocation.cs b/src/TgSharp.TL/TL/TLInputPhotoLegacyFileLocation.cs new file mode 100644 index 0000000..c41eecb --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPhotoLegacyFileLocation.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-667654413)] + public class TLInputPhotoLegacyFileLocation : TLAbsInputFileLocation + { + public override int Constructor + { + get + { + return -667654413; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + public byte[] FileReference { get; set; } + public long VolumeId { get; set; } + public int LocalId { get; set; } + public long Secret { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); + VolumeId = br.ReadInt64(); + LocalId = br.ReadInt32(); + Secret = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); + bw.Write(VolumeId); + bw.Write(LocalId); + bw.Write(Secret); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputPrivacyKeyAddedByPhone.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyAddedByPhone.cs new file mode 100644 index 0000000..83a60ea --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyAddedByPhone.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-786326563)] + public class TLInputPrivacyKeyAddedByPhone : TLAbsInputPrivacyKey + { + public override int Constructor + { + get + { + return -786326563; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs rename to src/TgSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs index 6ad6919..b294fab 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyChatInvite.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1107622874)] public class TLInputPrivacyKeyChatInvite : TLAbsInputPrivacyKey @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputPrivacyKeyForwards.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyForwards.cs new file mode 100644 index 0000000..f41f0e2 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyForwards.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1529000952)] + public class TLInputPrivacyKeyForwards : TLAbsInputPrivacyKey + { + public override int Constructor + { + get + { + return -1529000952; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyKeyPhoneCall.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneCall.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyKeyPhoneCall.cs rename to src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneCall.cs index 772863b..7d075f0 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyKeyPhoneCall.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-88417185)] public class TLInputPrivacyKeyPhoneCall : TLAbsInputPrivacyKey @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneNumber.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneNumber.cs new file mode 100644 index 0000000..5a71a4c --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneNumber.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(55761658)] + public class TLInputPrivacyKeyPhoneNumber : TLAbsInputPrivacyKey + { + public override int Constructor + { + get + { + return 55761658; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneP2P.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneP2P.cs new file mode 100644 index 0000000..272c868 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyPhoneP2P.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-610373422)] + public class TLInputPrivacyKeyPhoneP2P : TLAbsInputPrivacyKey + { + public override int Constructor + { + get + { + return -610373422; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputPrivacyKeyProfilePhoto.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyProfilePhoto.cs new file mode 100644 index 0000000..60369a3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyProfilePhoto.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1461304012)] + public class TLInputPrivacyKeyProfilePhoto : TLAbsInputPrivacyKey + { + public override int Constructor + { + get + { + return 1461304012; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs b/src/TgSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs rename to src/TgSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs index 20d0ea5..2ffd584 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyKeyStatusTimestamp.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1335282456)] public class TLInputPrivacyKeyStatusTimestamp : TLAbsInputPrivacyKey @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowAll.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs rename to src/TgSharp.TL/TL/TLInputPrivacyValueAllowAll.cs index ff6ab62..892b0da 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyValueAllowAll.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowAll.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(407582158)] public class TLInputPrivacyValueAllowAll : TLAbsInputPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputPrivacyValueAllowChatParticipants.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowChatParticipants.cs new file mode 100644 index 0000000..944c22b --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowChatParticipants.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1283572154)] + public class TLInputPrivacyValueAllowChatParticipants : TLAbsInputPrivacyRule + { + public override int Constructor + { + get + { + return 1283572154; + } + } + + public TLVector Chats { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Chats, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs rename to src/TgSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs index 2ebb4e9..8393ed1 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowContacts.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(218751099)] public class TLInputPrivacyValueAllowContacts : TLAbsInputPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs rename to src/TgSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs index db6cc4f..f3e0601 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueAllowUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(320652927)] public class TLInputPrivacyValueAllowUsers : TLAbsInputPrivacyRule @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs rename to src/TgSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs index 775265d..e2d699f 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowAll.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-697604407)] public class TLInputPrivacyValueDisallowAll : TLAbsInputPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowChatParticipants.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowChatParticipants.cs new file mode 100644 index 0000000..571b7bf --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowChatParticipants.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-668769361)] + public class TLInputPrivacyValueDisallowChatParticipants : TLAbsInputPrivacyRule + { + public override int Constructor + { + get + { + return -668769361; + } + } + + public TLVector Chats { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Chats, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs rename to src/TgSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs index 2813936..d3b6515 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowContacts.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(195371015)] public class TLInputPrivacyValueDisallowContacts : TLAbsInputPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs rename to src/TgSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs index d61130d..bfc7fc3 100644 --- a/src/TeleSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs +++ b/src/TgSharp.TL/TL/TLInputPrivacyValueDisallowUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1877932953)] public class TLInputPrivacyValueDisallowUsers : TLAbsInputPrivacyRule @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputReportReasonChildAbuse.cs b/src/TgSharp.TL/TL/TLInputReportReasonChildAbuse.cs new file mode 100644 index 0000000..95aa475 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputReportReasonChildAbuse.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1376497949)] + public class TLInputReportReasonChildAbuse : TLAbsReportReason + { + public override int Constructor + { + get + { + return -1376497949; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputReportReasonCopyright.cs b/src/TgSharp.TL/TL/TLInputReportReasonCopyright.cs new file mode 100644 index 0000000..4ac126f --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputReportReasonCopyright.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1685456582)] + public class TLInputReportReasonCopyright : TLAbsReportReason + { + public override int Constructor + { + get + { + return -1685456582; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputReportReasonGeoIrrelevant.cs b/src/TgSharp.TL/TL/TLInputReportReasonGeoIrrelevant.cs new file mode 100644 index 0000000..c46b9dc --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputReportReasonGeoIrrelevant.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-606798099)] + public class TLInputReportReasonGeoIrrelevant : TLAbsReportReason + { + public override int Constructor + { + get + { + return -606798099; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputReportReasonOther.cs b/src/TgSharp.TL/TL/TLInputReportReasonOther.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputReportReasonOther.cs rename to src/TgSharp.TL/TL/TLInputReportReasonOther.cs index 95372b3..6728533 100644 --- a/src/TeleSharp.TL/TL/TLInputReportReasonOther.cs +++ b/src/TgSharp.TL/TL/TLInputReportReasonOther.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-512463606)] public class TLInputReportReasonOther : TLAbsReportReason @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputReportReasonPornography.cs b/src/TgSharp.TL/TL/TLInputReportReasonPornography.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputReportReasonPornography.cs rename to src/TgSharp.TL/TL/TLInputReportReasonPornography.cs index 7c3f36e..4296f22 100644 --- a/src/TeleSharp.TL/TL/TLInputReportReasonPornography.cs +++ b/src/TgSharp.TL/TL/TLInputReportReasonPornography.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(777640226)] public class TLInputReportReasonPornography : TLAbsReportReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputReportReasonSpam.cs b/src/TgSharp.TL/TL/TLInputReportReasonSpam.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputReportReasonSpam.cs rename to src/TgSharp.TL/TL/TLInputReportReasonSpam.cs index a313a30..94b830e 100644 --- a/src/TeleSharp.TL/TL/TLInputReportReasonSpam.cs +++ b/src/TgSharp.TL/TL/TLInputReportReasonSpam.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1490799288)] public class TLInputReportReasonSpam : TLAbsReportReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputReportReasonViolence.cs b/src/TgSharp.TL/TL/TLInputReportReasonViolence.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputReportReasonViolence.cs rename to src/TgSharp.TL/TL/TLInputReportReasonViolence.cs index b1e1008..20632f3 100644 --- a/src/TeleSharp.TL/TL/TLInputReportReasonViolence.cs +++ b/src/TgSharp.TL/TL/TLInputReportReasonViolence.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(505595789)] public class TLInputReportReasonViolence : TLAbsReportReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs b/src/TgSharp.TL/TL/TLInputSecureFile.cs similarity index 71% rename from src/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs rename to src/TgSharp.TL/TL/TLInputSecureFile.cs index 70833b0..53460e9 100644 --- a/src/TeleSharp.TL/TL/TLInputDocumentFileLocation.cs +++ b/src/TgSharp.TL/TL/TLInputSecureFile.cs @@ -4,36 +4,34 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1125058340)] - public class TLInputDocumentFileLocation : TLAbsInputFileLocation + [TLObject(1399317950)] + public class TLInputSecureFile : TLAbsInputSecureFile { public override int Constructor { get { - return 1125058340; + return 1399317950; } } public long Id { get; set; } public long AccessHash { get; set; } - public int Version { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - Version = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -41,8 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - bw.Write(Version); - } } } diff --git a/src/TgSharp.TL/TL/TLInputSecureFileLocation.cs b/src/TgSharp.TL/TL/TLInputSecureFileLocation.cs new file mode 100644 index 0000000..3cced31 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputSecureFileLocation.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-876089816)] + public class TLInputSecureFileLocation : TLAbsInputFileLocation + { + public override int Constructor + { + get + { + return -876089816; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputSecureFileUploaded.cs b/src/TgSharp.TL/TL/TLInputSecureFileUploaded.cs new file mode 100644 index 0000000..78d7a9a --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputSecureFileUploaded.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(859091184)] + public class TLInputSecureFileUploaded : TLAbsInputSecureFile + { + public override int Constructor + { + get + { + return 859091184; + } + } + + public long Id { get; set; } + public int Parts { get; set; } + public string Md5Checksum { get; set; } + public byte[] FileHash { get; set; } + public byte[] Secret { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + Parts = br.ReadInt32(); + Md5Checksum = StringUtil.Deserialize(br); + FileHash = BytesUtil.Deserialize(br); + Secret = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(Parts); + StringUtil.Serialize(Md5Checksum, bw); + BytesUtil.Serialize(FileHash, bw); + BytesUtil.Serialize(Secret, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputSecureValue.cs b/src/TgSharp.TL/TL/TLInputSecureValue.cs new file mode 100644 index 0000000..abcb7e5 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputSecureValue.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-618540889)] + public class TLInputSecureValue : TLObject + { + public override int Constructor + { + get + { + return -618540889; + } + } + + public int Flags { get; set; } + public TLAbsSecureValueType Type { get; set; } + public TLSecureData Data { get; set; } + public TLAbsInputSecureFile FrontSide { get; set; } + public TLAbsInputSecureFile ReverseSide { get; set; } + public TLAbsInputSecureFile Selfie { get; set; } + public TLVector Translation { get; set; } + public TLVector Files { get; set; } + public TLAbsSecurePlainData PlainData { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + Data = (TLSecureData)ObjectUtils.DeserializeObject(br); + else + Data = null; + + if ((Flags & 2) != 0) + FrontSide = (TLAbsInputSecureFile)ObjectUtils.DeserializeObject(br); + else + FrontSide = null; + + if ((Flags & 4) != 0) + ReverseSide = (TLAbsInputSecureFile)ObjectUtils.DeserializeObject(br); + else + ReverseSide = null; + + if ((Flags & 8) != 0) + Selfie = (TLAbsInputSecureFile)ObjectUtils.DeserializeObject(br); + else + Selfie = null; + + if ((Flags & 64) != 0) + Translation = (TLVector)ObjectUtils.DeserializeVector(br); + else + Translation = null; + + if ((Flags & 16) != 0) + Files = (TLVector)ObjectUtils.DeserializeVector(br); + else + Files = null; + + if ((Flags & 32) != 0) + PlainData = (TLAbsSecurePlainData)ObjectUtils.DeserializeObject(br); + else + PlainData = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Type, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Data, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(FrontSide, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(ReverseSide, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Selfie, bw); + if ((Flags & 64) != 0) + ObjectUtils.SerializeObject(Translation, bw); + if ((Flags & 16) != 0) + ObjectUtils.SerializeObject(Files, bw); + if ((Flags & 32) != 0) + ObjectUtils.SerializeObject(PlainData, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputSingleMedia.cs b/src/TgSharp.TL/TL/TLInputSingleMedia.cs new file mode 100644 index 0000000..7fc339e --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputSingleMedia.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(482797855)] + public class TLInputSingleMedia : TLObject + { + public override int Constructor + { + get + { + return 482797855; + } + } + + public int Flags { get; set; } + public TLAbsInputMedia Media { get; set; } + public long RandomId { get; set; } + public string Message { get; set; } + public TLVector Entities { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br); + RandomId = br.ReadInt64(); + Message = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + Entities = (TLVector)ObjectUtils.DeserializeVector(br); + else + Entities = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Media, bw); + bw.Write(RandomId); + StringUtil.Serialize(Message, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Entities, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputStickerSetAnimatedEmoji.cs b/src/TgSharp.TL/TL/TLInputStickerSetAnimatedEmoji.cs new file mode 100644 index 0000000..c35c55a --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputStickerSetAnimatedEmoji.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(42402760)] + public class TLInputStickerSetAnimatedEmoji : TLAbsInputStickerSet + { + public override int Constructor + { + get + { + return 42402760; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs b/src/TgSharp.TL/TL/TLInputStickerSetEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs rename to src/TgSharp.TL/TL/TLInputStickerSetEmpty.cs index f990574..2963559 100644 --- a/src/TeleSharp.TL/TL/TLInputStickerSetEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputStickerSetEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-4838507)] public class TLInputStickerSetEmpty : TLAbsInputStickerSet @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputStickerSetID.cs b/src/TgSharp.TL/TL/TLInputStickerSetID.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputStickerSetID.cs rename to src/TgSharp.TL/TL/TLInputStickerSetID.cs index 3f22d8e..5995048 100644 --- a/src/TeleSharp.TL/TL/TLInputStickerSetID.cs +++ b/src/TgSharp.TL/TL/TLInputStickerSetID.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1645763991)] public class TLInputStickerSetID : TLAbsInputStickerSet @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputStickerSetItem.cs b/src/TgSharp.TL/TL/TLInputStickerSetItem.cs similarity index 89% rename from src/TeleSharp.TL/TL/TLInputStickerSetItem.cs rename to src/TgSharp.TL/TL/TLInputStickerSetItem.cs index 80d212f..dccf8f2 100644 --- a/src/TeleSharp.TL/TL/TLInputStickerSetItem.cs +++ b/src/TgSharp.TL/TL/TLInputStickerSetItem.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-6249322)] public class TLInputStickerSetItem : TLObject @@ -23,12 +25,9 @@ namespace TeleSharp.TL public string Emoji { get; set; } public TLMaskCoords MaskCoords { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = MaskCoords != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,19 +40,16 @@ namespace TeleSharp.TL else MaskCoords = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); ObjectUtils.SerializeObject(Document, bw); StringUtil.Serialize(Emoji, bw); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(MaskCoords, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputStickerSetShortName.cs b/src/TgSharp.TL/TL/TLInputStickerSetShortName.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputStickerSetShortName.cs rename to src/TgSharp.TL/TL/TLInputStickerSetShortName.cs index 022715c..9cfbb12 100644 --- a/src/TeleSharp.TL/TL/TLInputStickerSetShortName.cs +++ b/src/TgSharp.TL/TL/TLInputStickerSetShortName.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2044933984)] public class TLInputStickerSetShortName : TLAbsInputStickerSet @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string ShortName { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ShortName = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(ShortName, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLFileLocation.cs b/src/TgSharp.TL/TL/TLInputStickerSetThumb.cs similarity index 65% rename from src/TeleSharp.TL/TL/TLFileLocation.cs rename to src/TgSharp.TL/TL/TLInputStickerSetThumb.cs index bea3dbd..97806bb 100644 --- a/src/TeleSharp.TL/TL/TLFileLocation.cs +++ b/src/TgSharp.TL/TL/TLInputStickerSetThumb.cs @@ -4,48 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1406570614)] - public class TLFileLocation : TLAbsFileLocation + [TLObject(230353641)] + public class TLInputStickerSetThumb : TLAbsInputFileLocation { public override int Constructor { get { - return 1406570614; + return 230353641; } } - public int DcId { get; set; } + public TLAbsInputStickerSet Stickerset { get; set; } public long VolumeId { get; set; } public int LocalId { get; set; } - public long Secret { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - DcId = br.ReadInt32(); + Stickerset = (TLAbsInputStickerSet)ObjectUtils.DeserializeObject(br); VolumeId = br.ReadInt64(); LocalId = br.ReadInt32(); - Secret = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(DcId); + ObjectUtils.SerializeObject(Stickerset, bw); bw.Write(VolumeId); bw.Write(LocalId); - bw.Write(Secret); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs b/src/TgSharp.TL/TL/TLInputStickeredMediaDocument.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs rename to src/TgSharp.TL/TL/TLInputStickeredMediaDocument.cs index dfce21f..9ea7727 100644 --- a/src/TeleSharp.TL/TL/TLInputStickeredMediaDocument.cs +++ b/src/TgSharp.TL/TL/TLInputStickeredMediaDocument.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(70813275)] public class TLInputStickeredMediaDocument : TLAbsInputStickeredMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputDocument Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs b/src/TgSharp.TL/TL/TLInputStickeredMediaPhoto.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs rename to src/TgSharp.TL/TL/TLInputStickeredMediaPhoto.cs index 32f1994..1622881 100644 --- a/src/TeleSharp.TL/TL/TLInputStickeredMediaPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputStickeredMediaPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1251549527)] public class TLInputStickeredMediaPhoto : TLAbsInputStickeredMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsInputPhoto Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputTakeoutFileLocation.cs b/src/TgSharp.TL/TL/TLInputTakeoutFileLocation.cs new file mode 100644 index 0000000..7b9cb9f --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputTakeoutFileLocation.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(700340377)] + public class TLInputTakeoutFileLocation : TLAbsInputFileLocation + { + public override int Constructor + { + get + { + return 700340377; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputDocument.cs b/src/TgSharp.TL/TL/TLInputTheme.cs similarity index 80% rename from src/TeleSharp.TL/TL/TLInputDocument.cs rename to src/TgSharp.TL/TL/TLInputTheme.cs index 822c03f..1b43ce1 100644 --- a/src/TeleSharp.TL/TL/TLInputDocument.cs +++ b/src/TgSharp.TL/TL/TLInputTheme.cs @@ -4,34 +4,34 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(410618194)] - public class TLInputDocument : TLAbsInputDocument + [TLObject(1012306921)] + public class TLInputTheme : TLAbsInputTheme { public override int Constructor { get { - return 410618194; + return 1012306921; } } public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TgSharp.TL/TL/TLInputThemeSettings.cs b/src/TgSharp.TL/TL/TLInputThemeSettings.cs new file mode 100644 index 0000000..3c07bba --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputThemeSettings.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1118798639)] + public class TLInputThemeSettings : TLObject + { + public override int Constructor + { + get + { + return -1118798639; + } + } + + public int Flags { get; set; } + public TLAbsBaseTheme BaseTheme { get; set; } + public int AccentColor { get; set; } + public int? MessageTopColor { get; set; } + public int? MessageBottomColor { get; set; } + public TLAbsInputWallPaper Wallpaper { get; set; } + public TLWallPaperSettings WallpaperSettings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + BaseTheme = (TLAbsBaseTheme)ObjectUtils.DeserializeObject(br); + AccentColor = br.ReadInt32(); + if ((Flags & 1) != 0) + MessageTopColor = br.ReadInt32(); + else + MessageTopColor = null; + + if ((Flags & 1) != 0) + MessageBottomColor = br.ReadInt32(); + else + MessageBottomColor = null; + + if ((Flags & 2) != 0) + Wallpaper = (TLAbsInputWallPaper)ObjectUtils.DeserializeObject(br); + else + Wallpaper = null; + + if ((Flags & 2) != 0) + WallpaperSettings = (TLWallPaperSettings)ObjectUtils.DeserializeObject(br); + else + WallpaperSettings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(BaseTheme, bw); + bw.Write(AccentColor); + if ((Flags & 1) != 0) + bw.Write(MessageTopColor.Value); + if ((Flags & 1) != 0) + bw.Write(MessageBottomColor.Value); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Wallpaper, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(WallpaperSettings, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputThemeSlug.cs b/src/TgSharp.TL/TL/TLInputThemeSlug.cs new file mode 100644 index 0000000..941b4b2 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputThemeSlug.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-175567375)] + public class TLInputThemeSlug : TLAbsInputTheme + { + public override int Constructor + { + get + { + return -175567375; + } + } + + public string Slug { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Slug = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Slug, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputUser.cs b/src/TgSharp.TL/TL/TLInputUser.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLInputUser.cs rename to src/TgSharp.TL/TL/TLInputUser.cs index 0665426..2d36774 100644 --- a/src/TeleSharp.TL/TL/TLInputUser.cs +++ b/src/TgSharp.TL/TL/TLInputUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-668391402)] public class TLInputUser : TLAbsInputUser @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInputUserEmpty.cs b/src/TgSharp.TL/TL/TLInputUserEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLInputUserEmpty.cs rename to src/TgSharp.TL/TL/TLInputUserEmpty.cs index 9609d31..ac5eaef 100644 --- a/src/TeleSharp.TL/TL/TLInputUserEmpty.cs +++ b/src/TgSharp.TL/TL/TLInputUserEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1182234929)] public class TLInputUserEmpty : TLAbsInputUser @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLInputUserFromMessage.cs b/src/TgSharp.TL/TL/TLInputUserFromMessage.cs new file mode 100644 index 0000000..0263885 --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputUserFromMessage.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(756118935)] + public class TLInputUserFromMessage : TLAbsInputUser + { + public override int Constructor + { + get + { + return 756118935; + } + } + + public TLAbsInputPeer Peer { get; set; } + public int MsgId { get; set; } + public int UserId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + UserId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + bw.Write(UserId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputUserSelf.cs b/src/TgSharp.TL/TL/TLInputUserSelf.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLInputUserSelf.cs rename to src/TgSharp.TL/TL/TLInputUserSelf.cs index be91a59..26ac7ea 100644 --- a/src/TeleSharp.TL/TL/TLInputUserSelf.cs +++ b/src/TgSharp.TL/TL/TLInputUserSelf.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-138301121)] public class TLInputUserSelf : TLAbsInputUser @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLInputPhoto.cs b/src/TgSharp.TL/TL/TLInputWallPaper.cs similarity index 79% rename from src/TeleSharp.TL/TL/TLInputPhoto.cs rename to src/TgSharp.TL/TL/TLInputWallPaper.cs index 906a6b9..86ddd02 100644 --- a/src/TeleSharp.TL/TL/TLInputPhoto.cs +++ b/src/TgSharp.TL/TL/TLInputWallPaper.cs @@ -4,34 +4,34 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-74070332)] - public class TLInputPhoto : TLAbsInputPhoto + [TLObject(-433014407)] + public class TLInputWallPaper : TLAbsInputWallPaper { public override int Constructor { get { - return -74070332; + return -433014407; } } public long Id { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(AccessHash); - } } } diff --git a/src/TgSharp.TL/TL/TLInputWallPaperNoFile.cs b/src/TgSharp.TL/TL/TLInputWallPaperNoFile.cs new file mode 100644 index 0000000..187522c --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputWallPaperNoFile.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2077770836)] + public class TLInputWallPaperNoFile : TLAbsInputWallPaper + { + public override int Constructor + { + get + { + return -2077770836; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLInputWallPaperSlug.cs b/src/TgSharp.TL/TL/TLInputWallPaperSlug.cs new file mode 100644 index 0000000..783ea4a --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputWallPaperSlug.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1913199744)] + public class TLInputWallPaperSlug : TLAbsInputWallPaper + { + public override int Constructor + { + get + { + return 1913199744; + } + } + + public string Slug { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Slug = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Slug, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputWebDocument.cs b/src/TgSharp.TL/TL/TLInputWebDocument.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLInputWebDocument.cs rename to src/TgSharp.TL/TL/TLInputWebDocument.cs index 7431a99..65bf99e 100644 --- a/src/TeleSharp.TL/TL/TLInputWebDocument.cs +++ b/src/TgSharp.TL/TL/TLInputWebDocument.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1678949555)] public class TLInputWebDocument : TLObject @@ -23,10 +25,9 @@ namespace TeleSharp.TL public string MimeType { get; set; } public TLVector Attributes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Size = br.ReadInt32(); MimeType = StringUtil.Deserialize(br); Attributes = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(Size); StringUtil.Serialize(MimeType, bw); ObjectUtils.SerializeObject(Attributes, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLInputWebFileGeoPointLocation.cs b/src/TgSharp.TL/TL/TLInputWebFileGeoPointLocation.cs new file mode 100644 index 0000000..52cbfbe --- /dev/null +++ b/src/TgSharp.TL/TL/TLInputWebFileGeoPointLocation.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1625153079)] + public class TLInputWebFileGeoPointLocation : TLAbsInputWebFileLocation + { + public override int Constructor + { + get + { + return -1625153079; + } + } + + public TLAbsInputGeoPoint GeoPoint { get; set; } + public long AccessHash { get; set; } + public int W { get; set; } + public int H { get; set; } + public int Zoom { get; set; } + public int Scale { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + GeoPoint = (TLAbsInputGeoPoint)ObjectUtils.DeserializeObject(br); + AccessHash = br.ReadInt64(); + W = br.ReadInt32(); + H = br.ReadInt32(); + Zoom = br.ReadInt32(); + Scale = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(GeoPoint, bw); + bw.Write(AccessHash); + bw.Write(W); + bw.Write(H); + bw.Write(Zoom); + bw.Write(Scale); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLInputWebFileLocation.cs b/src/TgSharp.TL/TL/TLInputWebFileLocation.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLInputWebFileLocation.cs rename to src/TgSharp.TL/TL/TLInputWebFileLocation.cs index bc70cde..b6d95d0 100644 --- a/src/TeleSharp.TL/TL/TLInputWebFileLocation.cs +++ b/src/TgSharp.TL/TL/TLInputWebFileLocation.cs @@ -4,11 +4,13 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1036396922)] - public class TLInputWebFileLocation : TLObject + public class TLInputWebFileLocation : TLAbsInputWebFileLocation { public override int Constructor { @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Url { get; set; } public long AccessHash { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Url = StringUtil.Deserialize(br); AccessHash = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Url, bw); bw.Write(AccessHash); - } } } diff --git a/src/TeleSharp.TL/TL/TLInvoice.cs b/src/TgSharp.TL/TL/TLInvoice.cs similarity index 76% rename from src/TeleSharp.TL/TL/TLInvoice.cs rename to src/TgSharp.TL/TL/TLInvoice.cs index b12a2f5..8c2ae06 100644 --- a/src/TeleSharp.TL/TL/TLInvoice.cs +++ b/src/TgSharp.TL/TL/TLInvoice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1022713000)] public class TLInvoice : TLObject @@ -25,20 +27,14 @@ namespace TeleSharp.TL public bool EmailRequested { get; set; } public bool ShippingAddressRequested { get; set; } public bool Flexible { get; set; } + public bool PhoneToProvider { get; set; } + public bool EmailToProvider { get; set; } public string Currency { get; set; } public TLVector Prices { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Test ? (Flags | 1) : (Flags & ~1); - Flags = NameRequested ? (Flags | 2) : (Flags & ~2); - Flags = PhoneRequested ? (Flags | 4) : (Flags & ~4); - Flags = EmailRequested ? (Flags | 8) : (Flags & ~8); - Flags = ShippingAddressRequested ? (Flags | 16) : (Flags & ~16); - Flags = Flexible ? (Flags | 32) : (Flags & ~32); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -50,25 +46,18 @@ namespace TeleSharp.TL EmailRequested = (Flags & 8) != 0; ShippingAddressRequested = (Flags & 16) != 0; Flexible = (Flags & 32) != 0; + PhoneToProvider = (Flags & 64) != 0; + EmailToProvider = (Flags & 128) != 0; Currency = StringUtil.Deserialize(br); Prices = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - - - StringUtil.Serialize(Currency, bw); ObjectUtils.SerializeObject(Prices, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLJsonArray.cs b/src/TgSharp.TL/TL/TLJsonArray.cs new file mode 100644 index 0000000..4ec8aaa --- /dev/null +++ b/src/TgSharp.TL/TL/TLJsonArray.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-146520221)] + public class TLJsonArray : TLAbsJSONValue + { + public override int Constructor + { + get + { + return -146520221; + } + } + + public TLVector Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Value = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Value, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLJsonBool.cs b/src/TgSharp.TL/TL/TLJsonBool.cs new file mode 100644 index 0000000..f8bf728 --- /dev/null +++ b/src/TgSharp.TL/TL/TLJsonBool.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-952869270)] + public class TLJsonBool : TLAbsJSONValue + { + public override int Constructor + { + get + { + return -952869270; + } + } + + public bool Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Value = BoolUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BoolUtil.Serialize(Value, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelRoleModerator.cs b/src/TgSharp.TL/TL/TLJsonNull.cs similarity index 67% rename from src/TeleSharp.TL/TL/TLChannelRoleModerator.cs rename to src/TgSharp.TL/TL/TLJsonNull.cs index 4c83bab..0e0ae1e 100644 --- a/src/TeleSharp.TL/TL/TLChannelRoleModerator.cs +++ b/src/TgSharp.TL/TL/TLJsonNull.cs @@ -4,36 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1776756363)] - public class TLChannelRoleModerator : TLAbsChannelParticipantRole + [TLObject(1064139624)] + public class TLJsonNull : TLAbsJSONValue { public override int Constructor { get { - return -1776756363; + return 1064139624; } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLJsonNumber.cs b/src/TgSharp.TL/TL/TLJsonNumber.cs new file mode 100644 index 0000000..da3765e --- /dev/null +++ b/src/TgSharp.TL/TL/TLJsonNumber.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(736157604)] + public class TLJsonNumber : TLAbsJSONValue + { + public override int Constructor + { + get + { + return 736157604; + } + } + + public double Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Value = br.ReadDouble(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Value); + } + } +} diff --git a/src/TgSharp.TL/TL/TLJsonObject.cs b/src/TgSharp.TL/TL/TLJsonObject.cs new file mode 100644 index 0000000..304aaad --- /dev/null +++ b/src/TgSharp.TL/TL/TLJsonObject.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1715350371)] + public class TLJsonObject : TLAbsJSONValue + { + public override int Constructor + { + get + { + return -1715350371; + } + } + + // manual edit: TLJSONObjectValue->TLJsonObjectValue + public TLVector Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // manual edit: TLJSONObjectValue->TLJsonObjectValue + Value = (TLVector)ObjectUtils.DeserializeVector (br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Value, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLJsonObjectValue.cs b/src/TgSharp.TL/TL/TLJsonObjectValue.cs new file mode 100644 index 0000000..921b0fd --- /dev/null +++ b/src/TgSharp.TL/TL/TLJsonObjectValue.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1059185703)] + public class TLJsonObjectValue : TLObject + { + public override int Constructor + { + get + { + return -1059185703; + } + } + + public string Key { get; set; } + public TLAbsJSONValue Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Key = StringUtil.Deserialize(br); + Value = (TLAbsJSONValue)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Key, bw); + ObjectUtils.SerializeObject(Value, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLJsonString.cs b/src/TgSharp.TL/TL/TLJsonString.cs new file mode 100644 index 0000000..43ae77b --- /dev/null +++ b/src/TgSharp.TL/TL/TLJsonString.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1222740358)] + public class TLJsonString : TLAbsJSONValue + { + public override int Constructor + { + get + { + return -1222740358; + } + } + + public string Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Value = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Value, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLKeyboardButton.cs b/src/TgSharp.TL/TL/TLKeyboardButton.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLKeyboardButton.cs rename to src/TgSharp.TL/TL/TLKeyboardButton.cs index 136e124..de0108e 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButton.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButton.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1560655744)] public class TLKeyboardButton : TLAbsKeyboardButton @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonBuy.cs b/src/TgSharp.TL/TL/TLKeyboardButtonBuy.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLKeyboardButtonBuy.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonBuy.cs index 8fb0d66..bdf6b83 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonBuy.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonBuy.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1344716869)] public class TLKeyboardButtonBuy : TLAbsKeyboardButton @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs b/src/TgSharp.TL/TL/TLKeyboardButtonCallback.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonCallback.cs index 6562f46..1fcf142 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonCallback.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonCallback.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1748655686)] public class TLKeyboardButtonCallback : TLAbsKeyboardButton @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Text { get; set; } public byte[] Data { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); Data = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Text, bw); BytesUtil.Serialize(Data, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonGame.cs b/src/TgSharp.TL/TL/TLKeyboardButtonGame.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLKeyboardButtonGame.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonGame.cs index fc400ae..c445fa5 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonGame.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1358175439)] public class TLKeyboardButtonGame : TLAbsKeyboardButton @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs b/src/TgSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs index 1c4b0f5..02a4fa2 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonRequestGeoLocation.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-59151553)] public class TLKeyboardButtonRequestGeoLocation : TLAbsKeyboardButton @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs b/src/TgSharp.TL/TL/TLKeyboardButtonRequestPhone.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonRequestPhone.cs index 4000b38..6824864 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonRequestPhone.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonRequestPhone.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1318425559)] public class TLKeyboardButtonRequestPhone : TLAbsKeyboardButton @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonRow.cs b/src/TgSharp.TL/TL/TLKeyboardButtonRow.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLKeyboardButtonRow.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonRow.cs index 6135703..ed1db8d 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonRow.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonRow.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2002815875)] public class TLKeyboardButtonRow : TLObject @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Buttons { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Buttons = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Buttons, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs b/src/TgSharp.TL/TL/TLKeyboardButtonSwitchInline.cs similarity index 87% rename from src/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonSwitchInline.cs index ba06ddb..f46f0d5 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonSwitchInline.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonSwitchInline.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(90744648)] public class TLKeyboardButtonSwitchInline : TLAbsKeyboardButton @@ -23,12 +25,9 @@ namespace TeleSharp.TL public string Text { get; set; } public string Query { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = SamePeer ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,18 +36,14 @@ namespace TeleSharp.TL SamePeer = (Flags & 1) != 0; Text = StringUtil.Deserialize(br); Query = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - StringUtil.Serialize(Text, bw); StringUtil.Serialize(Query, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs b/src/TgSharp.TL/TL/TLKeyboardButtonUrl.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs rename to src/TgSharp.TL/TL/TLKeyboardButtonUrl.cs index 3c7930c..e77a86c 100644 --- a/src/TeleSharp.TL/TL/TLKeyboardButtonUrl.cs +++ b/src/TgSharp.TL/TL/TLKeyboardButtonUrl.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(629866245)] public class TLKeyboardButtonUrl : TLAbsKeyboardButton @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Text { get; set; } public string Url { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); Url = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Text, bw); StringUtil.Serialize(Url, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLKeyboardButtonUrlAuth.cs b/src/TgSharp.TL/TL/TLKeyboardButtonUrlAuth.cs new file mode 100644 index 0000000..566f695 --- /dev/null +++ b/src/TgSharp.TL/TL/TLKeyboardButtonUrlAuth.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(280464681)] + public class TLKeyboardButtonUrlAuth : TLAbsKeyboardButton + { + public override int Constructor + { + get + { + return 280464681; + } + } + + public int Flags { get; set; } + public string Text { get; set; } + public string FwdText { get; set; } + public string Url { get; set; } + public int ButtonId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Text = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + FwdText = StringUtil.Deserialize(br); + else + FwdText = null; + + Url = StringUtil.Deserialize(br); + ButtonId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Text, bw); + if ((Flags & 1) != 0) + StringUtil.Serialize(FwdText, bw); + StringUtil.Serialize(Url, bw); + bw.Write(ButtonId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLLabeledPrice.cs b/src/TgSharp.TL/TL/TLLabeledPrice.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLLabeledPrice.cs rename to src/TgSharp.TL/TL/TLLabeledPrice.cs index b9e17a3..56b27d3 100644 --- a/src/TeleSharp.TL/TL/TLLabeledPrice.cs +++ b/src/TgSharp.TL/TL/TLLabeledPrice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-886477832)] public class TLLabeledPrice : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Label { get; set; } public long Amount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Label = StringUtil.Deserialize(br); Amount = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Label, bw); bw.Write(Amount); - } } } diff --git a/src/TgSharp.TL/TL/TLLangPackDifference.cs b/src/TgSharp.TL/TL/TLLangPackDifference.cs new file mode 100644 index 0000000..b083507 --- /dev/null +++ b/src/TgSharp.TL/TL/TLLangPackDifference.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-209337866)] + public class TLLangPackDifference : TLObject + { + public override int Constructor + { + get + { + return -209337866; + } + } + + public string LangCode { get; set; } + public int FromVersion { get; set; } + public int Version { get; set; } + public TLVector Strings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCode = StringUtil.Deserialize(br); + FromVersion = br.ReadInt32(); + Version = br.ReadInt32(); + Strings = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangCode, bw); + bw.Write(FromVersion); + bw.Write(Version); + ObjectUtils.SerializeObject(Strings, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLLangPackLanguage.cs b/src/TgSharp.TL/TL/TLLangPackLanguage.cs new file mode 100644 index 0000000..2186b3c --- /dev/null +++ b/src/TgSharp.TL/TL/TLLangPackLanguage.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-288727837)] + public class TLLangPackLanguage : TLObject + { + public override int Constructor + { + get + { + return -288727837; + } + } + + public int Flags { get; set; } + public bool Official { get; set; } + public bool Rtl { get; set; } + public bool Beta { get; set; } + public string Name { get; set; } + public string NativeName { get; set; } + public string LangCode { get; set; } + public string BaseLangCode { get; set; } + public string PluralCode { get; set; } + public int StringsCount { get; set; } + public int TranslatedCount { get; set; } + public string TranslationsUrl { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Official = (Flags & 1) != 0; + Rtl = (Flags & 4) != 0; + Beta = (Flags & 8) != 0; + Name = StringUtil.Deserialize(br); + NativeName = StringUtil.Deserialize(br); + LangCode = StringUtil.Deserialize(br); + if ((Flags & 2) != 0) + BaseLangCode = StringUtil.Deserialize(br); + else + BaseLangCode = null; + + PluralCode = StringUtil.Deserialize(br); + StringsCount = br.ReadInt32(); + TranslatedCount = br.ReadInt32(); + TranslationsUrl = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Name, bw); + StringUtil.Serialize(NativeName, bw); + StringUtil.Serialize(LangCode, bw); + if ((Flags & 2) != 0) + StringUtil.Serialize(BaseLangCode, bw); + StringUtil.Serialize(PluralCode, bw); + bw.Write(StringsCount); + bw.Write(TranslatedCount); + StringUtil.Serialize(TranslationsUrl, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLLangPackString.cs b/src/TgSharp.TL/TL/TLLangPackString.cs new file mode 100644 index 0000000..deded9a --- /dev/null +++ b/src/TgSharp.TL/TL/TLLangPackString.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-892239370)] + public class TLLangPackString : TLAbsLangPackString + { + public override int Constructor + { + get + { + return -892239370; + } + } + + public string Key { get; set; } + public string Value { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Key = StringUtil.Deserialize(br); + Value = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Key, bw); + StringUtil.Serialize(Value, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLLangPackStringDeleted.cs b/src/TgSharp.TL/TL/TLLangPackStringDeleted.cs new file mode 100644 index 0000000..754c86f --- /dev/null +++ b/src/TgSharp.TL/TL/TLLangPackStringDeleted.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(695856818)] + public class TLLangPackStringDeleted : TLAbsLangPackString + { + public override int Constructor + { + get + { + return 695856818; + } + } + + public string Key { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Key = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Key, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLLangPackStringPluralized.cs b/src/TgSharp.TL/TL/TLLangPackStringPluralized.cs new file mode 100644 index 0000000..0d4c172 --- /dev/null +++ b/src/TgSharp.TL/TL/TLLangPackStringPluralized.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1816636575)] + public class TLLangPackStringPluralized : TLAbsLangPackString + { + public override int Constructor + { + get + { + return 1816636575; + } + } + + public int Flags { get; set; } + public string Key { get; set; } + public string ZeroValue { get; set; } + public string OneValue { get; set; } + public string TwoValue { get; set; } + public string FewValue { get; set; } + public string ManyValue { get; set; } + public string OtherValue { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Key = StringUtil.Deserialize(br); + if ((Flags & 1) != 0) + ZeroValue = StringUtil.Deserialize(br); + else + ZeroValue = null; + + if ((Flags & 2) != 0) + OneValue = StringUtil.Deserialize(br); + else + OneValue = null; + + if ((Flags & 4) != 0) + TwoValue = StringUtil.Deserialize(br); + else + TwoValue = null; + + if ((Flags & 8) != 0) + FewValue = StringUtil.Deserialize(br); + else + FewValue = null; + + if ((Flags & 16) != 0) + ManyValue = StringUtil.Deserialize(br); + else + ManyValue = null; + + OtherValue = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Key, bw); + if ((Flags & 1) != 0) + StringUtil.Serialize(ZeroValue, bw); + if ((Flags & 2) != 0) + StringUtil.Serialize(OneValue, bw); + if ((Flags & 4) != 0) + StringUtil.Serialize(TwoValue, bw); + if ((Flags & 8) != 0) + StringUtil.Serialize(FewValue, bw); + if ((Flags & 16) != 0) + StringUtil.Serialize(ManyValue, bw); + StringUtil.Serialize(OtherValue, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMaskCoords.cs b/src/TgSharp.TL/TL/TLMaskCoords.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMaskCoords.cs rename to src/TgSharp.TL/TL/TLMaskCoords.cs index a8f7e5a..d016854 100644 --- a/src/TeleSharp.TL/TL/TLMaskCoords.cs +++ b/src/TgSharp.TL/TL/TLMaskCoords.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1361650766)] public class TLMaskCoords : TLObject @@ -23,10 +25,9 @@ namespace TeleSharp.TL public double Y { get; set; } public double Zoom { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL X = br.ReadDouble(); Y = br.ReadDouble(); Zoom = br.ReadDouble(); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(X); bw.Write(Y); bw.Write(Zoom); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessage.cs b/src/TgSharp.TL/TL/TLMessage.cs similarity index 75% rename from src/TeleSharp.TL/TL/TLMessage.cs rename to src/TgSharp.TL/TL/TLMessage.cs index dd3388e..dc2837b 100644 --- a/src/TeleSharp.TL/TL/TLMessage.cs +++ b/src/TgSharp.TL/TL/TLMessage.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1063525281)] + [TLObject(1160515173)] public class TLMessage : TLAbsMessage { public override int Constructor { get { - return -1063525281; + return 1160515173; } } @@ -24,6 +26,9 @@ namespace TeleSharp.TL public bool MediaUnread { get; set; } public bool Silent { get; set; } public bool Post { get; set; } + public bool FromScheduled { get; set; } + public bool Legacy { get; set; } + public bool EditHide { get; set; } public int Id { get; set; } public int? FromId { get; set; } public TLAbsPeer ToId { get; set; } @@ -37,26 +42,13 @@ namespace TeleSharp.TL public TLVector Entities { get; set; } public int? Views { get; set; } public int? EditDate { get; set; } - + public string PostAuthor { get; set; } + public long? GroupedId { get; set; } + public TLVector RestrictionReason { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Out ? (Flags | 2) : (Flags & ~2); - Flags = Mentioned ? (Flags | 16) : (Flags & ~16); - Flags = MediaUnread ? (Flags | 32) : (Flags & ~32); - Flags = Silent ? (Flags | 8192) : (Flags & ~8192); - Flags = Post ? (Flags | 16384) : (Flags & ~16384); - Flags = FromId != null ? (Flags | 256) : (Flags & ~256); - Flags = FwdFrom != null ? (Flags | 4) : (Flags & ~4); - Flags = ViaBotId != null ? (Flags | 2048) : (Flags & ~2048); - Flags = ReplyToMsgId != null ? (Flags | 8) : (Flags & ~8); - Flags = Media != null ? (Flags | 512) : (Flags & ~512); - Flags = ReplyMarkup != null ? (Flags | 64) : (Flags & ~64); - Flags = Entities != null ? (Flags | 128) : (Flags & ~128); - Flags = Views != null ? (Flags | 1024) : (Flags & ~1024); - Flags = EditDate != null ? (Flags | 32768) : (Flags & ~32768); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -67,6 +59,9 @@ namespace TeleSharp.TL MediaUnread = (Flags & 32) != 0; Silent = (Flags & 8192) != 0; Post = (Flags & 16384) != 0; + FromScheduled = (Flags & 262144) != 0; + Legacy = (Flags & 524288) != 0; + EditHide = (Flags & 2097152) != 0; Id = br.ReadInt32(); if ((Flags & 256) != 0) FromId = br.ReadInt32(); @@ -116,19 +111,27 @@ namespace TeleSharp.TL else EditDate = null; + if ((Flags & 65536) != 0) + PostAuthor = StringUtil.Deserialize(br); + else + PostAuthor = null; + + if ((Flags & 131072) != 0) + GroupedId = br.ReadInt64(); + else + GroupedId = null; + + if ((Flags & 4194304) != 0) + RestrictionReason = (TLVector)ObjectUtils.DeserializeVector(br); + else + RestrictionReason = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - - bw.Write(Id); if ((Flags & 256) != 0) bw.Write(FromId.Value); @@ -151,7 +154,12 @@ namespace TeleSharp.TL bw.Write(Views.Value); if ((Flags & 32768) != 0) bw.Write(EditDate.Value); - + if ((Flags & 65536) != 0) + StringUtil.Serialize(PostAuthor, bw); + if ((Flags & 131072) != 0) + bw.Write(GroupedId.Value); + if ((Flags & 4194304) != 0) + ObjectUtils.SerializeObject(RestrictionReason, bw); } } } diff --git a/src/TgSharp.TL/TL/TLMessageActionBotAllowed.cs b/src/TgSharp.TL/TL/TLMessageActionBotAllowed.cs new file mode 100644 index 0000000..2929470 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageActionBotAllowed.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1410748418)] + public class TLMessageActionBotAllowed : TLAbsMessageAction + { + public override int Constructor + { + get + { + return -1410748418; + } + } + + public string Domain { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Domain = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Domain, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs b/src/TgSharp.TL/TL/TLMessageActionChannelCreate.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs rename to src/TgSharp.TL/TL/TLMessageActionChannelCreate.cs index ae84575..42803dc 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChannelCreate.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChannelCreate.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1781355374)] public class TLMessageActionChannelCreate : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Title { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Title, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs b/src/TgSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs rename to src/TgSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs index d435233..4072e7a 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChannelMigrateFrom.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1336546578)] public class TLMessageActionChannelMigrateFrom : TLAbsMessageAction @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Title { get; set; } public int ChatId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Title = StringUtil.Deserialize(br); ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Title, bw); bw.Write(ChatId); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs b/src/TgSharp.TL/TL/TLMessageActionChatAddUser.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs rename to src/TgSharp.TL/TL/TLMessageActionChatAddUser.cs index ca83139..e4da340 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatAddUser.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatAddUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1217033015)] public class TLMessageActionChatAddUser : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatCreate.cs b/src/TgSharp.TL/TL/TLMessageActionChatCreate.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMessageActionChatCreate.cs rename to src/TgSharp.TL/TL/TLMessageActionChatCreate.cs index 7313499..c78046a 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatCreate.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatCreate.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1503425638)] public class TLMessageActionChatCreate : TLAbsMessageAction @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Title { get; set; } public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Title = StringUtil.Deserialize(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Title, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs b/src/TgSharp.TL/TL/TLMessageActionChatDeletePhoto.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs rename to src/TgSharp.TL/TL/TLMessageActionChatDeletePhoto.cs index e492513..ca346c4 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatDeletePhoto.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatDeletePhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1780220945)] public class TLMessageActionChatDeletePhoto : TLAbsMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs b/src/TgSharp.TL/TL/TLMessageActionChatDeleteUser.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs rename to src/TgSharp.TL/TL/TLMessageActionChatDeleteUser.cs index 51fc7b9..a14c271 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatDeleteUser.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatDeleteUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1297179892)] public class TLMessageActionChatDeleteUser : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int UserId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(UserId); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs b/src/TgSharp.TL/TL/TLMessageActionChatEditPhoto.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs rename to src/TgSharp.TL/TL/TLMessageActionChatEditPhoto.cs index 91ffe0a..64414f1 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatEditPhoto.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatEditPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2144015272)] public class TLMessageActionChatEditPhoto : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsPhoto Photo { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Photo, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs b/src/TgSharp.TL/TL/TLMessageActionChatEditTitle.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs rename to src/TgSharp.TL/TL/TLMessageActionChatEditTitle.cs index b939420..5c6618c 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatEditTitle.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatEditTitle.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1247687078)] public class TLMessageActionChatEditTitle : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Title { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Title, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs b/src/TgSharp.TL/TL/TLMessageActionChatJoinedByLink.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs rename to src/TgSharp.TL/TL/TLMessageActionChatJoinedByLink.cs index 1f19486..5305aa2 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatJoinedByLink.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatJoinedByLink.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-123931160)] public class TLMessageActionChatJoinedByLink : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int InviterId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { InviterId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(InviterId); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs b/src/TgSharp.TL/TL/TLMessageActionChatMigrateTo.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs rename to src/TgSharp.TL/TL/TLMessageActionChatMigrateTo.cs index b96c0db..1bb7e75 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionChatMigrateTo.cs +++ b/src/TgSharp.TL/TL/TLMessageActionChatMigrateTo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1371385889)] public class TLMessageActionChatMigrateTo : TLAbsMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int ChannelId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChannelId); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageActionContactSignUp.cs b/src/TgSharp.TL/TL/TLMessageActionContactSignUp.cs new file mode 100644 index 0000000..ff852e0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageActionContactSignUp.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-202219658)] + public class TLMessageActionContactSignUp : TLAbsMessageAction + { + public override int Constructor + { + get + { + return -202219658; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs b/src/TgSharp.TL/TL/TLMessageActionCustomAction.cs similarity index 62% rename from src/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs rename to src/TgSharp.TL/TL/TLMessageActionCustomAction.cs index 8ae9571..f9a637f 100644 --- a/src/TeleSharp.TL/TL/Messages/TLRequestGetWebPagePreview.cs +++ b/src/TgSharp.TL/TL/TLMessageActionCustomAction.cs @@ -4,45 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Messages + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(623001124)] - public class TLRequestGetWebPagePreview : TLMethod + [TLObject(-85549226)] + public class TLMessageActionCustomAction : TLAbsMessageAction { public override int Constructor { get { - return 623001124; + return -85549226; } } public string Message { get; set; } - public TLAbsMessageMedia Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Message = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Message, bw); - - } - public override void DeserializeResponse(BinaryReader br) - { - Response = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionEmpty.cs b/src/TgSharp.TL/TL/TLMessageActionEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageActionEmpty.cs rename to src/TgSharp.TL/TL/TLMessageActionEmpty.cs index 81ce4fe..99f0c6e 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionEmpty.cs +++ b/src/TgSharp.TL/TL/TLMessageActionEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1230047312)] public class TLMessageActionEmpty : TLAbsMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionGameScore.cs b/src/TgSharp.TL/TL/TLMessageActionGameScore.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageActionGameScore.cs rename to src/TgSharp.TL/TL/TLMessageActionGameScore.cs index 02a7edb..4477a75 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionGameScore.cs +++ b/src/TgSharp.TL/TL/TLMessageActionGameScore.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1834538890)] public class TLMessageActionGameScore : TLAbsMessageAction @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long GameId { get; set; } public int Score { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { GameId = br.ReadInt64(); Score = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(GameId); bw.Write(Score); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs b/src/TgSharp.TL/TL/TLMessageActionHistoryClear.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs rename to src/TgSharp.TL/TL/TLMessageActionHistoryClear.cs index 9d4a752..4e1131f 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionHistoryClear.cs +++ b/src/TgSharp.TL/TL/TLMessageActionHistoryClear.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1615153660)] public class TLMessageActionHistoryClear : TLAbsMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionPaymentSent.cs b/src/TgSharp.TL/TL/TLMessageActionPaymentSent.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMessageActionPaymentSent.cs rename to src/TgSharp.TL/TL/TLMessageActionPaymentSent.cs index 8c25a56..e16850e 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionPaymentSent.cs +++ b/src/TgSharp.TL/TL/TLMessageActionPaymentSent.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1080663248)] public class TLMessageActionPaymentSent : TLAbsMessageAction @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Currency { get; set; } public long TotalAmount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Currency = StringUtil.Deserialize(br); TotalAmount = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Currency, bw); bw.Write(TotalAmount); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionPaymentSentMe.cs b/src/TgSharp.TL/TL/TLMessageActionPaymentSentMe.cs similarity index 89% rename from src/TeleSharp.TL/TL/TLMessageActionPaymentSentMe.cs rename to src/TgSharp.TL/TL/TLMessageActionPaymentSentMe.cs index 229cb13..c12c17b 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionPaymentSentMe.cs +++ b/src/TgSharp.TL/TL/TLMessageActionPaymentSentMe.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1892568281)] public class TLMessageActionPaymentSentMe : TLAbsMessageAction @@ -26,13 +28,9 @@ namespace TeleSharp.TL public string ShippingOptionId { get; set; } public TLPaymentCharge Charge { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Info != null ? (Flags | 1) : (Flags & ~1); - Flags = ShippingOptionId != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -52,13 +50,11 @@ namespace TeleSharp.TL ShippingOptionId = null; Charge = (TLPaymentCharge)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); StringUtil.Serialize(Currency, bw); bw.Write(TotalAmount); @@ -68,7 +64,6 @@ namespace TeleSharp.TL if ((Flags & 2) != 0) StringUtil.Serialize(ShippingOptionId, bw); ObjectUtils.SerializeObject(Charge, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionPhoneCall.cs b/src/TgSharp.TL/TL/TLMessageActionPhoneCall.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLMessageActionPhoneCall.cs rename to src/TgSharp.TL/TL/TLMessageActionPhoneCall.cs index 5352869..6ab6d48 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionPhoneCall.cs +++ b/src/TgSharp.TL/TL/TLMessageActionPhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2132731265)] public class TLMessageActionPhoneCall : TLAbsMessageAction @@ -19,22 +21,20 @@ namespace TeleSharp.TL } public int Flags { get; set; } + public bool Video { get; set; } public long CallId { get; set; } public TLAbsPhoneCallDiscardReason Reason { get; set; } public int? Duration { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Reason != null ? (Flags | 1) : (Flags & ~1); - Flags = Duration != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); + Video = (Flags & 4) != 0; CallId = br.ReadInt64(); if ((Flags & 1) != 0) Reason = (TLAbsPhoneCallDiscardReason)ObjectUtils.DeserializeObject(br); @@ -46,20 +46,17 @@ namespace TeleSharp.TL else Duration = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(CallId); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Reason, bw); if ((Flags & 2) != 0) bw.Write(Duration.Value); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageActionPinMessage.cs b/src/TgSharp.TL/TL/TLMessageActionPinMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageActionPinMessage.cs rename to src/TgSharp.TL/TL/TLMessageActionPinMessage.cs index 411d057..c431003 100644 --- a/src/TeleSharp.TL/TL/TLMessageActionPinMessage.cs +++ b/src/TgSharp.TL/TL/TLMessageActionPinMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1799538451)] public class TLMessageActionPinMessage : TLAbsMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLMessageActionScreenshotTaken.cs b/src/TgSharp.TL/TL/TLMessageActionScreenshotTaken.cs new file mode 100644 index 0000000..7a32dd8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageActionScreenshotTaken.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1200788123)] + public class TLMessageActionScreenshotTaken : TLAbsMessageAction + { + public override int Constructor + { + get + { + return 1200788123; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLMessageActionSecureValuesSent.cs b/src/TgSharp.TL/TL/TLMessageActionSecureValuesSent.cs new file mode 100644 index 0000000..d3a8746 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageActionSecureValuesSent.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-648257196)] + public class TLMessageActionSecureValuesSent : TLAbsMessageAction + { + public override int Constructor + { + get + { + return -648257196; + } + } + + public TLVector Types { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Types = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Types, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLMessageActionSecureValuesSentMe.cs b/src/TgSharp.TL/TL/TLMessageActionSecureValuesSentMe.cs new file mode 100644 index 0000000..10e7153 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageActionSecureValuesSentMe.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(455635795)] + public class TLMessageActionSecureValuesSentMe : TLAbsMessageAction + { + public override int Constructor + { + get + { + return 455635795; + } + } + + public TLVector Values { get; set; } + public TLSecureCredentialsEncrypted Credentials { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Values = (TLVector)ObjectUtils.DeserializeVector(br); + Credentials = (TLSecureCredentialsEncrypted)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Values, bw); + ObjectUtils.SerializeObject(Credentials, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageEmpty.cs b/src/TgSharp.TL/TL/TLMessageEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLMessageEmpty.cs rename to src/TgSharp.TL/TL/TLMessageEmpty.cs index f31d02d..048f11a 100644 --- a/src/TeleSharp.TL/TL/TLMessageEmpty.cs +++ b/src/TgSharp.TL/TL/TLMessageEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2082087340)] public class TLMessageEmpty : TLAbsMessage @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageEntityBlockquote.cs b/src/TgSharp.TL/TL/TLMessageEntityBlockquote.cs new file mode 100644 index 0000000..e4dfedf --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageEntityBlockquote.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(34469328)] + public class TLMessageEntityBlockquote : TLAbsMessageEntity + { + public override int Constructor + { + get + { + return 34469328; + } + } + + public int Offset { get; set; } + public int Length { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + Length = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + bw.Write(Length); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageEntityBold.cs b/src/TgSharp.TL/TL/TLMessageEntityBold.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityBold.cs rename to src/TgSharp.TL/TL/TLMessageEntityBold.cs index a6bea76..a535578 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityBold.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityBold.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1117713463)] public class TLMessageEntityBold : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs b/src/TgSharp.TL/TL/TLMessageEntityBotCommand.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs rename to src/TgSharp.TL/TL/TLMessageEntityBotCommand.cs index 450e5b7..121cc98 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityBotCommand.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityBotCommand.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1827637959)] public class TLMessageEntityBotCommand : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageEntityCashtag.cs b/src/TgSharp.TL/TL/TLMessageEntityCashtag.cs new file mode 100644 index 0000000..ab974be --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageEntityCashtag.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1280209983)] + public class TLMessageEntityCashtag : TLAbsMessageEntity + { + public override int Constructor + { + get + { + return 1280209983; + } + } + + public int Offset { get; set; } + public int Length { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + Length = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + bw.Write(Length); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageEntityCode.cs b/src/TgSharp.TL/TL/TLMessageEntityCode.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityCode.cs rename to src/TgSharp.TL/TL/TLMessageEntityCode.cs index ab4d9c1..6192b80 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityCode.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityCode.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(681706865)] public class TLMessageEntityCode : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityEmail.cs b/src/TgSharp.TL/TL/TLMessageEntityEmail.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityEmail.cs rename to src/TgSharp.TL/TL/TLMessageEntityEmail.cs index 0b9af5c..be9050e 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityEmail.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityEmail.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1692693954)] public class TLMessageEntityEmail : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityHashtag.cs b/src/TgSharp.TL/TL/TLMessageEntityHashtag.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityHashtag.cs rename to src/TgSharp.TL/TL/TLMessageEntityHashtag.cs index 3d4b26a..22da079 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityHashtag.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityHashtag.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1868782349)] public class TLMessageEntityHashtag : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityItalic.cs b/src/TgSharp.TL/TL/TLMessageEntityItalic.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityItalic.cs rename to src/TgSharp.TL/TL/TLMessageEntityItalic.cs index eca2f38..896b2e8 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityItalic.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityItalic.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2106619040)] public class TLMessageEntityItalic : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityMention.cs b/src/TgSharp.TL/TL/TLMessageEntityMention.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityMention.cs rename to src/TgSharp.TL/TL/TLMessageEntityMention.cs index c6650d2..75aaeee 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityMention.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityMention.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-100378723)] public class TLMessageEntityMention : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityMentionName.cs b/src/TgSharp.TL/TL/TLMessageEntityMentionName.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMessageEntityMentionName.cs rename to src/TgSharp.TL/TL/TLMessageEntityMentionName.cs index 0b865dc..3eba8d2 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityMentionName.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityMentionName.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(892193368)] public class TLMessageEntityMentionName : TLAbsMessageEntity @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Length { get; set; } public int UserId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Offset = br.ReadInt32(); Length = br.ReadInt32(); UserId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Offset); bw.Write(Length); bw.Write(UserId); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageEntityPhone.cs b/src/TgSharp.TL/TL/TLMessageEntityPhone.cs new file mode 100644 index 0000000..152eb69 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageEntityPhone.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1687559349)] + public class TLMessageEntityPhone : TLAbsMessageEntity + { + public override int Constructor + { + get + { + return -1687559349; + } + } + + public int Offset { get; set; } + public int Length { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + Length = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + bw.Write(Length); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageEntityPre.cs b/src/TgSharp.TL/TL/TLMessageEntityPre.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMessageEntityPre.cs rename to src/TgSharp.TL/TL/TLMessageEntityPre.cs index 9aa2a2c..5a8f1a1 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityPre.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityPre.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1938967520)] public class TLMessageEntityPre : TLAbsMessageEntity @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Length { get; set; } public string Language { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Offset = br.ReadInt32(); Length = br.ReadInt32(); Language = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Offset); bw.Write(Length); StringUtil.Serialize(Language, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageEntityStrike.cs b/src/TgSharp.TL/TL/TLMessageEntityStrike.cs new file mode 100644 index 0000000..7105a3f --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageEntityStrike.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1090087980)] + public class TLMessageEntityStrike : TLAbsMessageEntity + { + public override int Constructor + { + get + { + return -1090087980; + } + } + + public int Offset { get; set; } + public int Length { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + Length = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + bw.Write(Length); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs b/src/TgSharp.TL/TL/TLMessageEntityTextUrl.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs rename to src/TgSharp.TL/TL/TLMessageEntityTextUrl.cs index 9de741d..ace24a2 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityTextUrl.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityTextUrl.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1990644519)] public class TLMessageEntityTextUrl : TLAbsMessageEntity @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Length { get; set; } public string Url { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Offset = br.ReadInt32(); Length = br.ReadInt32(); Url = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(Offset); bw.Write(Length); StringUtil.Serialize(Url, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageEntityUnderline.cs b/src/TgSharp.TL/TL/TLMessageEntityUnderline.cs new file mode 100644 index 0000000..aa89017 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageEntityUnderline.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1672577397)] + public class TLMessageEntityUnderline : TLAbsMessageEntity + { + public override int Constructor + { + get + { + return -1672577397; + } + } + + public int Offset { get; set; } + public int Length { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Offset = br.ReadInt32(); + Length = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Offset); + bw.Write(Length); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageEntityUnknown.cs b/src/TgSharp.TL/TL/TLMessageEntityUnknown.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityUnknown.cs rename to src/TgSharp.TL/TL/TLMessageEntityUnknown.cs index faeeaba..77b851d 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityUnknown.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityUnknown.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1148011883)] public class TLMessageEntityUnknown : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageEntityUrl.cs b/src/TgSharp.TL/TL/TLMessageEntityUrl.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageEntityUrl.cs rename to src/TgSharp.TL/TL/TLMessageEntityUrl.cs index 8e6d7cb..353b337 100644 --- a/src/TeleSharp.TL/TL/TLMessageEntityUrl.cs +++ b/src/TgSharp.TL/TL/TLMessageEntityUrl.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1859134776)] public class TLMessageEntityUrl : TLAbsMessageEntity @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Offset { get; set; } public int Length { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Offset = br.ReadInt32(); Length = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Offset); bw.Write(Length); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageFwdHeader.cs b/src/TgSharp.TL/TL/TLMessageFwdHeader.cs similarity index 54% rename from src/TeleSharp.TL/TL/TLMessageFwdHeader.cs rename to src/TgSharp.TL/TL/TLMessageFwdHeader.cs index 622bd0c..897884a 100644 --- a/src/TeleSharp.TL/TL/TLMessageFwdHeader.cs +++ b/src/TgSharp.TL/TL/TLMessageFwdHeader.cs @@ -4,34 +4,35 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-947462709)] + [TLObject(-332168592)] public class TLMessageFwdHeader : TLObject { public override int Constructor { get { - return -947462709; + return -332168592; } } public int Flags { get; set; } public int? FromId { get; set; } + public string FromName { get; set; } public int Date { get; set; } public int? ChannelId { get; set; } public int? ChannelPost { get; set; } - + public string PostAuthor { get; set; } + public TLAbsPeer SavedFromPeer { get; set; } + public int? SavedFromMsgId { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = FromId != null ? (Flags | 1) : (Flags & ~1); - Flags = ChannelId != null ? (Flags | 2) : (Flags & ~2); - Flags = ChannelPost != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,6 +43,11 @@ namespace TeleSharp.TL else FromId = null; + if ((Flags & 32) != 0) + FromName = StringUtil.Deserialize(br); + else + FromName = null; + Date = br.ReadInt32(); if ((Flags & 2) != 0) ChannelId = br.ReadInt32(); @@ -53,22 +59,42 @@ namespace TeleSharp.TL else ChannelPost = null; + if ((Flags & 8) != 0) + PostAuthor = StringUtil.Deserialize(br); + else + PostAuthor = null; + + if ((Flags & 16) != 0) + SavedFromPeer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + else + SavedFromPeer = null; + + if ((Flags & 16) != 0) + SavedFromMsgId = br.ReadInt32(); + else + SavedFromMsgId = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 1) != 0) bw.Write(FromId.Value); + if ((Flags & 32) != 0) + StringUtil.Serialize(FromName, bw); bw.Write(Date); if ((Flags & 2) != 0) bw.Write(ChannelId.Value); if ((Flags & 4) != 0) bw.Write(ChannelPost.Value); - + if ((Flags & 8) != 0) + StringUtil.Serialize(PostAuthor, bw); + if ((Flags & 16) != 0) + ObjectUtils.SerializeObject(SavedFromPeer, bw); + if ((Flags & 16) != 0) + bw.Write(SavedFromMsgId.Value); } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaContact.cs b/src/TgSharp.TL/TL/TLMessageMediaContact.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLMessageMediaContact.cs rename to src/TgSharp.TL/TL/TLMessageMediaContact.cs index 1a5c8aa..99691c2 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaContact.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaContact.cs @@ -4,29 +4,31 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1585262393)] + [TLObject(-873313984)] public class TLMessageMediaContact : TLAbsMessageMedia { public override int Constructor { get { - return 1585262393; + return -873313984; } } public string PhoneNumber { get; set; } public string FirstName { get; set; } public string LastName { get; set; } + public string Vcard { get; set; } public int UserId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,8 +36,8 @@ namespace TeleSharp.TL PhoneNumber = StringUtil.Deserialize(br); FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); + Vcard = StringUtil.Deserialize(br); UserId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -44,8 +46,8 @@ namespace TeleSharp.TL StringUtil.Serialize(PhoneNumber, bw); StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); + StringUtil.Serialize(Vcard, bw); bw.Write(UserId); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageMediaDocument.cs b/src/TgSharp.TL/TL/TLMessageMediaDocument.cs new file mode 100644 index 0000000..be61fc2 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageMediaDocument.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1666158377)] + public class TLMessageMediaDocument : TLAbsMessageMedia + { + public override int Constructor + { + get + { + return -1666158377; + } + } + + public int Flags { get; set; } + public TLAbsDocument Document { get; set; } + public int? TtlSeconds { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); + else + Document = null; + + if ((Flags & 4) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Document, bw); + if ((Flags & 4) != 0) + bw.Write(TtlSeconds.Value); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageMediaEmpty.cs b/src/TgSharp.TL/TL/TLMessageMediaEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageMediaEmpty.cs rename to src/TgSharp.TL/TL/TLMessageMediaEmpty.cs index 46e3443..07ea9f9 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaEmpty.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1038967584)] public class TLMessageMediaEmpty : TLAbsMessageMedia @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaGame.cs b/src/TgSharp.TL/TL/TLMessageMediaGame.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageMediaGame.cs rename to src/TgSharp.TL/TL/TLMessageMediaGame.cs index 6301f5f..33e105a 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaGame.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaGame.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-38694904)] public class TLMessageMediaGame : TLAbsMessageMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLGame Game { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Game = (TLGame)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Game, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaGeo.cs b/src/TgSharp.TL/TL/TLMessageMediaGeo.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageMediaGeo.cs rename to src/TgSharp.TL/TL/TLMessageMediaGeo.cs index fb60573..e445310 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaGeo.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaGeo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1457575028)] public class TLMessageMediaGeo : TLAbsMessageMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsGeoPoint Geo { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Geo, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageMediaGeoLive.cs b/src/TgSharp.TL/TL/TLMessageMediaGeoLive.cs new file mode 100644 index 0000000..27bca87 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageMediaGeoLive.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(2084316681)] + public class TLMessageMediaGeoLive : TLAbsMessageMedia + { + public override int Constructor + { + get + { + return 2084316681; + } + } + + public TLAbsGeoPoint Geo { get; set; } + public int Period { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); + Period = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Geo, bw); + bw.Write(Period); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLMessageMediaInvoice.cs b/src/TgSharp.TL/TL/TLMessageMediaInvoice.cs similarity index 80% rename from src/TeleSharp.TL/TL/TLMessageMediaInvoice.cs rename to src/TgSharp.TL/TL/TLMessageMediaInvoice.cs index 81a65eb..bce7b90 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaInvoice.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaInvoice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2074799289)] public class TLMessageMediaInvoice : TLAbsMessageMedia @@ -23,21 +25,15 @@ namespace TeleSharp.TL public bool Test { get; set; } public string Title { get; set; } public string Description { get; set; } - public TLWebDocument Photo { get; set; } + public TLAbsWebDocument Photo { get; set; } public int? ReceiptMsgId { get; set; } public string Currency { get; set; } public long TotalAmount { get; set; } public string StartParam { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ShippingAddressRequested ? (Flags | 2) : (Flags & ~2); - Flags = Test ? (Flags | 8) : (Flags & ~8); - Flags = Photo != null ? (Flags | 1) : (Flags & ~1); - Flags = ReceiptMsgId != null ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -48,7 +44,7 @@ namespace TeleSharp.TL Title = StringUtil.Deserialize(br); Description = StringUtil.Deserialize(br); if ((Flags & 1) != 0) - Photo = (TLWebDocument)ObjectUtils.DeserializeObject(br); + Photo = (TLAbsWebDocument)ObjectUtils.DeserializeObject(br); else Photo = null; @@ -60,16 +56,12 @@ namespace TeleSharp.TL Currency = StringUtil.Deserialize(br); TotalAmount = br.ReadInt64(); StartParam = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - StringUtil.Serialize(Title, bw); StringUtil.Serialize(Description, bw); if ((Flags & 1) != 0) @@ -79,7 +71,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Currency, bw); bw.Write(TotalAmount); StringUtil.Serialize(StartParam, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLMessageMediaPhoto.cs b/src/TgSharp.TL/TL/TLMessageMediaPhoto.cs new file mode 100644 index 0000000..fb5f411 --- /dev/null +++ b/src/TgSharp.TL/TL/TLMessageMediaPhoto.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1766936791)] + public class TLMessageMediaPhoto : TLAbsMessageMedia + { + public override int Constructor + { + get + { + return 1766936791; + } + } + + public int Flags { get; set; } + public TLAbsPhoto Photo { get; set; } + public int? TtlSeconds { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); + else + Photo = null; + + if ((Flags & 4) != 0) + TtlSeconds = br.ReadInt32(); + else + TtlSeconds = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Photo, bw); + if ((Flags & 4) != 0) + bw.Write(TtlSeconds.Value); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantEditor.cs b/src/TgSharp.TL/TL/TLMessageMediaPoll.cs similarity index 53% rename from src/TeleSharp.TL/TL/TLChannelParticipantEditor.cs rename to src/TgSharp.TL/TL/TLMessageMediaPoll.cs index 5c0f9a1..5b281bf 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantEditor.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaPoll.cs @@ -4,45 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1743180447)] - public class TLChannelParticipantEditor : TLAbsChannelParticipant + [TLObject(1272375192)] + public class TLMessageMediaPoll : TLAbsMessageMedia { public override int Constructor { get { - return -1743180447; + return 1272375192; } } - public int UserId { get; set; } - public int InviterId { get; set; } - public int Date { get; set; } - + public TLPoll Poll { get; set; } + public TLPollResults Results { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - UserId = br.ReadInt32(); - InviterId = br.ReadInt32(); - Date = br.ReadInt32(); - + Poll = (TLPoll)ObjectUtils.DeserializeObject(br); + Results = (TLPollResults)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(UserId); - bw.Write(InviterId); - bw.Write(Date); - + ObjectUtils.SerializeObject(Poll, bw); + ObjectUtils.SerializeObject(Results, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs b/src/TgSharp.TL/TL/TLMessageMediaUnsupported.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs rename to src/TgSharp.TL/TL/TLMessageMediaUnsupported.cs index c5df2cb..e1a59db 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaUnsupported.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaUnsupported.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1618676578)] public class TLMessageMediaUnsupported : TLAbsMessageMedia @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaVenue.cs b/src/TgSharp.TL/TL/TLMessageMediaVenue.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLMessageMediaVenue.cs rename to src/TgSharp.TL/TL/TLMessageMediaVenue.cs index 6142128..50b515a 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaVenue.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaVenue.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(2031269663)] + [TLObject(784356159)] public class TLMessageMediaVenue : TLAbsMessageMedia { public override int Constructor { get { - return 2031269663; + return 784356159; } } @@ -23,11 +25,11 @@ namespace TeleSharp.TL public string Address { get; set; } public string Provider { get; set; } public string VenueId { get; set; } - + public string VenueType { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +39,7 @@ namespace TeleSharp.TL Address = StringUtil.Deserialize(br); Provider = StringUtil.Deserialize(br); VenueId = StringUtil.Deserialize(br); - + VenueType = StringUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +50,7 @@ namespace TeleSharp.TL StringUtil.Serialize(Address, bw); StringUtil.Serialize(Provider, bw); StringUtil.Serialize(VenueId, bw); - + StringUtil.Serialize(VenueType, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLMessageMediaWebPage.cs b/src/TgSharp.TL/TL/TLMessageMediaWebPage.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageMediaWebPage.cs rename to src/TgSharp.TL/TL/TLMessageMediaWebPage.cs index e974323..113eb89 100644 --- a/src/TeleSharp.TL/TL/TLMessageMediaWebPage.cs +++ b/src/TgSharp.TL/TL/TLMessageMediaWebPage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1557277184)] public class TLMessageMediaWebPage : TLAbsMessageMedia @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsWebPage Webpage { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Webpage = (TLAbsWebPage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Webpage, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageRange.cs b/src/TgSharp.TL/TL/TLMessageRange.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLMessageRange.cs rename to src/TgSharp.TL/TL/TLMessageRange.cs index c9fb91a..93b36ca 100644 --- a/src/TeleSharp.TL/TL/TLMessageRange.cs +++ b/src/TgSharp.TL/TL/TLMessageRange.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(182649427)] public class TLMessageRange : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int MinId { get; set; } public int MaxId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MinId = br.ReadInt32(); MaxId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(MinId); bw.Write(MaxId); - } } } diff --git a/src/TeleSharp.TL/TL/TLMessageService.cs b/src/TgSharp.TL/TL/TLMessageService.cs similarity index 80% rename from src/TeleSharp.TL/TL/TLMessageService.cs rename to src/TgSharp.TL/TL/TLMessageService.cs index ff16be2..d658089 100644 --- a/src/TeleSharp.TL/TL/TLMessageService.cs +++ b/src/TgSharp.TL/TL/TLMessageService.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1642487306)] public class TLMessageService : TLAbsMessage @@ -24,6 +26,7 @@ namespace TeleSharp.TL public bool MediaUnread { get; set; } public bool Silent { get; set; } public bool Post { get; set; } + public bool Legacy { get; set; } public int Id { get; set; } public int? FromId { get; set; } public TLAbsPeer ToId { get; set; } @@ -31,18 +34,9 @@ namespace TeleSharp.TL 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 = MediaUnread ? (Flags | 32) : (Flags & ~32); - Flags = Silent ? (Flags | 8192) : (Flags & ~8192); - Flags = Post ? (Flags | 16384) : (Flags & ~16384); - Flags = FromId != null ? (Flags | 256) : (Flags & ~256); - Flags = ReplyToMsgId != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -53,6 +47,7 @@ namespace TeleSharp.TL MediaUnread = (Flags & 32) != 0; Silent = (Flags & 8192) != 0; Post = (Flags & 16384) != 0; + Legacy = (Flags & 524288) != 0; Id = br.ReadInt32(); if ((Flags & 256) != 0) FromId = br.ReadInt32(); @@ -67,19 +62,12 @@ namespace TeleSharp.TL Date = br.ReadInt32(); Action = (TLAbsMessageAction)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - - bw.Write(Id); if ((Flags & 256) != 0) bw.Write(FromId.Value); @@ -88,7 +76,6 @@ namespace TeleSharp.TL bw.Write(ReplyToMsgId.Value); bw.Write(Date); ObjectUtils.SerializeObject(Action, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLNearestDc.cs b/src/TgSharp.TL/TL/TLNearestDc.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLNearestDc.cs rename to src/TgSharp.TL/TL/TLNearestDc.cs index 7344992..078f213 100644 --- a/src/TeleSharp.TL/TL/TLNearestDc.cs +++ b/src/TgSharp.TL/TL/TLNearestDc.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1910892683)] public class TLNearestDc : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int ThisDc { get; set; } public int NearestDc { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Country = StringUtil.Deserialize(br); ThisDc = br.ReadInt32(); NearestDc = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Country, bw); bw.Write(ThisDc); bw.Write(NearestDc); - } } } diff --git a/src/TgSharp.TL/TL/TLNotifyBroadcasts.cs b/src/TgSharp.TL/TL/TLNotifyBroadcasts.cs new file mode 100644 index 0000000..edb5c0a --- /dev/null +++ b/src/TgSharp.TL/TL/TLNotifyBroadcasts.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-703403793)] + public class TLNotifyBroadcasts : TLAbsNotifyPeer + { + public override int Constructor + { + get + { + return -703403793; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLNotifyChats.cs b/src/TgSharp.TL/TL/TLNotifyChats.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLNotifyChats.cs rename to src/TgSharp.TL/TL/TLNotifyChats.cs index 6707b8e..101a511 100644 --- a/src/TeleSharp.TL/TL/TLNotifyChats.cs +++ b/src/TgSharp.TL/TL/TLNotifyChats.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1073230141)] public class TLNotifyChats : TLAbsNotifyPeer @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLNotifyPeer.cs b/src/TgSharp.TL/TL/TLNotifyPeer.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLNotifyPeer.cs rename to src/TgSharp.TL/TL/TLNotifyPeer.cs index f1e86d8..2fb229f 100644 --- a/src/TeleSharp.TL/TL/TLNotifyPeer.cs +++ b/src/TgSharp.TL/TL/TLNotifyPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1613493288)] public class TLNotifyPeer : TLAbsNotifyPeer @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsPeer Peer { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLNotifyUsers.cs b/src/TgSharp.TL/TL/TLNotifyUsers.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLNotifyUsers.cs rename to src/TgSharp.TL/TL/TLNotifyUsers.cs index 5f08555..986bb36 100644 --- a/src/TeleSharp.TL/TL/TLNotifyUsers.cs +++ b/src/TgSharp.TL/TL/TLNotifyUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1261946036)] public class TLNotifyUsers : TLAbsNotifyPeer @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLNull.cs b/src/TgSharp.TL/TL/TLNull.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLNull.cs rename to src/TgSharp.TL/TL/TLNull.cs index 77473d2..b084af1 100644 --- a/src/TeleSharp.TL/TL/TLNull.cs +++ b/src/TgSharp.TL/TL/TLNull.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1450380236)] public class TLNull : TLObject @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLPage.cs b/src/TgSharp.TL/TL/TLPage.cs new file mode 100644 index 0000000..98bce8e --- /dev/null +++ b/src/TgSharp.TL/TL/TLPage.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1366746132)] + public class TLPage : TLObject + { + public override int Constructor + { + get + { + return -1366746132; + } + } + + public int Flags { get; set; } + public bool Part { get; set; } + public bool Rtl { get; set; } + public bool V2 { get; set; } + public string Url { get; set; } + public TLVector Blocks { get; set; } + public TLVector Photos { get; set; } + public TLVector Documents { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Part = (Flags & 1) != 0; + Rtl = (Flags & 2) != 0; + V2 = (Flags & 4) != 0; + Url = StringUtil.Deserialize(br); + Blocks = (TLVector)ObjectUtils.DeserializeVector(br); + Photos = (TLVector)ObjectUtils.DeserializeVector(br); + Documents = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Url, bw); + ObjectUtils.SerializeObject(Blocks, bw); + ObjectUtils.SerializeObject(Photos, bw); + ObjectUtils.SerializeObject(Documents, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPageBlockAnchor.cs b/src/TgSharp.TL/TL/TLPageBlockAnchor.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockAnchor.cs rename to src/TgSharp.TL/TL/TLPageBlockAnchor.cs index 8f6461e..70cf2bc 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockAnchor.cs +++ b/src/TgSharp.TL/TL/TLPageBlockAnchor.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-837994576)] public class TLPageBlockAnchor : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Name { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Name = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Name, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockPhoto.cs b/src/TgSharp.TL/TL/TLPageBlockAudio.cs similarity index 58% rename from src/TeleSharp.TL/TL/TLPageBlockPhoto.cs rename to src/TgSharp.TL/TL/TLPageBlockAudio.cs index d7f6a20..8623140 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockPhoto.cs +++ b/src/TgSharp.TL/TL/TLPageBlockAudio.cs @@ -4,42 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-372860542)] - public class TLPageBlockPhoto : TLAbsPageBlock + [TLObject(-2143067670)] + public class TLPageBlockAudio : TLAbsPageBlock { public override int Constructor { get { - return -372860542; + return -2143067670; } } - public long PhotoId { get; set; } - public TLAbsRichText Caption { get; set; } - + public long AudioId { get; set; } + public TLPageCaption Caption { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - PhotoId = br.ReadInt64(); - Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - + AudioId = br.ReadInt64(); + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(PhotoId); + bw.Write(AudioId); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockAuthorDate.cs b/src/TgSharp.TL/TL/TLPageBlockAuthorDate.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLPageBlockAuthorDate.cs rename to src/TgSharp.TL/TL/TLPageBlockAuthorDate.cs index 77c6444..e7d1da4 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockAuthorDate.cs +++ b/src/TgSharp.TL/TL/TLPageBlockAuthorDate.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1162877472)] public class TLPageBlockAuthorDate : TLAbsPageBlock @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsRichText Author { get; set; } public int PublishedDate { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Author = (TLAbsRichText)ObjectUtils.DeserializeObject(br); PublishedDate = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Author, bw); bw.Write(PublishedDate); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockBlockquote.cs b/src/TgSharp.TL/TL/TLPageBlockBlockquote.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLPageBlockBlockquote.cs rename to src/TgSharp.TL/TL/TLPageBlockBlockquote.cs index 4029cce..7a11eb9 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockBlockquote.cs +++ b/src/TgSharp.TL/TL/TLPageBlockBlockquote.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(641563686)] public class TLPageBlockBlockquote : TLAbsPageBlock @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } public TLAbsRichText Caption { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockChannel.cs b/src/TgSharp.TL/TL/TLPageBlockChannel.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockChannel.cs rename to src/TgSharp.TL/TL/TLPageBlockChannel.cs index 63615ac..50cae46 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockChannel.cs +++ b/src/TgSharp.TL/TL/TLPageBlockChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-283684427)] public class TLPageBlockChannel : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsChat Channel { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Channel = (TLAbsChat)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Channel, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockCollage.cs b/src/TgSharp.TL/TL/TLPageBlockCollage.cs similarity index 77% rename from src/TeleSharp.TL/TL/TLPageBlockCollage.cs rename to src/TgSharp.TL/TL/TLPageBlockCollage.cs index e62e772..a2c8941 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockCollage.cs +++ b/src/TgSharp.TL/TL/TLPageBlockCollage.cs @@ -4,34 +4,34 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(145955919)] + [TLObject(1705048653)] public class TLPageBlockCollage : TLAbsPageBlock { public override int Constructor { get { - return 145955919; + return 1705048653; } } public TLVector Items { get; set; } - public TLAbsRichText Caption { get; set; } - + public TLPageCaption Caption { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Items = (TLVector)ObjectUtils.DeserializeVector(br); - Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Items, bw); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockCover.cs b/src/TgSharp.TL/TL/TLPageBlockCover.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockCover.cs rename to src/TgSharp.TL/TL/TLPageBlockCover.cs index 11feba7..ea0e7a2 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockCover.cs +++ b/src/TgSharp.TL/TL/TLPageBlockCover.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(972174080)] public class TLPageBlockCover : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsPageBlock Cover { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Cover = (TLAbsPageBlock)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Cover, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageFull.cs b/src/TgSharp.TL/TL/TLPageBlockDetails.cs similarity index 56% rename from src/TeleSharp.TL/TL/TLPageFull.cs rename to src/TgSharp.TL/TL/TLPageBlockDetails.cs index 1f56e8d..c8f5670 100644 --- a/src/TeleSharp.TL/TL/TLPageFull.cs +++ b/src/TgSharp.TL/TL/TLPageBlockDetails.cs @@ -4,45 +4,46 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-677274263)] - public class TLPageFull : TLAbsPage + [TLObject(1987480557)] + public class TLPageBlockDetails : TLAbsPageBlock { public override int Constructor { get { - return -677274263; + return 1987480557; } } + public int Flags { get; set; } + public bool Open { get; set; } public TLVector Blocks { get; set; } - public TLVector Photos { get; set; } - public TLVector Videos { get; set; } - + public TLAbsRichText Title { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Open = (Flags & 1) != 0; Blocks = (TLVector)ObjectUtils.DeserializeVector(br); - Photos = (TLVector)ObjectUtils.DeserializeVector(br); - Videos = (TLVector)ObjectUtils.DeserializeVector(br); - + Title = (TLAbsRichText)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(Blocks, bw); - ObjectUtils.SerializeObject(Photos, bw); - ObjectUtils.SerializeObject(Videos, bw); - + ObjectUtils.SerializeObject(Title, bw); } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockDivider.cs b/src/TgSharp.TL/TL/TLPageBlockDivider.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLPageBlockDivider.cs rename to src/TgSharp.TL/TL/TLPageBlockDivider.cs index 7a80cbd..893ad9c 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockDivider.cs +++ b/src/TgSharp.TL/TL/TLPageBlockDivider.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-618614392)] public class TLPageBlockDivider : TLAbsPageBlock @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockEmbed.cs b/src/TgSharp.TL/TL/TLPageBlockEmbed.cs similarity index 68% rename from src/TeleSharp.TL/TL/TLPageBlockEmbed.cs rename to src/TgSharp.TL/TL/TLPageBlockEmbed.cs index 81893ab..b4d4668 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockEmbed.cs +++ b/src/TgSharp.TL/TL/TLPageBlockEmbed.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-840826671)] + [TLObject(-1468953147)] public class TLPageBlockEmbed : TLAbsPageBlock { public override int Constructor { get { - return -840826671; + return -1468953147; } } @@ -24,20 +26,13 @@ namespace TeleSharp.TL public string Url { get; set; } public string Html { get; set; } public long? PosterPhotoId { get; set; } - public int W { get; set; } - public int H { get; set; } - public TLAbsRichText Caption { get; set; } - + public int? W { get; set; } + public int? H { get; set; } + public TLPageCaption Caption { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = FullWidth ? (Flags | 1) : (Flags & ~1); - Flags = AllowScrolling ? (Flags | 8) : (Flags & ~8); - Flags = Url != null ? (Flags | 2) : (Flags & ~2); - Flags = Html != null ? (Flags | 4) : (Flags & ~4); - Flags = PosterPhotoId != null ? (Flags | 16) : (Flags & ~16); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -60,29 +55,34 @@ namespace TeleSharp.TL else PosterPhotoId = null; - W = br.ReadInt32(); - H = br.ReadInt32(); - Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + if ((Flags & 32) != 0) + W = br.ReadInt32(); + else + W = null; + if ((Flags & 32) != 0) + H = br.ReadInt32(); + else + H = null; + + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - if ((Flags & 2) != 0) StringUtil.Serialize(Url, bw); if ((Flags & 4) != 0) StringUtil.Serialize(Html, bw); if ((Flags & 16) != 0) bw.Write(PosterPhotoId.Value); - bw.Write(W); - bw.Write(H); + if ((Flags & 32) != 0) + bw.Write(W.Value); + if ((Flags & 32) != 0) + bw.Write(H.Value); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockEmbedPost.cs b/src/TgSharp.TL/TL/TLPageBlockEmbedPost.cs similarity index 85% rename from src/TeleSharp.TL/TL/TLPageBlockEmbedPost.cs rename to src/TgSharp.TL/TL/TLPageBlockEmbedPost.cs index cc69b30..12261db 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockEmbedPost.cs +++ b/src/TgSharp.TL/TL/TLPageBlockEmbedPost.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(690781161)] + [TLObject(-229005301)] public class TLPageBlockEmbedPost : TLAbsPageBlock { public override int Constructor { get { - return 690781161; + return -229005301; } } @@ -24,12 +26,11 @@ namespace TeleSharp.TL public string Author { get; set; } public int Date { get; set; } public TLVector Blocks { get; set; } - public TLAbsRichText Caption { get; set; } - + public TLPageCaption Caption { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -40,8 +41,7 @@ namespace TeleSharp.TL Author = StringUtil.Deserialize(br); Date = br.ReadInt32(); Blocks = (TLVector)ObjectUtils.DeserializeVector(br); - Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -54,7 +54,6 @@ namespace TeleSharp.TL bw.Write(Date); ObjectUtils.SerializeObject(Blocks, bw); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockFooter.cs b/src/TgSharp.TL/TL/TLPageBlockFooter.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockFooter.cs rename to src/TgSharp.TL/TL/TLPageBlockFooter.cs index f490ea6..0b40a73 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockFooter.cs +++ b/src/TgSharp.TL/TL/TLPageBlockFooter.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1216809369)] public class TLPageBlockFooter : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockHeader.cs b/src/TgSharp.TL/TL/TLPageBlockHeader.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockHeader.cs rename to src/TgSharp.TL/TL/TLPageBlockHeader.cs index b94bd66..9f80dde 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockHeader.cs +++ b/src/TgSharp.TL/TL/TLPageBlockHeader.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1076861716)] public class TLPageBlockHeader : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageBlockKicker.cs b/src/TgSharp.TL/TL/TLPageBlockKicker.cs new file mode 100644 index 0000000..f522512 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageBlockKicker.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(504660880)] + public class TLPageBlockKicker : TLAbsPageBlock + { + public override int Constructor + { + get + { + return 504660880; + } + } + + public TLAbsRichText Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPageBlockList.cs b/src/TgSharp.TL/TL/TLPageBlockList.cs similarity index 60% rename from src/TeleSharp.TL/TL/TLPageBlockList.cs rename to src/TgSharp.TL/TL/TLPageBlockList.cs index 7b2fa3b..b350358 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockList.cs +++ b/src/TgSharp.TL/TL/TLPageBlockList.cs @@ -4,42 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(978896884)] + [TLObject(-454524911)] public class TLPageBlockList : TLAbsPageBlock { public override int Constructor { get { - return 978896884; + return -454524911; } } - public bool Ordered { get; set; } - public TLVector Items { get; set; } - + public TLVector Items { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Ordered = BoolUtil.Deserialize(br); - Items = (TLVector)ObjectUtils.DeserializeVector(br); - + Items = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BoolUtil.Serialize(Ordered, bw); ObjectUtils.SerializeObject(Items, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageBlockMap.cs b/src/TgSharp.TL/TL/TLPageBlockMap.cs new file mode 100644 index 0000000..176985f --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageBlockMap.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1538310410)] + public class TLPageBlockMap : TLAbsPageBlock + { + public override int Constructor + { + get + { + return -1538310410; + } + } + + public TLAbsGeoPoint Geo { get; set; } + public int Zoom { get; set; } + public int W { get; set; } + public int H { get; set; } + public TLPageCaption Caption { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Geo = (TLAbsGeoPoint)ObjectUtils.DeserializeObject(br); + Zoom = br.ReadInt32(); + W = br.ReadInt32(); + H = br.ReadInt32(); + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Geo, bw); + bw.Write(Zoom); + bw.Write(W); + bw.Write(H); + ObjectUtils.SerializeObject(Caption, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPageBlockOrderedList.cs b/src/TgSharp.TL/TL/TLPageBlockOrderedList.cs new file mode 100644 index 0000000..be38cd2 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageBlockOrderedList.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1702174239)] + public class TLPageBlockOrderedList : TLAbsPageBlock + { + public override int Constructor + { + get + { + return -1702174239; + } + } + + public TLVector Items { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Items = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Items, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPageBlockParagraph.cs b/src/TgSharp.TL/TL/TLPageBlockParagraph.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockParagraph.cs rename to src/TgSharp.TL/TL/TLPageBlockParagraph.cs index 0ca1111..36a1fb3 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockParagraph.cs +++ b/src/TgSharp.TL/TL/TLPageBlockParagraph.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1182402406)] public class TLPageBlockParagraph : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageBlockPhoto.cs b/src/TgSharp.TL/TL/TLPageBlockPhoto.cs new file mode 100644 index 0000000..28165ed --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageBlockPhoto.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(391759200)] + public class TLPageBlockPhoto : TLAbsPageBlock + { + public override int Constructor + { + get + { + return 391759200; + } + } + + public int Flags { get; set; } + public long PhotoId { get; set; } + public TLPageCaption Caption { get; set; } + public string Url { get; set; } + public long? WebpageId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + PhotoId = br.ReadInt64(); + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + Url = StringUtil.Deserialize(br); + else + Url = null; + + if ((Flags & 1) != 0) + WebpageId = br.ReadInt64(); + else + WebpageId = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(PhotoId); + ObjectUtils.SerializeObject(Caption, bw); + if ((Flags & 1) != 0) + StringUtil.Serialize(Url, bw); + if ((Flags & 1) != 0) + bw.Write(WebpageId.Value); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPageBlockPreformatted.cs b/src/TgSharp.TL/TL/TLPageBlockPreformatted.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLPageBlockPreformatted.cs rename to src/TgSharp.TL/TL/TLPageBlockPreformatted.cs index 9dec430..6e6fc73 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockPreformatted.cs +++ b/src/TgSharp.TL/TL/TLPageBlockPreformatted.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1066346178)] public class TLPageBlockPreformatted : TLAbsPageBlock @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } public string Language { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); Language = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); StringUtil.Serialize(Language, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockPullquote.cs b/src/TgSharp.TL/TL/TLPageBlockPullquote.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLPageBlockPullquote.cs rename to src/TgSharp.TL/TL/TLPageBlockPullquote.cs index 92b9651..f8fd2a7 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockPullquote.cs +++ b/src/TgSharp.TL/TL/TLPageBlockPullquote.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1329878739)] public class TLPageBlockPullquote : TLAbsPageBlock @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } public TLAbsRichText Caption { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageBlockRelatedArticles.cs b/src/TgSharp.TL/TL/TLPageBlockRelatedArticles.cs new file mode 100644 index 0000000..d5ecb10 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageBlockRelatedArticles.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(370236054)] + public class TLPageBlockRelatedArticles : TLAbsPageBlock + { + public override int Constructor + { + get + { + return 370236054; + } + } + + public TLAbsRichText Title { get; set; } + public TLVector Articles { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Title = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + Articles = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Title, bw); + ObjectUtils.SerializeObject(Articles, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPageBlockSlideshow.cs b/src/TgSharp.TL/TL/TLPageBlockSlideshow.cs similarity index 77% rename from src/TeleSharp.TL/TL/TLPageBlockSlideshow.cs rename to src/TgSharp.TL/TL/TLPageBlockSlideshow.cs index e74545a..fb0baae 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockSlideshow.cs +++ b/src/TgSharp.TL/TL/TLPageBlockSlideshow.cs @@ -4,34 +4,34 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(319588707)] + [TLObject(52401552)] public class TLPageBlockSlideshow : TLAbsPageBlock { public override int Constructor { get { - return 319588707; + return 52401552; } } public TLVector Items { get; set; } - public TLAbsRichText Caption { get; set; } - + public TLPageCaption Caption { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Items = (TLVector)ObjectUtils.DeserializeVector(br); - Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Items, bw); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockSubheader.cs b/src/TgSharp.TL/TL/TLPageBlockSubheader.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockSubheader.cs rename to src/TgSharp.TL/TL/TLPageBlockSubheader.cs index a2b2d1e..4ab9fec 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockSubheader.cs +++ b/src/TgSharp.TL/TL/TLPageBlockSubheader.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-248793375)] public class TLPageBlockSubheader : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockSubtitle.cs b/src/TgSharp.TL/TL/TLPageBlockSubtitle.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockSubtitle.cs rename to src/TgSharp.TL/TL/TLPageBlockSubtitle.cs index ea61390..3dceb7d 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockSubtitle.cs +++ b/src/TgSharp.TL/TL/TLPageBlockSubtitle.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1879401953)] public class TLPageBlockSubtitle : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageBlockTable.cs b/src/TgSharp.TL/TL/TLPageBlockTable.cs new file mode 100644 index 0000000..19a829c --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageBlockTable.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1085412734)] + public class TLPageBlockTable : TLAbsPageBlock + { + public override int Constructor + { + get + { + return -1085412734; + } + } + + public int Flags { get; set; } + public bool Bordered { get; set; } + public bool Striped { get; set; } + public TLAbsRichText Title { get; set; } + public TLVector Rows { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Bordered = (Flags & 1) != 0; + Striped = (Flags & 2) != 0; + Title = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + Rows = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Title, bw); + ObjectUtils.SerializeObject(Rows, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPageBlockTitle.cs b/src/TgSharp.TL/TL/TLPageBlockTitle.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPageBlockTitle.cs rename to src/TgSharp.TL/TL/TLPageBlockTitle.cs index 533e49c..66e6a28 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockTitle.cs +++ b/src/TgSharp.TL/TL/TLPageBlockTitle.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1890305021)] public class TLPageBlockTitle : TLAbsPageBlock @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockUnsupported.cs b/src/TgSharp.TL/TL/TLPageBlockUnsupported.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLPageBlockUnsupported.cs rename to src/TgSharp.TL/TL/TLPageBlockUnsupported.cs index 9de6957..74571ad 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockUnsupported.cs +++ b/src/TgSharp.TL/TL/TLPageBlockUnsupported.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(324435594)] public class TLPageBlockUnsupported : TLAbsPageBlock @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPageBlockVideo.cs b/src/TgSharp.TL/TL/TLPageBlockVideo.cs similarity index 71% rename from src/TeleSharp.TL/TL/TLPageBlockVideo.cs rename to src/TgSharp.TL/TL/TLPageBlockVideo.cs index 1443903..1c97fdb 100644 --- a/src/TeleSharp.TL/TL/TLPageBlockVideo.cs +++ b/src/TgSharp.TL/TL/TLPageBlockVideo.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-640214938)] + [TLObject(2089805750)] public class TLPageBlockVideo : TLAbsPageBlock { public override int Constructor { get { - return -640214938; + return 2089805750; } } @@ -22,15 +24,11 @@ namespace TeleSharp.TL public bool Autoplay { get; set; } public bool Loop { get; set; } public long VideoId { get; set; } - public TLAbsRichText Caption { get; set; } - + public TLPageCaption Caption { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Autoplay ? (Flags | 1) : (Flags & ~1); - Flags = Loop ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,20 +37,15 @@ namespace TeleSharp.TL Autoplay = (Flags & 1) != 0; Loop = (Flags & 2) != 0; VideoId = br.ReadInt64(); - Caption = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - + Caption = (TLPageCaption)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(VideoId); ObjectUtils.SerializeObject(Caption, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageCaption.cs b/src/TgSharp.TL/TL/TLPageCaption.cs new file mode 100644 index 0000000..8d1ddc7 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageCaption.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1869903447)] + public class TLPageCaption : TLObject + { + public override int Constructor + { + get + { + return 1869903447; + } + } + + public TLAbsRichText Text { get; set; } + public TLAbsRichText Credit { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + Credit = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + ObjectUtils.SerializeObject(Credit, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPagePart.cs b/src/TgSharp.TL/TL/TLPageListItemBlocks.cs similarity index 56% rename from src/TeleSharp.TL/TL/TLPagePart.cs rename to src/TgSharp.TL/TL/TLPageListItemBlocks.cs index e64b1e9..65aade3 100644 --- a/src/TeleSharp.TL/TL/TLPagePart.cs +++ b/src/TgSharp.TL/TL/TLPageListItemBlocks.cs @@ -4,45 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1913754556)] - public class TLPagePart : TLAbsPage + [TLObject(635466748)] + public class TLPageListItemBlocks : TLAbsPageListItem { public override int Constructor { get { - return -1913754556; + return 635466748; } } public TLVector Blocks { get; set; } - public TLVector Photos { get; set; } - public TLVector Videos { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Blocks = (TLVector)ObjectUtils.DeserializeVector(br); - Photos = (TLVector)ObjectUtils.DeserializeVector(br); - Videos = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Blocks, bw); - ObjectUtils.SerializeObject(Photos, bw); - ObjectUtils.SerializeObject(Videos, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPageListItemText.cs b/src/TgSharp.TL/TL/TLPageListItemText.cs new file mode 100644 index 0000000..f2e2df3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageListItemText.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1188055347)] + public class TLPageListItemText : TLAbsPageListItem + { + public override int Constructor + { + get + { + return -1188055347; + } + } + + public TLAbsRichText Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPageListOrderedItemBlocks.cs b/src/TgSharp.TL/TL/TLPageListOrderedItemBlocks.cs new file mode 100644 index 0000000..61ac680 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageListOrderedItemBlocks.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1730311882)] + public class TLPageListOrderedItemBlocks : TLAbsPageListOrderedItem + { + public override int Constructor + { + get + { + return -1730311882; + } + } + + public string Num { get; set; } + public TLVector Blocks { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Num = StringUtil.Deserialize(br); + Blocks = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Num, bw); + ObjectUtils.SerializeObject(Blocks, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLNoPassword.cs b/src/TgSharp.TL/TL/TLPageListOrderedItemText.cs similarity index 50% rename from src/TeleSharp.TL/TL/Account/TLNoPassword.cs rename to src/TgSharp.TL/TL/TLPageListOrderedItemText.cs index 6a712e0..9264f8f 100644 --- a/src/TeleSharp.TL/TL/Account/TLNoPassword.cs +++ b/src/TgSharp.TL/TL/TLPageListOrderedItemText.cs @@ -4,42 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1764049896)] - public class TLNoPassword : TLAbsPassword + [TLObject(1577484359)] + public class TLPageListOrderedItemText : TLAbsPageListOrderedItem { public override int Constructor { get { - return -1764049896; + return 1577484359; } } - public byte[] NewSalt { get; set; } - public string EmailUnconfirmedPattern { get; set; } - + public string Num { get; set; } + public TLAbsRichText Text { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - NewSalt = BytesUtil.Deserialize(br); - EmailUnconfirmedPattern = StringUtil.Deserialize(br); - + Num = StringUtil.Deserialize(br); + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - BytesUtil.Serialize(NewSalt, bw); - StringUtil.Serialize(EmailUnconfirmedPattern, bw); - + StringUtil.Serialize(Num, bw); + ObjectUtils.SerializeObject(Text, bw); } } } diff --git a/src/TgSharp.TL/TL/TLPageRelatedArticle.cs b/src/TgSharp.TL/TL/TLPageRelatedArticle.cs new file mode 100644 index 0000000..087a73b --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageRelatedArticle.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1282352120)] + public class TLPageRelatedArticle : TLObject + { + public override int Constructor + { + get + { + return -1282352120; + } + } + + public int Flags { get; set; } + public string Url { get; set; } + public long WebpageId { get; set; } + public string Title { get; set; } + public string Description { get; set; } + public long? PhotoId { get; set; } + public string Author { get; set; } + public int? PublishedDate { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Url = StringUtil.Deserialize(br); + WebpageId = br.ReadInt64(); + if ((Flags & 1) != 0) + Title = StringUtil.Deserialize(br); + else + Title = null; + + if ((Flags & 2) != 0) + Description = StringUtil.Deserialize(br); + else + Description = null; + + if ((Flags & 4) != 0) + PhotoId = br.ReadInt64(); + else + PhotoId = null; + + if ((Flags & 8) != 0) + Author = StringUtil.Deserialize(br); + else + Author = null; + + if ((Flags & 16) != 0) + PublishedDate = br.ReadInt32(); + else + PublishedDate = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + StringUtil.Serialize(Url, bw); + bw.Write(WebpageId); + if ((Flags & 1) != 0) + StringUtil.Serialize(Title, bw); + if ((Flags & 2) != 0) + StringUtil.Serialize(Description, bw); + if ((Flags & 4) != 0) + bw.Write(PhotoId.Value); + if ((Flags & 8) != 0) + StringUtil.Serialize(Author, bw); + if ((Flags & 16) != 0) + bw.Write(PublishedDate.Value); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPageTableCell.cs b/src/TgSharp.TL/TL/TLPageTableCell.cs new file mode 100644 index 0000000..1729ff5 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageTableCell.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(878078826)] + public class TLPageTableCell : TLObject + { + public override int Constructor + { + get + { + return 878078826; + } + } + + public int Flags { get; set; } + public bool Header { get; set; } + public bool AlignCenter { get; set; } + public bool AlignRight { get; set; } + public bool ValignMiddle { get; set; } + public bool ValignBottom { get; set; } + public TLAbsRichText Text { get; set; } + public int? Colspan { get; set; } + public int? Rowspan { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Header = (Flags & 1) != 0; + AlignCenter = (Flags & 8) != 0; + AlignRight = (Flags & 16) != 0; + ValignMiddle = (Flags & 32) != 0; + ValignBottom = (Flags & 64) != 0; + if ((Flags & 128) != 0) + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + else + Text = null; + + if ((Flags & 2) != 0) + Colspan = br.ReadInt32(); + else + Colspan = null; + + if ((Flags & 4) != 0) + Rowspan = br.ReadInt32(); + else + Rowspan = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 128) != 0) + ObjectUtils.SerializeObject(Text, bw); + if ((Flags & 2) != 0) + bw.Write(Colspan.Value); + if ((Flags & 4) != 0) + bw.Write(Rowspan.Value); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPageTableRow.cs b/src/TgSharp.TL/TL/TLPageTableRow.cs new file mode 100644 index 0000000..78362e9 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPageTableRow.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-524237339)] + public class TLPageTableRow : TLObject + { + public override int Constructor + { + get + { + return -524237339; + } + } + + public TLVector Cells { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Cells = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Cells, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.cs b/src/TgSharp.TL/TL/TLPasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.cs new file mode 100644 index 0000000..8c9f3e0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(982592842)] + public class TLPasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow : TLAbsPasswordKdfAlgo + { + public override int Constructor + { + get + { + return 982592842; + } + } + + public byte[] Salt1 { get; set; } + public byte[] Salt2 { get; set; } + public int G { get; set; } + public byte[] P { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Salt1 = BytesUtil.Deserialize(br); + Salt2 = BytesUtil.Deserialize(br); + G = br.ReadInt32(); + P = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(Salt1, bw); + BytesUtil.Serialize(Salt2, bw); + bw.Write(G); + BytesUtil.Serialize(P, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPasswordKdfAlgoUnknown.cs b/src/TgSharp.TL/TL/TLPasswordKdfAlgoUnknown.cs new file mode 100644 index 0000000..b028ad6 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPasswordKdfAlgoUnknown.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-732254058)] + public class TLPasswordKdfAlgoUnknown : TLAbsPasswordKdfAlgo + { + public override int Constructor + { + get + { + return -732254058; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPaymentCharge.cs b/src/TgSharp.TL/TL/TLPaymentCharge.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLPaymentCharge.cs rename to src/TgSharp.TL/TL/TLPaymentCharge.cs index 90d0f1e..c4f0941 100644 --- a/src/TeleSharp.TL/TL/TLPaymentCharge.cs +++ b/src/TgSharp.TL/TL/TLPaymentCharge.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-368917890)] public class TLPaymentCharge : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Id { get; set; } public string ProviderChargeId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = StringUtil.Deserialize(br); ProviderChargeId = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Id, bw); StringUtil.Serialize(ProviderChargeId, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPaymentRequestedInfo.cs b/src/TgSharp.TL/TL/TLPaymentRequestedInfo.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLPaymentRequestedInfo.cs rename to src/TgSharp.TL/TL/TLPaymentRequestedInfo.cs index e01d966..9ae5bb0 100644 --- a/src/TeleSharp.TL/TL/TLPaymentRequestedInfo.cs +++ b/src/TgSharp.TL/TL/TLPaymentRequestedInfo.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1868808300)] public class TLPaymentRequestedInfo : TLObject @@ -24,15 +26,9 @@ namespace TeleSharp.TL public string Email { get; set; } public TLPostAddress ShippingAddress { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Name != null ? (Flags | 1) : (Flags & ~1); - Flags = Phone != null ? (Flags | 2) : (Flags & ~2); - Flags = Email != null ? (Flags | 4) : (Flags & ~4); - Flags = ShippingAddress != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -58,13 +54,11 @@ namespace TeleSharp.TL else ShippingAddress = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); if ((Flags & 1) != 0) StringUtil.Serialize(Name, bw); @@ -74,7 +68,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Email, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(ShippingAddress, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPaymentSavedCredentialsCard.cs b/src/TgSharp.TL/TL/TLPaymentSavedCredentialsCard.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLPaymentSavedCredentialsCard.cs rename to src/TgSharp.TL/TL/TLPaymentSavedCredentialsCard.cs index b87a85f..a2c1d62 100644 --- a/src/TeleSharp.TL/TL/TLPaymentSavedCredentialsCard.cs +++ b/src/TgSharp.TL/TL/TLPaymentSavedCredentialsCard.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-842892769)] public class TLPaymentSavedCredentialsCard : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Id { get; set; } public string Title { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = StringUtil.Deserialize(br); Title = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Id, bw); StringUtil.Serialize(Title, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPeerChannel.cs b/src/TgSharp.TL/TL/TLPeerChannel.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLPeerChannel.cs rename to src/TgSharp.TL/TL/TLPeerChannel.cs index c38e46d..e2bc716 100644 --- a/src/TeleSharp.TL/TL/TLPeerChannel.cs +++ b/src/TgSharp.TL/TL/TLPeerChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1109531342)] public class TLPeerChannel : TLAbsPeer @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int ChannelId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChannelId); - } } } diff --git a/src/TeleSharp.TL/TL/TLPeerChat.cs b/src/TgSharp.TL/TL/TLPeerChat.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLPeerChat.cs rename to src/TgSharp.TL/TL/TLPeerChat.cs index a29af17..889ba3e 100644 --- a/src/TeleSharp.TL/TL/TLPeerChat.cs +++ b/src/TgSharp.TL/TL/TLPeerChat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1160714821)] public class TLPeerChat : TLAbsPeer @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int ChatId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - } } } diff --git a/src/TgSharp.TL/TL/TLPeerLocated.cs b/src/TgSharp.TL/TL/TLPeerLocated.cs new file mode 100644 index 0000000..36db34b --- /dev/null +++ b/src/TgSharp.TL/TL/TLPeerLocated.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-901375139)] + public class TLPeerLocated : TLObject + { + public override int Constructor + { + get + { + return -901375139; + } + } + + public TLAbsPeer Peer { get; set; } + public int Expires { get; set; } + public int Distance { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + Expires = br.ReadInt32(); + Distance = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(Expires); + bw.Write(Distance); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPeerNotifySettings.cs b/src/TgSharp.TL/TL/TLPeerNotifySettings.cs new file mode 100644 index 0000000..22c6399 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPeerNotifySettings.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1353671392)] + public class TLPeerNotifySettings : TLObject + { + public override int Constructor + { + get + { + return -1353671392; + } + } + + public int Flags { get; set; } + public bool? ShowPreviews { get; set; } + public bool? Silent { get; set; } + public int? MuteUntil { get; set; } + public string Sound { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + ShowPreviews = BoolUtil.Deserialize(br); + else + ShowPreviews = null; + + if ((Flags & 2) != 0) + Silent = BoolUtil.Deserialize(br); + else + Silent = null; + + if ((Flags & 4) != 0) + MuteUntil = br.ReadInt32(); + else + MuteUntil = null; + + if ((Flags & 8) != 0) + Sound = StringUtil.Deserialize(br); + else + Sound = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + BoolUtil.Serialize(ShowPreviews.Value, bw); + if ((Flags & 2) != 0) + BoolUtil.Serialize(Silent.Value, bw); + if ((Flags & 4) != 0) + bw.Write(MuteUntil.Value); + if ((Flags & 8) != 0) + StringUtil.Serialize(Sound, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPeerSettings.cs b/src/TgSharp.TL/TL/TLPeerSettings.cs new file mode 100644 index 0000000..f541e01 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPeerSettings.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2122045747)] + public class TLPeerSettings : TLObject + { + public override int Constructor + { + get + { + return -2122045747; + } + } + + public int Flags { get; set; } + public bool ReportSpam { get; set; } + public bool AddContact { get; set; } + public bool BlockContact { get; set; } + public bool ShareContact { get; set; } + public bool NeedContactsException { get; set; } + public bool ReportGeo { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + ReportSpam = (Flags & 1) != 0; + AddContact = (Flags & 2) != 0; + BlockContact = (Flags & 4) != 0; + ShareContact = (Flags & 8) != 0; + NeedContactsException = (Flags & 16) != 0; + ReportGeo = (Flags & 32) != 0; + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPeerUser.cs b/src/TgSharp.TL/TL/TLPeerUser.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLPeerUser.cs rename to src/TgSharp.TL/TL/TLPeerUser.cs index 981fb6d..ea3cf3f 100644 --- a/src/TeleSharp.TL/TL/TLPeerUser.cs +++ b/src/TgSharp.TL/TL/TLPeerUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1649296275)] public class TLPeerUser : TLAbsPeer @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int UserId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(UserId); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCall.cs b/src/TgSharp.TL/TL/TLPhoneCall.cs similarity index 74% rename from src/TeleSharp.TL/TL/TLPhoneCall.cs rename to src/TgSharp.TL/TL/TLPhoneCall.cs index 84dbc63..e844cf5 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCall.cs +++ b/src/TgSharp.TL/TL/TLPhoneCall.cs @@ -4,20 +4,24 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1660057)] + [TLObject(-2025673089)] public class TLPhoneCall : TLAbsPhoneCall { public override int Constructor { get { - return -1660057; + return -2025673089; } } + public int Flags { get; set; } + public bool P2pAllowed { get; set; } public long Id { get; set; } public long AccessHash { get; set; } public int Date { get; set; } @@ -26,18 +30,18 @@ namespace TeleSharp.TL public byte[] GAOrB { get; set; } public long KeyFingerprint { get; set; } public TLPhoneCallProtocol Protocol { get; set; } - public TLPhoneConnection Connection { get; set; } - public TLVector AlternativeConnections { get; set; } + public TLVector Connections { get; set; } public int StartDate { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + P2pAllowed = (Flags & 32) != 0; Id = br.ReadInt64(); AccessHash = br.ReadInt64(); Date = br.ReadInt32(); @@ -46,15 +50,14 @@ namespace TeleSharp.TL GAOrB = BytesUtil.Deserialize(br); KeyFingerprint = br.ReadInt64(); Protocol = (TLPhoneCallProtocol)ObjectUtils.DeserializeObject(br); - Connection = (TLPhoneConnection)ObjectUtils.DeserializeObject(br); - AlternativeConnections = (TLVector)ObjectUtils.DeserializeVector(br); + Connections = (TLVector)ObjectUtils.DeserializeVector(br); StartDate = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(Id); bw.Write(AccessHash); bw.Write(Date); @@ -63,10 +66,8 @@ namespace TeleSharp.TL BytesUtil.Serialize(GAOrB, bw); bw.Write(KeyFingerprint); ObjectUtils.SerializeObject(Protocol, bw); - ObjectUtils.SerializeObject(Connection, bw); - ObjectUtils.SerializeObject(AlternativeConnections, bw); + ObjectUtils.SerializeObject(Connections, bw); bw.Write(StartDate); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallAccepted.cs b/src/TgSharp.TL/TL/TLPhoneCallAccepted.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPhoneCallAccepted.cs rename to src/TgSharp.TL/TL/TLPhoneCallAccepted.cs index 8a3c92f..ebc255a 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallAccepted.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallAccepted.cs @@ -4,20 +4,24 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1828732223)] + [TLObject(-1719909046)] public class TLPhoneCallAccepted : TLAbsPhoneCall { public override int Constructor { get { - return 1828732223; + return -1719909046; } } + public int Flags { get; set; } + public bool Video { get; set; } public long Id { get; set; } public long AccessHash { get; set; } public int Date { get; set; } @@ -26,14 +30,15 @@ namespace TeleSharp.TL public byte[] GB { get; set; } public TLPhoneCallProtocol Protocol { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Video = (Flags & 32) != 0; Id = br.ReadInt64(); AccessHash = br.ReadInt64(); Date = br.ReadInt32(); @@ -41,12 +46,12 @@ namespace TeleSharp.TL ParticipantId = br.ReadInt32(); GB = BytesUtil.Deserialize(br); Protocol = (TLPhoneCallProtocol)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(Id); bw.Write(AccessHash); bw.Write(Date); @@ -54,7 +59,6 @@ namespace TeleSharp.TL bw.Write(ParticipantId); BytesUtil.Serialize(GB, bw); ObjectUtils.SerializeObject(Protocol, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonBusy.cs b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonBusy.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonBusy.cs rename to src/TgSharp.TL/TL/TLPhoneCallDiscardReasonBusy.cs index 59fd875..8bbada3 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonBusy.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonBusy.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-84416311)] public class TLPhoneCallDiscardReasonBusy : TLAbsPhoneCallDiscardReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonDisconnect.cs b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonDisconnect.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonDisconnect.cs rename to src/TgSharp.TL/TL/TLPhoneCallDiscardReasonDisconnect.cs index 9f09d4c..f35e9dd 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonDisconnect.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonDisconnect.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-527056480)] public class TLPhoneCallDiscardReasonDisconnect : TLAbsPhoneCallDiscardReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonHangup.cs b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonHangup.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonHangup.cs rename to src/TgSharp.TL/TL/TLPhoneCallDiscardReasonHangup.cs index eb5bdef..56d3357 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonHangup.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonHangup.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1471006352)] public class TLPhoneCallDiscardReasonHangup : TLAbsPhoneCallDiscardReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonMissed.cs b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonMissed.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonMissed.cs rename to src/TgSharp.TL/TL/TLPhoneCallDiscardReasonMissed.cs index d5eef1b..552b456 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallDiscardReasonMissed.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallDiscardReasonMissed.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2048646399)] public class TLPhoneCallDiscardReasonMissed : TLAbsPhoneCallDiscardReason @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallDiscarded.cs b/src/TgSharp.TL/TL/TLPhoneCallDiscarded.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLPhoneCallDiscarded.cs rename to src/TgSharp.TL/TL/TLPhoneCallDiscarded.cs index 36ecbea..1394b7c 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallDiscarded.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallDiscarded.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1355435489)] public class TLPhoneCallDiscarded : TLAbsPhoneCall @@ -21,19 +23,14 @@ namespace TeleSharp.TL public int Flags { get; set; } public bool NeedRating { get; set; } public bool NeedDebug { get; set; } + public bool Video { get; set; } public long Id { get; set; } public TLAbsPhoneCallDiscardReason Reason { get; set; } public int? Duration { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = NeedRating ? (Flags | 4) : (Flags & ~4); - Flags = NeedDebug ? (Flags | 8) : (Flags & ~8); - Flags = Reason != null ? (Flags | 1) : (Flags & ~1); - Flags = Duration != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,6 +38,7 @@ namespace TeleSharp.TL Flags = br.ReadInt32(); NeedRating = (Flags & 4) != 0; NeedDebug = (Flags & 8) != 0; + Video = (Flags & 32) != 0; Id = br.ReadInt64(); if ((Flags & 1) != 0) Reason = (TLAbsPhoneCallDiscardReason)ObjectUtils.DeserializeObject(br); @@ -52,22 +50,17 @@ namespace TeleSharp.TL else Duration = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(Id); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Reason, bw); if ((Flags & 2) != 0) bw.Write(Duration.Value); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallEmpty.cs b/src/TgSharp.TL/TL/TLPhoneCallEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLPhoneCallEmpty.cs rename to src/TgSharp.TL/TL/TLPhoneCallEmpty.cs index b310631..db95c99 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallEmpty.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1399245077)] public class TLPhoneCallEmpty : TLAbsPhoneCall @@ -20,23 +22,20 @@ namespace TeleSharp.TL public long Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallProtocol.cs b/src/TgSharp.TL/TL/TLPhoneCallProtocol.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLPhoneCallProtocol.cs rename to src/TgSharp.TL/TL/TLPhoneCallProtocol.cs index 87c7361..8c84443 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallProtocol.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallProtocol.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1564789301)] public class TLPhoneCallProtocol : TLObject @@ -24,13 +26,9 @@ namespace TeleSharp.TL public int MinLayer { get; set; } public int MaxLayer { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = UdpP2p ? (Flags | 1) : (Flags & ~1); - Flags = UdpReflector ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -40,19 +38,14 @@ namespace TeleSharp.TL UdpReflector = (Flags & 2) != 0; MinLayer = br.ReadInt32(); MaxLayer = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(MinLayer); bw.Write(MaxLayer); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallRequested.cs b/src/TgSharp.TL/TL/TLPhoneCallRequested.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPhoneCallRequested.cs rename to src/TgSharp.TL/TL/TLPhoneCallRequested.cs index a09895f..6a40f99 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallRequested.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallRequested.cs @@ -4,20 +4,24 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-2089411356)] + [TLObject(-2014659757)] public class TLPhoneCallRequested : TLAbsPhoneCall { public override int Constructor { get { - return -2089411356; + return -2014659757; } } + public int Flags { get; set; } + public bool Video { get; set; } public long Id { get; set; } public long AccessHash { get; set; } public int Date { get; set; } @@ -26,14 +30,15 @@ namespace TeleSharp.TL public byte[] GAHash { get; set; } public TLPhoneCallProtocol Protocol { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Video = (Flags & 32) != 0; Id = br.ReadInt64(); AccessHash = br.ReadInt64(); Date = br.ReadInt32(); @@ -41,12 +46,12 @@ namespace TeleSharp.TL ParticipantId = br.ReadInt32(); GAHash = BytesUtil.Deserialize(br); Protocol = (TLPhoneCallProtocol)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(Id); bw.Write(AccessHash); bw.Write(Date); @@ -54,7 +59,6 @@ namespace TeleSharp.TL bw.Write(ParticipantId); BytesUtil.Serialize(GAHash, bw); ObjectUtils.SerializeObject(Protocol, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneCallWaiting.cs b/src/TgSharp.TL/TL/TLPhoneCallWaiting.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLPhoneCallWaiting.cs rename to src/TgSharp.TL/TL/TLPhoneCallWaiting.cs index 20eb455..acfc135 100644 --- a/src/TeleSharp.TL/TL/TLPhoneCallWaiting.cs +++ b/src/TgSharp.TL/TL/TLPhoneCallWaiting.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(462375633)] public class TLPhoneCallWaiting : TLAbsPhoneCall @@ -19,6 +21,7 @@ namespace TeleSharp.TL } public int Flags { get; set; } + public bool Video { get; set; } public long Id { get; set; } public long AccessHash { get; set; } public int Date { get; set; } @@ -27,17 +30,15 @@ namespace TeleSharp.TL public TLPhoneCallProtocol Protocol { get; set; } public int? ReceiveDate { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = ReceiveDate != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); + Video = (Flags & 32) != 0; Id = br.ReadInt64(); AccessHash = br.ReadInt64(); Date = br.ReadInt32(); @@ -49,13 +50,11 @@ namespace TeleSharp.TL else ReceiveDate = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(Id); bw.Write(AccessHash); @@ -65,7 +64,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Protocol, bw); if ((Flags & 1) != 0) bw.Write(ReceiveDate.Value); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoneConnection.cs b/src/TgSharp.TL/TL/TLPhoneConnection.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLPhoneConnection.cs rename to src/TgSharp.TL/TL/TLPhoneConnection.cs index ad9030a..ecf47cb 100644 --- a/src/TeleSharp.TL/TL/TLPhoneConnection.cs +++ b/src/TgSharp.TL/TL/TLPhoneConnection.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1655957568)] public class TLPhoneConnection : TLObject @@ -24,10 +26,9 @@ namespace TeleSharp.TL public int Port { get; set; } public byte[] PeerTag { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL Ipv6 = StringUtil.Deserialize(br); Port = br.ReadInt32(); PeerTag = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Ipv6, bw); bw.Write(Port); BytesUtil.Serialize(PeerTag, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhoto.cs b/src/TgSharp.TL/TL/TLPhoto.cs similarity index 76% rename from src/TeleSharp.TL/TL/TLPhoto.cs rename to src/TgSharp.TL/TL/TLPhoto.cs index 8857440..f770160 100644 --- a/src/TeleSharp.TL/TL/TLPhoto.cs +++ b/src/TgSharp.TL/TL/TLPhoto.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1836524247)] + [TLObject(-797637467)] public class TLPhoto : TLAbsPhoto { public override int Constructor { get { - return -1836524247; + return -797637467; } } @@ -22,15 +24,14 @@ namespace TeleSharp.TL public bool HasStickers { get; set; } public long Id { get; set; } public long AccessHash { get; set; } + public byte[] FileReference { get; set; } public int Date { get; set; } public TLVector Sizes { get; set; } - + public int DcId { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = HasStickers ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,22 +40,22 @@ namespace TeleSharp.TL HasStickers = (Flags & 1) != 0; Id = br.ReadInt64(); AccessHash = br.ReadInt64(); + FileReference = BytesUtil.Deserialize(br); Date = br.ReadInt32(); Sizes = (TLVector)ObjectUtils.DeserializeVector(br); - + DcId = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Id); bw.Write(AccessHash); + BytesUtil.Serialize(FileReference, bw); bw.Write(Date); ObjectUtils.SerializeObject(Sizes, bw); - + bw.Write(DcId); } } } diff --git a/src/TeleSharp.TL/TL/TLPhotoCachedSize.cs b/src/TgSharp.TL/TL/TLPhotoCachedSize.cs similarity index 75% rename from src/TeleSharp.TL/TL/TLPhotoCachedSize.cs rename to src/TgSharp.TL/TL/TLPhotoCachedSize.cs index 2625bad..f654bd1 100644 --- a/src/TeleSharp.TL/TL/TLPhotoCachedSize.cs +++ b/src/TgSharp.TL/TL/TLPhotoCachedSize.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-374917894)] public class TLPhotoCachedSize : TLAbsPhotoSize @@ -19,25 +21,25 @@ namespace TeleSharp.TL } public string Type { get; set; } - public TLAbsFileLocation Location { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated Location { get; set; } public int W { get; set; } public int H { get; set; } public byte[] Bytes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Type = StringUtil.Deserialize(br); - Location = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + Location = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); W = br.ReadInt32(); H = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +50,6 @@ namespace TeleSharp.TL bw.Write(W); bw.Write(H); BytesUtil.Serialize(Bytes, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhotoEmpty.cs b/src/TgSharp.TL/TL/TLPhotoEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLPhotoEmpty.cs rename to src/TgSharp.TL/TL/TLPhotoEmpty.cs index 167c108..269ba23 100644 --- a/src/TeleSharp.TL/TL/TLPhotoEmpty.cs +++ b/src/TgSharp.TL/TL/TLPhotoEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(590459437)] public class TLPhotoEmpty : TLAbsPhoto @@ -20,23 +22,20 @@ namespace TeleSharp.TL public long Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhotoSize.cs b/src/TgSharp.TL/TL/TLPhotoSize.cs similarity index 75% rename from src/TeleSharp.TL/TL/TLPhotoSize.cs rename to src/TgSharp.TL/TL/TLPhotoSize.cs index 877fc5f..f5cc17b 100644 --- a/src/TeleSharp.TL/TL/TLPhotoSize.cs +++ b/src/TgSharp.TL/TL/TLPhotoSize.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2009052699)] public class TLPhotoSize : TLAbsPhotoSize @@ -19,25 +21,25 @@ namespace TeleSharp.TL } public string Type { get; set; } - public TLAbsFileLocation Location { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated Location { get; set; } public int W { get; set; } public int H { get; set; } public int Size { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Type = StringUtil.Deserialize(br); - Location = (TLAbsFileLocation)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + Location = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); W = br.ReadInt32(); H = br.ReadInt32(); Size = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +50,6 @@ namespace TeleSharp.TL bw.Write(W); bw.Write(H); bw.Write(Size); - } } } diff --git a/src/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs b/src/TgSharp.TL/TL/TLPhotoSizeEmpty.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs rename to src/TgSharp.TL/TL/TLPhotoSizeEmpty.cs index da25922..83afbd2 100644 --- a/src/TeleSharp.TL/TL/TLPhotoSizeEmpty.cs +++ b/src/TgSharp.TL/TL/TLPhotoSizeEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(236446268)] public class TLPhotoSizeEmpty : TLAbsPhotoSize @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Type { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Type = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Type, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPhotoStrippedSize.cs b/src/TgSharp.TL/TL/TLPhotoStrippedSize.cs new file mode 100644 index 0000000..1fbaac9 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPhotoStrippedSize.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-525288402)] + public class TLPhotoStrippedSize : TLAbsPhotoSize + { + public override int Constructor + { + get + { + return -525288402; + } + } + + public string Type { get; set; } + public byte[] Bytes { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = StringUtil.Deserialize(br); + Bytes = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Type, bw); + BytesUtil.Serialize(Bytes, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPoll.cs b/src/TgSharp.TL/TL/TLPoll.cs new file mode 100644 index 0000000..dbc760b --- /dev/null +++ b/src/TgSharp.TL/TL/TLPoll.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-716006138)] + public class TLPoll : TLObject + { + public override int Constructor + { + get + { + return -716006138; + } + } + + public long Id { get; set; } + public int Flags { get; set; } + public bool Closed { get; set; } + public bool PublicVoters { get; set; } + public bool MultipleChoice { get; set; } + public bool Quiz { get; set; } + public string Question { get; set; } + public TLVector Answers { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + Flags = br.ReadInt32(); + Closed = (Flags & 1) != 0; + PublicVoters = (Flags & 2) != 0; + MultipleChoice = (Flags & 4) != 0; + Quiz = (Flags & 8) != 0; + Question = StringUtil.Deserialize(br); + Answers = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(Flags); + StringUtil.Serialize(Question, bw); + ObjectUtils.SerializeObject(Answers, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/Help/TLTermsOfService.cs b/src/TgSharp.TL/TL/TLPollAnswer.cs similarity index 67% rename from src/TeleSharp.TL/TL/Help/TLTermsOfService.cs rename to src/TgSharp.TL/TL/TLPollAnswer.cs index 32d4b98..9193f9e 100644 --- a/src/TeleSharp.TL/TL/Help/TLTermsOfService.cs +++ b/src/TgSharp.TL/TL/TLPollAnswer.cs @@ -4,39 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-236044656)] - public class TLTermsOfService : TLObject + [TLObject(1823064809)] + public class TLPollAnswer : TLObject { public override int Constructor { get { - return -236044656; + return 1823064809; } } public string Text { get; set; } - + public byte[] Option { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - + Option = BytesUtil.Deserialize(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - + BytesUtil.Serialize(Option, bw); } } } diff --git a/src/TgSharp.TL/TL/TLPollAnswerVoters.cs b/src/TgSharp.TL/TL/TLPollAnswerVoters.cs new file mode 100644 index 0000000..d35db69 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPollAnswerVoters.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(997055186)] + public class TLPollAnswerVoters : TLObject + { + public override int Constructor + { + get + { + return 997055186; + } + } + + public int Flags { get; set; } + public bool Chosen { get; set; } + public bool Correct { get; set; } + public byte[] Option { get; set; } + public int Voters { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Chosen = (Flags & 1) != 0; + Correct = (Flags & 2) != 0; + Option = BytesUtil.Deserialize(br); + Voters = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + BytesUtil.Serialize(Option, bw); + bw.Write(Voters); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPollResults.cs b/src/TgSharp.TL/TL/TLPollResults.cs new file mode 100644 index 0000000..0cef9b8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPollResults.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1465219162)] + public class TLPollResults : TLObject + { + public override int Constructor + { + get + { + return 1465219162; + } + } + + public int Flags { get; set; } + public bool Min { get; set; } + public TLVector Results { get; set; } + public int? TotalVoters { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Min = (Flags & 1) != 0; + if ((Flags & 2) != 0) + Results = (TLVector)ObjectUtils.DeserializeVector(br); + else + Results = null; + + if ((Flags & 4) != 0) + TotalVoters = br.ReadInt32(); + else + TotalVoters = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Results, bw); + if ((Flags & 4) != 0) + bw.Write(TotalVoters.Value); + } + } +} diff --git a/src/TgSharp.TL/TL/TLPopularContact.cs b/src/TgSharp.TL/TL/TLPopularContact.cs new file mode 100644 index 0000000..3a08b05 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPopularContact.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1558266229)] + public class TLPopularContact : TLObject + { + public override int Constructor + { + get + { + return 1558266229; + } + } + + public long ClientId { get; set; } + public int Importers { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + ClientId = br.ReadInt64(); + Importers = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(ClientId); + bw.Write(Importers); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPostAddress.cs b/src/TgSharp.TL/TL/TLPostAddress.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLPostAddress.cs rename to src/TgSharp.TL/TL/TLPostAddress.cs index 66e82f6..943bead 100644 --- a/src/TeleSharp.TL/TL/TLPostAddress.cs +++ b/src/TgSharp.TL/TL/TLPostAddress.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(512535275)] public class TLPostAddress : TLObject @@ -25,10 +27,9 @@ namespace TeleSharp.TL public string CountryIso2 { get; set; } public string PostCode { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,7 +40,6 @@ namespace TeleSharp.TL State = StringUtil.Deserialize(br); CountryIso2 = StringUtil.Deserialize(br); PostCode = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -51,7 +51,6 @@ namespace TeleSharp.TL StringUtil.Serialize(State, bw); StringUtil.Serialize(CountryIso2, bw); StringUtil.Serialize(PostCode, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLPrivacyKeyAddedByPhone.cs b/src/TgSharp.TL/TL/TLPrivacyKeyAddedByPhone.cs new file mode 100644 index 0000000..51a09ac --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyKeyAddedByPhone.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1124062251)] + public class TLPrivacyKeyAddedByPhone : TLAbsPrivacyKey + { + public override int Constructor + { + get + { + return 1124062251; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs b/src/TgSharp.TL/TL/TLPrivacyKeyChatInvite.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs rename to src/TgSharp.TL/TL/TLPrivacyKeyChatInvite.cs index bcd4d8b..813a5c2 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyKeyChatInvite.cs +++ b/src/TgSharp.TL/TL/TLPrivacyKeyChatInvite.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1343122938)] public class TLPrivacyKeyChatInvite : TLAbsPrivacyKey @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLPrivacyKeyForwards.cs b/src/TgSharp.TL/TL/TLPrivacyKeyForwards.cs new file mode 100644 index 0000000..2251b88 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyKeyForwards.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1777096355)] + public class TLPrivacyKeyForwards : TLAbsPrivacyKey + { + public override int Constructor + { + get + { + return 1777096355; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPrivacyKeyPhoneCall.cs b/src/TgSharp.TL/TL/TLPrivacyKeyPhoneCall.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyKeyPhoneCall.cs rename to src/TgSharp.TL/TL/TLPrivacyKeyPhoneCall.cs index fd227f8..e5f4924 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyKeyPhoneCall.cs +++ b/src/TgSharp.TL/TL/TLPrivacyKeyPhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1030105979)] public class TLPrivacyKeyPhoneCall : TLAbsPrivacyKey @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLPrivacyKeyPhoneNumber.cs b/src/TgSharp.TL/TL/TLPrivacyKeyPhoneNumber.cs new file mode 100644 index 0000000..6f35123 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyKeyPhoneNumber.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-778378131)] + public class TLPrivacyKeyPhoneNumber : TLAbsPrivacyKey + { + public override int Constructor + { + get + { + return -778378131; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLPrivacyKeyPhoneP2P.cs b/src/TgSharp.TL/TL/TLPrivacyKeyPhoneP2P.cs new file mode 100644 index 0000000..ef246a7 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyKeyPhoneP2P.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(961092808)] + public class TLPrivacyKeyPhoneP2P : TLAbsPrivacyKey + { + public override int Constructor + { + get + { + return 961092808; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLPrivacyKeyProfilePhoto.cs b/src/TgSharp.TL/TL/TLPrivacyKeyProfilePhoto.cs new file mode 100644 index 0000000..49f4bf3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyKeyProfilePhoto.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1777000467)] + public class TLPrivacyKeyProfilePhoto : TLAbsPrivacyKey + { + public override int Constructor + { + get + { + return -1777000467; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs b/src/TgSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs rename to src/TgSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs index 00ecf71..55d06f1 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs +++ b/src/TgSharp.TL/TL/TLPrivacyKeyStatusTimestamp.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1137792208)] public class TLPrivacyKeyStatusTimestamp : TLAbsPrivacyKey @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs b/src/TgSharp.TL/TL/TLPrivacyValueAllowAll.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs rename to src/TgSharp.TL/TL/TLPrivacyValueAllowAll.cs index 59dc672..606a8ce 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyValueAllowAll.cs +++ b/src/TgSharp.TL/TL/TLPrivacyValueAllowAll.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1698855810)] public class TLPrivacyValueAllowAll : TLAbsPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLPrivacyValueAllowChatParticipants.cs b/src/TgSharp.TL/TL/TLPrivacyValueAllowChatParticipants.cs new file mode 100644 index 0000000..b7a2648 --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyValueAllowChatParticipants.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(415136107)] + public class TLPrivacyValueAllowChatParticipants : TLAbsPrivacyRule + { + public override int Constructor + { + get + { + return 415136107; + } + } + + public TLVector Chats { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Chats, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs b/src/TgSharp.TL/TL/TLPrivacyValueAllowContacts.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs rename to src/TgSharp.TL/TL/TLPrivacyValueAllowContacts.cs index 0fd7f59..8d9f0bc 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyValueAllowContacts.cs +++ b/src/TgSharp.TL/TL/TLPrivacyValueAllowContacts.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-123988)] public class TLPrivacyValueAllowContacts : TLAbsPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs b/src/TgSharp.TL/TL/TLPrivacyValueAllowUsers.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs rename to src/TgSharp.TL/TL/TLPrivacyValueAllowUsers.cs index d59f6d0..e0d76c6 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyValueAllowUsers.cs +++ b/src/TgSharp.TL/TL/TLPrivacyValueAllowUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1297858060)] public class TLPrivacyValueAllowUsers : TLAbsPrivacyRule @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs b/src/TgSharp.TL/TL/TLPrivacyValueDisallowAll.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs rename to src/TgSharp.TL/TL/TLPrivacyValueDisallowAll.cs index a632b37..ffbe527 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyValueDisallowAll.cs +++ b/src/TgSharp.TL/TL/TLPrivacyValueDisallowAll.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1955338397)] public class TLPrivacyValueDisallowAll : TLAbsPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLPrivacyValueDisallowChatParticipants.cs b/src/TgSharp.TL/TL/TLPrivacyValueDisallowChatParticipants.cs new file mode 100644 index 0000000..d02c81a --- /dev/null +++ b/src/TgSharp.TL/TL/TLPrivacyValueDisallowChatParticipants.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1397881200)] + public class TLPrivacyValueDisallowChatParticipants : TLAbsPrivacyRule + { + public override int Constructor + { + get + { + return -1397881200; + } + } + + public TLVector Chats { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Chats = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Chats, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs b/src/TgSharp.TL/TL/TLPrivacyValueDisallowContacts.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs rename to src/TgSharp.TL/TL/TLPrivacyValueDisallowContacts.cs index b68d0ea..a74b9d3 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyValueDisallowContacts.cs +++ b/src/TgSharp.TL/TL/TLPrivacyValueDisallowContacts.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-125240806)] public class TLPrivacyValueDisallowContacts : TLAbsPrivacyRule @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs b/src/TgSharp.TL/TL/TLPrivacyValueDisallowUsers.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs rename to src/TgSharp.TL/TL/TLPrivacyValueDisallowUsers.cs index a977508..2135032 100644 --- a/src/TeleSharp.TL/TL/TLPrivacyValueDisallowUsers.cs +++ b/src/TgSharp.TL/TL/TLPrivacyValueDisallowUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(209668535)] public class TLPrivacyValueDisallowUsers : TLAbsPrivacyRule @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Users { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs b/src/TgSharp.TL/TL/TLReceivedNotifyMessage.cs similarity index 89% rename from src/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs rename to src/TgSharp.TL/TL/TLReceivedNotifyMessage.cs index 7990fde..ebf078a 100644 --- a/src/TeleSharp.TL/TL/TLReceivedNotifyMessage.cs +++ b/src/TgSharp.TL/TL/TLReceivedNotifyMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1551583367)] public class TLReceivedNotifyMessage : TLObject @@ -21,27 +23,22 @@ namespace TeleSharp.TL public int Id { get; set; } public int Flags { get; set; } - public void ComputeFlags() { - Flags = 0; - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); Flags = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); - bw.Write(Flags); bw.Write(Id); - + bw.Write(Flags); } } } diff --git a/src/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs b/src/TgSharp.TL/TL/TLRecentMeUrlChat.cs similarity index 67% rename from src/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs rename to src/TgSharp.TL/TL/TLRecentMeUrlChat.cs index 4fdb71c..988dc8c 100644 --- a/src/TeleSharp.TL/TL/TLInputMediaDocumentExternal.cs +++ b/src/TgSharp.TL/TL/TLRecentMeUrlChat.cs @@ -4,42 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-437690244)] - public class TLInputMediaDocumentExternal : TLAbsInputMedia + [TLObject(-1608834311)] + public class TLRecentMeUrlChat : TLAbsRecentMeUrl { public override int Constructor { get { - return -437690244; + return -1608834311; } } public string Url { get; set; } - public string Caption { get; set; } - + public int ChatId { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Url = StringUtil.Deserialize(br); - Caption = StringUtil.Deserialize(br); - + ChatId = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Url, bw); - StringUtil.Serialize(Caption, bw); - + bw.Write(ChatId); } } } diff --git a/src/TgSharp.TL/TL/TLRecentMeUrlChatInvite.cs b/src/TgSharp.TL/TL/TLRecentMeUrlChatInvite.cs new file mode 100644 index 0000000..7168f5c --- /dev/null +++ b/src/TgSharp.TL/TL/TLRecentMeUrlChatInvite.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-347535331)] + public class TLRecentMeUrlChatInvite : TLAbsRecentMeUrl + { + public override int Constructor + { + get + { + return -347535331; + } + } + + public string Url { get; set; } + public TLAbsChatInvite ChatInvite { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + ChatInvite = (TLAbsChatInvite)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + ObjectUtils.SerializeObject(ChatInvite, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLRecentMeUrlStickerSet.cs b/src/TgSharp.TL/TL/TLRecentMeUrlStickerSet.cs new file mode 100644 index 0000000..453857d --- /dev/null +++ b/src/TgSharp.TL/TL/TLRecentMeUrlStickerSet.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1140172836)] + public class TLRecentMeUrlStickerSet : TLAbsRecentMeUrl + { + public override int Constructor + { + get + { + return -1140172836; + } + } + + public string Url { get; set; } + public TLAbsStickerSetCovered Set { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + Set = (TLAbsStickerSetCovered)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + ObjectUtils.SerializeObject(Set, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLRecentMeUrlUnknown.cs b/src/TgSharp.TL/TL/TLRecentMeUrlUnknown.cs new file mode 100644 index 0000000..f8b34a7 --- /dev/null +++ b/src/TgSharp.TL/TL/TLRecentMeUrlUnknown.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1189204285)] + public class TLRecentMeUrlUnknown : TLAbsRecentMeUrl + { + public override int Constructor + { + get + { + return 1189204285; + } + } + + public string Url { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLRecentMeUrlUser.cs b/src/TgSharp.TL/TL/TLRecentMeUrlUser.cs new file mode 100644 index 0000000..af4968a --- /dev/null +++ b/src/TgSharp.TL/TL/TLRecentMeUrlUser.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1917045962)] + public class TLRecentMeUrlUser : TLAbsRecentMeUrl + { + public override int Constructor + { + get + { + return -1917045962; + } + } + + public string Url { get; set; } + public int UserId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + UserId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + bw.Write(UserId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLReplyInlineMarkup.cs b/src/TgSharp.TL/TL/TLReplyInlineMarkup.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLReplyInlineMarkup.cs rename to src/TgSharp.TL/TL/TLReplyInlineMarkup.cs index 665ea38..692e774 100644 --- a/src/TeleSharp.TL/TL/TLReplyInlineMarkup.cs +++ b/src/TgSharp.TL/TL/TLReplyInlineMarkup.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1218642516)] public class TLReplyInlineMarkup : TLAbsReplyMarkup @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Rows { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Rows = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Rows, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs b/src/TgSharp.TL/TL/TLReplyKeyboardForceReply.cs similarity index 80% rename from src/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs rename to src/TgSharp.TL/TL/TLReplyKeyboardForceReply.cs index a7ca09f..22655ea 100644 --- a/src/TeleSharp.TL/TL/TLReplyKeyboardForceReply.cs +++ b/src/TgSharp.TL/TL/TLReplyKeyboardForceReply.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-200242528)] public class TLReplyKeyboardForceReply : TLAbsReplyMarkup @@ -22,13 +24,9 @@ namespace TeleSharp.TL public bool SingleUse { get; set; } public bool Selective { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = SingleUse ? (Flags | 2) : (Flags & ~2); - Flags = Selective ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,17 +34,12 @@ namespace TeleSharp.TL Flags = br.ReadInt32(); SingleUse = (Flags & 2) != 0; Selective = (Flags & 4) != 0; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - } } } diff --git a/src/TeleSharp.TL/TL/TLReplyKeyboardHide.cs b/src/TgSharp.TL/TL/TLReplyKeyboardHide.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLReplyKeyboardHide.cs rename to src/TgSharp.TL/TL/TLReplyKeyboardHide.cs index 707a1cc..3754f54 100644 --- a/src/TeleSharp.TL/TL/TLReplyKeyboardHide.cs +++ b/src/TgSharp.TL/TL/TLReplyKeyboardHide.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1606526075)] public class TLReplyKeyboardHide : TLAbsReplyMarkup @@ -21,28 +23,21 @@ namespace TeleSharp.TL public int Flags { get; set; } public bool Selective { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Selective ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Selective = (Flags & 4) != 0; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - } } } diff --git a/src/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs b/src/TgSharp.TL/TL/TLReplyKeyboardMarkup.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs rename to src/TgSharp.TL/TL/TLReplyKeyboardMarkup.cs index 7a9385f..3039fa8 100644 --- a/src/TeleSharp.TL/TL/TLReplyKeyboardMarkup.cs +++ b/src/TgSharp.TL/TL/TLReplyKeyboardMarkup.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(889353612)] public class TLReplyKeyboardMarkup : TLAbsReplyMarkup @@ -24,14 +26,9 @@ namespace TeleSharp.TL public bool Selective { get; set; } public TLVector Rows { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Resize ? (Flags | 1) : (Flags & ~1); - Flags = SingleUse ? (Flags | 2) : (Flags & ~2); - Flags = Selective ? (Flags | 4) : (Flags & ~4); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -41,19 +38,13 @@ namespace TeleSharp.TL SingleUse = (Flags & 2) != 0; Selective = (Flags & 4) != 0; Rows = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - ObjectUtils.SerializeObject(Rows, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLRequestInitConnection.cs b/src/TgSharp.TL/TL/TLRequestInitConnection.cs similarity index 58% rename from src/TeleSharp.TL/TL/TLRequestInitConnection.cs rename to src/TgSharp.TL/TL/TLRequestInitConnection.cs index 656fd4b..b68f431 100644 --- a/src/TeleSharp.TL/TL/TLRequestInitConnection.cs +++ b/src/TgSharp.TL/TL/TLRequestInitConnection.cs @@ -4,60 +4,84 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1769565673)] + [TLObject(2018609336)] public class TLRequestInitConnection : TLMethod { public override int Constructor { get { - return 1769565673; + return 2018609336; } } + public int Flags { get; set; } public int ApiId { get; set; } public string DeviceModel { get; set; } public string SystemVersion { get; set; } public string AppVersion { get; set; } + public string SystemLangCode { get; set; } + public string LangPack { get; set; } public string LangCode { get; set; } + public TLInputClientProxy Proxy { get; set; } + public TLAbsJSONValue Params { get; set; } public TLObject Query { get; set; } public TLObject Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); ApiId = br.ReadInt32(); DeviceModel = StringUtil.Deserialize(br); SystemVersion = StringUtil.Deserialize(br); AppVersion = StringUtil.Deserialize(br); + SystemLangCode = StringUtil.Deserialize(br); + LangPack = StringUtil.Deserialize(br); LangCode = StringUtil.Deserialize(br); - Query = (TLObject)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + Proxy = (TLInputClientProxy)ObjectUtils.DeserializeObject(br); + else + Proxy = null; + if ((Flags & 2) != 0) + Params = (TLAbsJSONValue)ObjectUtils.DeserializeObject(br); + else + Params = null; + + Query = (TLObject)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); bw.Write(ApiId); StringUtil.Serialize(DeviceModel, bw); StringUtil.Serialize(SystemVersion, bw); StringUtil.Serialize(AppVersion, bw); + StringUtil.Serialize(SystemLangCode, bw); + StringUtil.Serialize(LangPack, bw); StringUtil.Serialize(LangCode, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Proxy, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Params, bw); ObjectUtils.SerializeObject(Query, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLObject)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs b/src/TgSharp.TL/TL/TLRequestInvokeAfterMsg.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs rename to src/TgSharp.TL/TL/TLRequestInvokeAfterMsg.cs index 69208bc..f3f3600 100644 --- a/src/TeleSharp.TL/TL/TLRequestInvokeAfterMsg.cs +++ b/src/TgSharp.TL/TL/TLRequestInvokeAfterMsg.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-878758099)] public class TLRequestInvokeAfterMsg : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL public TLObject Query { get; set; } public TLObject Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MsgId = br.ReadInt64(); Query = (TLObject)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(MsgId); ObjectUtils.SerializeObject(Query, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLObject)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs b/src/TgSharp.TL/TL/TLRequestInvokeAfterMsgs.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs rename to src/TgSharp.TL/TL/TLRequestInvokeAfterMsgs.cs index aafc050..84d2e22 100644 --- a/src/TeleSharp.TL/TL/TLRequestInvokeAfterMsgs.cs +++ b/src/TgSharp.TL/TL/TLRequestInvokeAfterMsgs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1036301552)] public class TLRequestInvokeAfterMsgs : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL public TLObject Query { get; set; } public TLObject Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { MsgIds = (TLVector)ObjectUtils.DeserializeVector(br); Query = (TLObject)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(MsgIds, bw); ObjectUtils.SerializeObject(Query, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLObject)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs b/src/TgSharp.TL/TL/TLRequestInvokeWithLayer.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs rename to src/TgSharp.TL/TL/TLRequestInvokeWithLayer.cs index 2a45609..a9e9477 100644 --- a/src/TeleSharp.TL/TL/TLRequestInvokeWithLayer.cs +++ b/src/TgSharp.TL/TL/TLRequestInvokeWithLayer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-627372787)] public class TLRequestInvokeWithLayer : TLMethod @@ -22,17 +24,15 @@ namespace TeleSharp.TL public TLObject Query { get; set; } public TLObject Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Layer = br.ReadInt32(); Query = (TLObject)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Layer); ObjectUtils.SerializeObject(Query, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLObject)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/TLRequestInvokeWithMessagesRange.cs b/src/TgSharp.TL/TL/TLRequestInvokeWithMessagesRange.cs new file mode 100644 index 0000000..39c435b --- /dev/null +++ b/src/TgSharp.TL/TL/TLRequestInvokeWithMessagesRange.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(911373810)] + public class TLRequestInvokeWithMessagesRange : TLMethod + { + public override int Constructor + { + get + { + return 911373810; + } + } + + public TLMessageRange Range { get; set; } + public TLObject Query { get; set; } + public TLObject Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Range = (TLMessageRange)ObjectUtils.DeserializeObject(br); + Query = (TLObject)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Range, bw); + ObjectUtils.SerializeObject(Query, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLObject)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TgSharp.TL/TL/TLRequestInvokeWithTakeout.cs b/src/TgSharp.TL/TL/TLRequestInvokeWithTakeout.cs new file mode 100644 index 0000000..f2e8b32 --- /dev/null +++ b/src/TgSharp.TL/TL/TLRequestInvokeWithTakeout.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1398145746)] + public class TLRequestInvokeWithTakeout : TLMethod + { + public override int Constructor + { + get + { + return -1398145746; + } + } + + public long TakeoutId { get; set; } + public TLObject Query { get; set; } + public TLObject Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + TakeoutId = br.ReadInt64(); + Query = (TLObject)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(TakeoutId); + ObjectUtils.SerializeObject(Query, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLObject)ObjectUtils.DeserializeObject(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs b/src/TgSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs rename to src/TgSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs index a74324a..93ebe77 100644 --- a/src/TeleSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs +++ b/src/TgSharp.TL/TL/TLRequestInvokeWithoutUpdates.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1080796745)] public class TLRequestInvokeWithoutUpdates : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL public TLObject Query { get; set; } public TLObject Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Query = (TLObject)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Query, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLObject)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Help/TLAppUpdate.cs b/src/TgSharp.TL/TL/TLRestrictionReason.cs similarity index 55% rename from src/TeleSharp.TL/TL/Help/TLAppUpdate.cs rename to src/TgSharp.TL/TL/TLRestrictionReason.cs index a7a4772..4e1e616 100644 --- a/src/TeleSharp.TL/TL/Help/TLAppUpdate.cs +++ b/src/TgSharp.TL/TL/TLRestrictionReason.cs @@ -4,48 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Help + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1987579119)] - public class TLAppUpdate : TLAbsAppUpdate + [TLObject(-797791052)] + public class TLRestrictionReason : TLObject { public override int Constructor { get { - return -1987579119; + return -797791052; } } - public int Id { get; set; } - public bool Critical { get; set; } - public string Url { get; set; } + public string Platform { get; set; } + public string Reason { get; set; } public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Id = br.ReadInt32(); - Critical = BoolUtil.Deserialize(br); - Url = StringUtil.Deserialize(br); + Platform = StringUtil.Deserialize(br); + Reason = StringUtil.Deserialize(br); Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - bw.Write(Id); - BoolUtil.Serialize(Critical, bw); - StringUtil.Serialize(Url, bw); + StringUtil.Serialize(Platform, bw); + StringUtil.Serialize(Reason, bw); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLSavedPhoneContact.cs b/src/TgSharp.TL/TL/TLSavedPhoneContact.cs new file mode 100644 index 0000000..b9eae8a --- /dev/null +++ b/src/TgSharp.TL/TL/TLSavedPhoneContact.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(289586518)] + public class TLSavedPhoneContact : TLObject + { + public override int Constructor + { + get + { + return 289586518; + } + } + + public string Phone { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public int Date { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Phone = StringUtil.Deserialize(br); + FirstName = StringUtil.Deserialize(br); + LastName = StringUtil.Deserialize(br); + Date = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Phone, bw); + StringUtil.Serialize(FirstName, bw); + StringUtil.Serialize(LastName, bw); + bw.Write(Date); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureCredentialsEncrypted.cs b/src/TgSharp.TL/TL/TLSecureCredentialsEncrypted.cs new file mode 100644 index 0000000..090ef63 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureCredentialsEncrypted.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(871426631)] + public class TLSecureCredentialsEncrypted : TLObject + { + public override int Constructor + { + get + { + return 871426631; + } + } + + public byte[] Data { get; set; } + public byte[] Hash { get; set; } + public byte[] Secret { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Data = BytesUtil.Deserialize(br); + Hash = BytesUtil.Deserialize(br); + Secret = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(Data, bw); + BytesUtil.Serialize(Hash, bw); + BytesUtil.Serialize(Secret, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureData.cs b/src/TgSharp.TL/TL/TLSecureData.cs new file mode 100644 index 0000000..6e9594d --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureData.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1964327229)] + public class TLSecureData : TLObject + { + public override int Constructor + { + get + { + return -1964327229; + } + } + + public byte[] Data { get; set; } + public byte[] DataHash { get; set; } + public byte[] Secret { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Data = BytesUtil.Deserialize(br); + DataHash = BytesUtil.Deserialize(br); + Secret = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(Data, bw); + BytesUtil.Serialize(DataHash, bw); + BytesUtil.Serialize(Secret, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureFile.cs b/src/TgSharp.TL/TL/TLSecureFile.cs new file mode 100644 index 0000000..b15fb3f --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureFile.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-534283678)] + public class TLSecureFile : TLAbsSecureFile + { + public override int Constructor + { + get + { + return -534283678; + } + } + + public long Id { get; set; } + public long AccessHash { get; set; } + public int Size { get; set; } + public int DcId { get; set; } + public int Date { get; set; } + public byte[] FileHash { get; set; } + public byte[] Secret { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + Size = br.ReadInt32(); + DcId = br.ReadInt32(); + Date = br.ReadInt32(); + FileHash = BytesUtil.Deserialize(br); + Secret = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(AccessHash); + bw.Write(Size); + bw.Write(DcId); + bw.Write(Date); + BytesUtil.Serialize(FileHash, bw); + BytesUtil.Serialize(Secret, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureFileEmpty.cs b/src/TgSharp.TL/TL/TLSecureFileEmpty.cs new file mode 100644 index 0000000..e853ea6 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureFileEmpty.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1679398724)] + public class TLSecureFileEmpty : TLAbsSecureFile + { + public override int Constructor + { + get + { + return 1679398724; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000.cs b/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000.cs new file mode 100644 index 0000000..175c0f3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1141711456)] + public class TLSecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000 : TLAbsSecurePasswordKdfAlgo + { + public override int Constructor + { + get + { + return -1141711456; + } + } + + public byte[] Salt { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Salt = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(Salt, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoSHA512.cs b/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoSHA512.cs new file mode 100644 index 0000000..9a02275 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoSHA512.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2042159726)] + public class TLSecurePasswordKdfAlgoSHA512 : TLAbsSecurePasswordKdfAlgo + { + public override int Constructor + { + get + { + return -2042159726; + } + } + + public byte[] Salt { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Salt = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(Salt, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoUnknown.cs b/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoUnknown.cs new file mode 100644 index 0000000..52335c8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecurePasswordKdfAlgoUnknown.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(4883767)] + public class TLSecurePasswordKdfAlgoUnknown : TLAbsSecurePasswordKdfAlgo + { + public override int Constructor + { + get + { + return 4883767; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/Account/TLPasswordSettings.cs b/src/TgSharp.TL/TL/TLSecurePlainEmail.cs similarity index 77% rename from src/TeleSharp.TL/TL/Account/TLPasswordSettings.cs rename to src/TgSharp.TL/TL/TLSecurePlainEmail.cs index 0b609e5..a6178a7 100644 --- a/src/TeleSharp.TL/TL/Account/TLPasswordSettings.cs +++ b/src/TgSharp.TL/TL/TLSecurePlainEmail.cs @@ -4,39 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Account + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1212732749)] - public class TLPasswordSettings : TLObject + [TLObject(569137759)] + public class TLSecurePlainEmail : TLAbsSecurePlainData { public override int Constructor { get { - return -1212732749; + return 569137759; } } public string Email { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Email = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Email, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLSecurePlainPhone.cs b/src/TgSharp.TL/TL/TLSecurePlainPhone.cs new file mode 100644 index 0000000..c7c7077 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecurePlainPhone.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(2103482845)] + public class TLSecurePlainPhone : TLAbsSecurePlainData + { + public override int Constructor + { + get + { + return 2103482845; + } + } + + public string Phone { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Phone = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Phone, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureRequiredType.cs b/src/TgSharp.TL/TL/TLSecureRequiredType.cs new file mode 100644 index 0000000..bbd8b3b --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureRequiredType.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2103600678)] + public class TLSecureRequiredType : TLAbsSecureRequiredType + { + public override int Constructor + { + get + { + return -2103600678; + } + } + + public int Flags { get; set; } + public bool NativeNames { get; set; } + public bool SelfieRequired { get; set; } + public bool TranslationRequired { get; set; } + public TLAbsSecureValueType Type { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + NativeNames = (Flags & 1) != 0; + SelfieRequired = (Flags & 2) != 0; + TranslationRequired = (Flags & 4) != 0; + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Type, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureRequiredTypeOneOf.cs b/src/TgSharp.TL/TL/TLSecureRequiredTypeOneOf.cs new file mode 100644 index 0000000..f86fe20 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureRequiredTypeOneOf.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(41187252)] + public class TLSecureRequiredTypeOneOf : TLAbsSecureRequiredType + { + public override int Constructor + { + get + { + return 41187252; + } + } + + public TLVector Types { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Types = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Types, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureSecretSettings.cs b/src/TgSharp.TL/TL/TLSecureSecretSettings.cs new file mode 100644 index 0000000..fa89f86 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureSecretSettings.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(354925740)] + public class TLSecureSecretSettings : TLObject + { + public override int Constructor + { + get + { + return 354925740; + } + } + + public TLAbsSecurePasswordKdfAlgo SecureAlgo { get; set; } + public byte[] SecureSecret { get; set; } + public long SecureSecretId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + SecureAlgo = (TLAbsSecurePasswordKdfAlgo)ObjectUtils.DeserializeObject(br); + SecureSecret = BytesUtil.Deserialize(br); + SecureSecretId = br.ReadInt64(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(SecureAlgo, bw); + BytesUtil.Serialize(SecureSecret, bw); + bw.Write(SecureSecretId); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValue.cs b/src/TgSharp.TL/TL/TLSecureValue.cs new file mode 100644 index 0000000..de15b0d --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValue.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(411017418)] + public class TLSecureValue : TLObject + { + public override int Constructor + { + get + { + return 411017418; + } + } + + public int Flags { get; set; } + public TLAbsSecureValueType Type { get; set; } + public TLSecureData Data { get; set; } + public TLAbsSecureFile FrontSide { get; set; } + public TLAbsSecureFile ReverseSide { get; set; } + public TLAbsSecureFile Selfie { get; set; } + public TLVector Translation { get; set; } + public TLVector Files { get; set; } + public TLAbsSecurePlainData PlainData { get; set; } + public byte[] Hash { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + if ((Flags & 1) != 0) + Data = (TLSecureData)ObjectUtils.DeserializeObject(br); + else + Data = null; + + if ((Flags & 2) != 0) + FrontSide = (TLAbsSecureFile)ObjectUtils.DeserializeObject(br); + else + FrontSide = null; + + if ((Flags & 4) != 0) + ReverseSide = (TLAbsSecureFile)ObjectUtils.DeserializeObject(br); + else + ReverseSide = null; + + if ((Flags & 8) != 0) + Selfie = (TLAbsSecureFile)ObjectUtils.DeserializeObject(br); + else + Selfie = null; + + if ((Flags & 64) != 0) + Translation = (TLVector)ObjectUtils.DeserializeVector(br); + else + Translation = null; + + if ((Flags & 16) != 0) + Files = (TLVector)ObjectUtils.DeserializeVector(br); + else + Files = null; + + if ((Flags & 32) != 0) + PlainData = (TLAbsSecurePlainData)ObjectUtils.DeserializeObject(br); + else + PlainData = null; + + Hash = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Type, bw); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Data, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(FrontSide, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(ReverseSide, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Selfie, bw); + if ((Flags & 64) != 0) + ObjectUtils.SerializeObject(Translation, bw); + if ((Flags & 16) != 0) + ObjectUtils.SerializeObject(Files, bw); + if ((Flags & 32) != 0) + ObjectUtils.SerializeObject(PlainData, bw); + BytesUtil.Serialize(Hash, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueError.cs b/src/TgSharp.TL/TL/TLSecureValueError.cs new file mode 100644 index 0000000..366e36c --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueError.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2036501105)] + public class TLSecureValueError : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return -2036501105; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] Hash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + Hash = BytesUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(Hash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorData.cs b/src/TgSharp.TL/TL/TLSecureValueErrorData.cs new file mode 100644 index 0000000..4bbd3bc --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorData.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-391902247)] + public class TLSecureValueErrorData : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return -391902247; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] DataHash { get; set; } + public string Field { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + DataHash = BytesUtil.Deserialize(br); + Field = StringUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(DataHash, bw); + StringUtil.Serialize(Field, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorFile.cs b/src/TgSharp.TL/TL/TLSecureValueErrorFile.cs new file mode 100644 index 0000000..dff2eab --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorFile.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(2054162547)] + public class TLSecureValueErrorFile : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return 2054162547; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = BytesUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorFiles.cs b/src/TgSharp.TL/TL/TLSecureValueErrorFiles.cs new file mode 100644 index 0000000..c8a94b2 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorFiles.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1717706985)] + public class TLSecureValueErrorFiles : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return 1717706985; + } + } + + public TLAbsSecureValueType Type { get; set; } + public TLVector FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = (TLVector)ObjectUtils.DeserializeVector(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + ObjectUtils.SerializeObject(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorFrontSide.cs b/src/TgSharp.TL/TL/TLSecureValueErrorFrontSide.cs new file mode 100644 index 0000000..67e6428 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorFrontSide.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(12467706)] + public class TLSecureValueErrorFrontSide : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return 12467706; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = BytesUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorReverseSide.cs b/src/TgSharp.TL/TL/TLSecureValueErrorReverseSide.cs new file mode 100644 index 0000000..6d0fcf0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorReverseSide.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2037765467)] + public class TLSecureValueErrorReverseSide : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return -2037765467; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = BytesUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorSelfie.cs b/src/TgSharp.TL/TL/TLSecureValueErrorSelfie.cs new file mode 100644 index 0000000..5187202 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorSelfie.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-449327402)] + public class TLSecureValueErrorSelfie : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return -449327402; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = BytesUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorTranslationFile.cs b/src/TgSharp.TL/TL/TLSecureValueErrorTranslationFile.cs new file mode 100644 index 0000000..ba9d878 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorTranslationFile.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1592506512)] + public class TLSecureValueErrorTranslationFile : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return -1592506512; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = BytesUtil.Deserialize(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueErrorTranslationFiles.cs b/src/TgSharp.TL/TL/TLSecureValueErrorTranslationFiles.cs new file mode 100644 index 0000000..c25f4ee --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueErrorTranslationFiles.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(878931416)] + public class TLSecureValueErrorTranslationFiles : TLAbsSecureValueError + { + public override int Constructor + { + get + { + return 878931416; + } + } + + public TLAbsSecureValueType Type { get; set; } + public TLVector FileHash { get; set; } + public string Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + FileHash = (TLVector)ObjectUtils.DeserializeVector(br); + Text = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + ObjectUtils.SerializeObject(FileHash, bw); + StringUtil.Serialize(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueHash.cs b/src/TgSharp.TL/TL/TLSecureValueHash.cs new file mode 100644 index 0000000..f94a835 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueHash.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-316748368)] + public class TLSecureValueHash : TLObject + { + public override int Constructor + { + get + { + return -316748368; + } + } + + public TLAbsSecureValueType Type { get; set; } + public byte[] Hash { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Type = (TLAbsSecureValueType)ObjectUtils.DeserializeObject(br); + Hash = BytesUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Type, bw); + BytesUtil.Serialize(Hash, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeAddress.cs b/src/TgSharp.TL/TL/TLSecureValueTypeAddress.cs new file mode 100644 index 0000000..8fc9940 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeAddress.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-874308058)] + public class TLSecureValueTypeAddress : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -874308058; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeBankStatement.cs b/src/TgSharp.TL/TL/TLSecureValueTypeBankStatement.cs new file mode 100644 index 0000000..2e74771 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeBankStatement.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1995211763)] + public class TLSecureValueTypeBankStatement : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1995211763; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeDriverLicense.cs b/src/TgSharp.TL/TL/TLSecureValueTypeDriverLicense.cs new file mode 100644 index 0000000..6753a92 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeDriverLicense.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(115615172)] + public class TLSecureValueTypeDriverLicense : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return 115615172; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeEmail.cs b/src/TgSharp.TL/TL/TLSecureValueTypeEmail.cs new file mode 100644 index 0000000..b47bd49 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeEmail.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1908627474)] + public class TLSecureValueTypeEmail : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1908627474; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeIdentityCard.cs b/src/TgSharp.TL/TL/TLSecureValueTypeIdentityCard.cs new file mode 100644 index 0000000..0f5d1ba --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeIdentityCard.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1596951477)] + public class TLSecureValueTypeIdentityCard : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1596951477; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeInternalPassport.cs b/src/TgSharp.TL/TL/TLSecureValueTypeInternalPassport.cs new file mode 100644 index 0000000..03a9db0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeInternalPassport.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1717268701)] + public class TLSecureValueTypeInternalPassport : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1717268701; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypePassport.cs b/src/TgSharp.TL/TL/TLSecureValueTypePassport.cs new file mode 100644 index 0000000..eeca536 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypePassport.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1034709504)] + public class TLSecureValueTypePassport : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return 1034709504; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypePassportRegistration.cs b/src/TgSharp.TL/TL/TLSecureValueTypePassportRegistration.cs new file mode 100644 index 0000000..7602768 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypePassportRegistration.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1713143702)] + public class TLSecureValueTypePassportRegistration : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1713143702; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypePersonalDetails.cs b/src/TgSharp.TL/TL/TLSecureValueTypePersonalDetails.cs new file mode 100644 index 0000000..1c7198d --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypePersonalDetails.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1658158621)] + public class TLSecureValueTypePersonalDetails : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1658158621; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypePhone.cs b/src/TgSharp.TL/TL/TLSecureValueTypePhone.cs new file mode 100644 index 0000000..eb85d84 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypePhone.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1289704741)] + public class TLSecureValueTypePhone : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1289704741; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeRentalAgreement.cs b/src/TgSharp.TL/TL/TLSecureValueTypeRentalAgreement.cs new file mode 100644 index 0000000..7b467f8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeRentalAgreement.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1954007928)] + public class TLSecureValueTypeRentalAgreement : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -1954007928; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeTemporaryRegistration.cs b/src/TgSharp.TL/TL/TLSecureValueTypeTemporaryRegistration.cs new file mode 100644 index 0000000..77413c3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeTemporaryRegistration.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-368907213)] + public class TLSecureValueTypeTemporaryRegistration : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -368907213; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLSecureValueTypeUtilityBill.cs b/src/TgSharp.TL/TL/TLSecureValueTypeUtilityBill.cs new file mode 100644 index 0000000..60d70b8 --- /dev/null +++ b/src/TgSharp.TL/TL/TLSecureValueTypeUtilityBill.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-63531698)] + public class TLSecureValueTypeUtilityBill : TLAbsSecureValueType + { + public override int Constructor + { + get + { + return -63531698; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLSendMessageCancelAction.cs b/src/TgSharp.TL/TL/TLSendMessageCancelAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageCancelAction.cs rename to src/TgSharp.TL/TL/TLSendMessageCancelAction.cs index cd8aff8..bb4cf86 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageCancelAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageCancelAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-44119819)] public class TLSendMessageCancelAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs b/src/TgSharp.TL/TL/TLSendMessageChooseContactAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs rename to src/TgSharp.TL/TL/TLSendMessageChooseContactAction.cs index 609d518..6096719 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageChooseContactAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageChooseContactAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1653390447)] public class TLSendMessageChooseContactAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs b/src/TgSharp.TL/TL/TLSendMessageGamePlayAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs rename to src/TgSharp.TL/TL/TLSendMessageGamePlayAction.cs index df56b60..93996dc 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageGamePlayAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageGamePlayAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-580219064)] public class TLSendMessageGamePlayAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs b/src/TgSharp.TL/TL/TLSendMessageGeoLocationAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs rename to src/TgSharp.TL/TL/TLSendMessageGeoLocationAction.cs index f93684c..22fa240 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageGeoLocationAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageGeoLocationAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(393186209)] public class TLSendMessageGeoLocationAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs b/src/TgSharp.TL/TL/TLSendMessageRecordAudioAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs rename to src/TgSharp.TL/TL/TLSendMessageRecordAudioAction.cs index 68dc5a7..633b1a1 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageRecordAudioAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageRecordAudioAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-718310409)] public class TLSendMessageRecordAudioAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageRecordRoundAction.cs b/src/TgSharp.TL/TL/TLSendMessageRecordRoundAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageRecordRoundAction.cs rename to src/TgSharp.TL/TL/TLSendMessageRecordRoundAction.cs index 0ac0e85..0cb248a 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageRecordRoundAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageRecordRoundAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1997373508)] public class TLSendMessageRecordRoundAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs b/src/TgSharp.TL/TL/TLSendMessageRecordVideoAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs rename to src/TgSharp.TL/TL/TLSendMessageRecordVideoAction.cs index a169573..6a2dae0 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageRecordVideoAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageRecordVideoAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1584933265)] public class TLSendMessageRecordVideoAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageTypingAction.cs b/src/TgSharp.TL/TL/TLSendMessageTypingAction.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLSendMessageTypingAction.cs rename to src/TgSharp.TL/TL/TLSendMessageTypingAction.cs index 72237c8..f8baef3 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageTypingAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageTypingAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(381645902)] public class TLSendMessageTypingAction : TLAbsSendMessageAction @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs b/src/TgSharp.TL/TL/TLSendMessageUploadAudioAction.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs rename to src/TgSharp.TL/TL/TLSendMessageUploadAudioAction.cs index d97621e..96e9b01 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageUploadAudioAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageUploadAudioAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-212740181)] public class TLSendMessageUploadAudioAction : TLAbsSendMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Progress { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Progress); - } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs b/src/TgSharp.TL/TL/TLSendMessageUploadDocumentAction.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs rename to src/TgSharp.TL/TL/TLSendMessageUploadDocumentAction.cs index fe74fcc..116977a 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageUploadDocumentAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageUploadDocumentAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1441998364)] public class TLSendMessageUploadDocumentAction : TLAbsSendMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Progress { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Progress); - } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs b/src/TgSharp.TL/TL/TLSendMessageUploadPhotoAction.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs rename to src/TgSharp.TL/TL/TLSendMessageUploadPhotoAction.cs index c06d315..283434d 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageUploadPhotoAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageUploadPhotoAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-774682074)] public class TLSendMessageUploadPhotoAction : TLAbsSendMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Progress { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Progress); - } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageUploadRoundAction.cs b/src/TgSharp.TL/TL/TLSendMessageUploadRoundAction.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLSendMessageUploadRoundAction.cs rename to src/TgSharp.TL/TL/TLSendMessageUploadRoundAction.cs index e92b792..ccc76c9 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageUploadRoundAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageUploadRoundAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(608050278)] public class TLSendMessageUploadRoundAction : TLAbsSendMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Progress { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Progress); - } } } diff --git a/src/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs b/src/TgSharp.TL/TL/TLSendMessageUploadVideoAction.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs rename to src/TgSharp.TL/TL/TLSendMessageUploadVideoAction.cs index 84470c8..77fb4f7 100644 --- a/src/TeleSharp.TL/TL/TLSendMessageUploadVideoAction.cs +++ b/src/TgSharp.TL/TL/TLSendMessageUploadVideoAction.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-378127636)] public class TLSendMessageUploadVideoAction : TLAbsSendMessageAction @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Progress { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Progress = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Progress); - } } } diff --git a/src/TeleSharp.TL/TL/TLShippingOption.cs b/src/TgSharp.TL/TL/TLShippingOption.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLShippingOption.cs rename to src/TgSharp.TL/TL/TLShippingOption.cs index 1246efb..2bac4ad 100644 --- a/src/TeleSharp.TL/TL/TLShippingOption.cs +++ b/src/TgSharp.TL/TL/TLShippingOption.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1239335713)] public class TLShippingOption : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL public string Title { get; set; } public TLVector Prices { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Id = StringUtil.Deserialize(br); Title = StringUtil.Deserialize(br); Prices = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Id, bw); StringUtil.Serialize(Title, bw); ObjectUtils.SerializeObject(Prices, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLStatsURL.cs b/src/TgSharp.TL/TL/TLStatsURL.cs new file mode 100644 index 0000000..3a0b758 --- /dev/null +++ b/src/TgSharp.TL/TL/TLStatsURL.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1202287072)] + public class TLStatsURL : TLObject + { + public override int Constructor + { + get + { + return 1202287072; + } + } + + public string Url { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLStickerPack.cs b/src/TgSharp.TL/TL/TLStickerPack.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLStickerPack.cs rename to src/TgSharp.TL/TL/TLStickerPack.cs index dbe1c62..c600e1a 100644 --- a/src/TeleSharp.TL/TL/TLStickerPack.cs +++ b/src/TgSharp.TL/TL/TLStickerPack.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(313694676)] public class TLStickerPack : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public string Emoticon { get; set; } public TLVector Documents { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Emoticon = StringUtil.Deserialize(br); Documents = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); StringUtil.Serialize(Emoticon, bw); ObjectUtils.SerializeObject(Documents, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLStickerSet.cs b/src/TgSharp.TL/TL/TLStickerSet.cs similarity index 61% rename from src/TeleSharp.TL/TL/TLStickerSet.cs rename to src/TgSharp.TL/TL/TLStickerSet.cs index 73724d1..e151c6e 100644 --- a/src/TeleSharp.TL/TL/TLStickerSet.cs +++ b/src/TgSharp.TL/TL/TLStickerSet.cs @@ -4,75 +4,88 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-852477119)] + [TLObject(-290164953)] public class TLStickerSet : TLObject { public override int Constructor { get { - return -852477119; + return -290164953; } } 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 bool Animated { get; set; } + public int? InstalledDate { get; set; } public long Id { get; set; } public long AccessHash { get; set; } public string Title { get; set; } public string ShortName { get; set; } + public TLAbsPhotoSize Thumb { get; set; } + public int? ThumbDcId { 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); - + // do nothing } 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; + Animated = (Flags & 32) != 0; + if ((Flags & 1) != 0) + InstalledDate = br.ReadInt32(); + else + InstalledDate = null; + Id = br.ReadInt64(); AccessHash = br.ReadInt64(); Title = StringUtil.Deserialize(br); ShortName = StringUtil.Deserialize(br); + if ((Flags & 16) != 0) + Thumb = (TLAbsPhotoSize)ObjectUtils.DeserializeObject(br); + else + Thumb = null; + + if ((Flags & 16) != 0) + ThumbDcId = br.ReadInt32(); + else + ThumbDcId = null; + Count = br.ReadInt32(); Hash = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - + if ((Flags & 1) != 0) + bw.Write(InstalledDate.Value); bw.Write(Id); bw.Write(AccessHash); StringUtil.Serialize(Title, bw); StringUtil.Serialize(ShortName, bw); + if ((Flags & 16) != 0) + ObjectUtils.SerializeObject(Thumb, bw); + if ((Flags & 16) != 0) + bw.Write(ThumbDcId.Value); bw.Write(Count); bw.Write(Hash); - } } } diff --git a/src/TeleSharp.TL/TL/TLStickerSetCovered.cs b/src/TgSharp.TL/TL/TLStickerSetCovered.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLStickerSetCovered.cs rename to src/TgSharp.TL/TL/TLStickerSetCovered.cs index 28505ee..c68c9d7 100644 --- a/src/TeleSharp.TL/TL/TLStickerSetCovered.cs +++ b/src/TgSharp.TL/TL/TLStickerSetCovered.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1678812626)] public class TLStickerSetCovered : TLAbsStickerSetCovered @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLStickerSet Set { get; set; } public TLAbsDocument Cover { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Set = (TLStickerSet)ObjectUtils.DeserializeObject(br); Cover = (TLAbsDocument)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Set, bw); ObjectUtils.SerializeObject(Cover, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs b/src/TgSharp.TL/TL/TLStickerSetMultiCovered.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs rename to src/TgSharp.TL/TL/TLStickerSetMultiCovered.cs index 4a7c85f..b5cc5d8 100644 --- a/src/TeleSharp.TL/TL/TLStickerSetMultiCovered.cs +++ b/src/TgSharp.TL/TL/TLStickerSetMultiCovered.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(872932635)] public class TLStickerSetMultiCovered : TLAbsStickerSetCovered @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLStickerSet Set { get; set; } public TLVector Covers { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Set = (TLStickerSet)ObjectUtils.DeserializeObject(br); Covers = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Set, bw); ObjectUtils.SerializeObject(Covers, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLTextAnchor.cs b/src/TgSharp.TL/TL/TLTextAnchor.cs new file mode 100644 index 0000000..8efc6a3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTextAnchor.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(894777186)] + public class TLTextAnchor : TLAbsRichText + { + public override int Constructor + { + get + { + return 894777186; + } + } + + public TLAbsRichText Text { get; set; } + public string Name { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + Name = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + StringUtil.Serialize(Name, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTextBold.cs b/src/TgSharp.TL/TL/TLTextBold.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextBold.cs rename to src/TgSharp.TL/TL/TLTextBold.cs index a87e0fb..848305d 100644 --- a/src/TeleSharp.TL/TL/TLTextBold.cs +++ b/src/TgSharp.TL/TL/TLTextBold.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1730456516)] public class TLTextBold : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLTextConcat.cs b/src/TgSharp.TL/TL/TLTextConcat.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextConcat.cs rename to src/TgSharp.TL/TL/TLTextConcat.cs index af6a538..93556f9 100644 --- a/src/TeleSharp.TL/TL/TLTextConcat.cs +++ b/src/TgSharp.TL/TL/TLTextConcat.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2120376535)] public class TLTextConcat : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector Texts { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Texts = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Texts, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLTextEmail.cs b/src/TgSharp.TL/TL/TLTextEmail.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLTextEmail.cs rename to src/TgSharp.TL/TL/TLTextEmail.cs index 6c84464..9730802 100644 --- a/src/TeleSharp.TL/TL/TLTextEmail.cs +++ b/src/TgSharp.TL/TL/TLTextEmail.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-564523562)] public class TLTextEmail : TLAbsRichText @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } public string Email { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); Email = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); StringUtil.Serialize(Email, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLTextEmpty.cs b/src/TgSharp.TL/TL/TLTextEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLTextEmpty.cs rename to src/TgSharp.TL/TL/TLTextEmpty.cs index fa71a43..92d0dd6 100644 --- a/src/TeleSharp.TL/TL/TLTextEmpty.cs +++ b/src/TgSharp.TL/TL/TLTextEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-599948721)] public class TLTextEmpty : TLAbsRichText @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLTextFixed.cs b/src/TgSharp.TL/TL/TLTextFixed.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextFixed.cs rename to src/TgSharp.TL/TL/TLTextFixed.cs index a9017a2..272cd45 100644 --- a/src/TeleSharp.TL/TL/TLTextFixed.cs +++ b/src/TgSharp.TL/TL/TLTextFixed.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1816074681)] public class TLTextFixed : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLTextImage.cs b/src/TgSharp.TL/TL/TLTextImage.cs new file mode 100644 index 0000000..9b6f83c --- /dev/null +++ b/src/TgSharp.TL/TL/TLTextImage.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(136105807)] + public class TLTextImage : TLAbsRichText + { + public override int Constructor + { + get + { + return 136105807; + } + } + + public long DocumentId { get; set; } + public int W { get; set; } + public int H { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + DocumentId = br.ReadInt64(); + W = br.ReadInt32(); + H = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(DocumentId); + bw.Write(W); + bw.Write(H); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTextItalic.cs b/src/TgSharp.TL/TL/TLTextItalic.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextItalic.cs rename to src/TgSharp.TL/TL/TLTextItalic.cs index 228cb19..42a36e4 100644 --- a/src/TeleSharp.TL/TL/TLTextItalic.cs +++ b/src/TgSharp.TL/TL/TLTextItalic.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-653089380)] public class TLTextItalic : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLTextMarked.cs b/src/TgSharp.TL/TL/TLTextMarked.cs new file mode 100644 index 0000000..465061c --- /dev/null +++ b/src/TgSharp.TL/TL/TLTextMarked.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(55281185)] + public class TLTextMarked : TLAbsRichText + { + public override int Constructor + { + get + { + return 55281185; + } + } + + public TLAbsRichText Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLTextPhone.cs b/src/TgSharp.TL/TL/TLTextPhone.cs new file mode 100644 index 0000000..540e68f --- /dev/null +++ b/src/TgSharp.TL/TL/TLTextPhone.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(483104362)] + public class TLTextPhone : TLAbsRichText + { + public override int Constructor + { + get + { + return 483104362; + } + } + + public TLAbsRichText Text { get; set; } + public string Phone { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + Phone = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + StringUtil.Serialize(Phone, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTextPlain.cs b/src/TgSharp.TL/TL/TLTextPlain.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextPlain.cs rename to src/TgSharp.TL/TL/TLTextPlain.cs index fadef1a..741fbb3 100644 --- a/src/TeleSharp.TL/TL/TLTextPlain.cs +++ b/src/TgSharp.TL/TL/TLTextPlain.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1950782688)] public class TLTextPlain : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public string Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); StringUtil.Serialize(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLTextStrike.cs b/src/TgSharp.TL/TL/TLTextStrike.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextStrike.cs rename to src/TgSharp.TL/TL/TLTextStrike.cs index 9fb4a16..81983e8 100644 --- a/src/TeleSharp.TL/TL/TLTextStrike.cs +++ b/src/TgSharp.TL/TL/TLTextStrike.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1678197867)] public class TLTextStrike : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLTextSubscript.cs b/src/TgSharp.TL/TL/TLTextSubscript.cs new file mode 100644 index 0000000..856c989 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTextSubscript.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-311786236)] + public class TLTextSubscript : TLAbsRichText + { + public override int Constructor + { + get + { + return -311786236; + } + } + + public TLAbsRichText Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLTextSuperscript.cs b/src/TgSharp.TL/TL/TLTextSuperscript.cs new file mode 100644 index 0000000..aee3b28 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTextSuperscript.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-939827711)] + public class TLTextSuperscript : TLAbsRichText + { + public override int Constructor + { + get + { + return -939827711; + } + } + + public TLAbsRichText Text { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Text, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTextUnderline.cs b/src/TgSharp.TL/TL/TLTextUnderline.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLTextUnderline.cs rename to src/TgSharp.TL/TL/TLTextUnderline.cs index 2aacc6e..5f592bd 100644 --- a/src/TeleSharp.TL/TL/TLTextUnderline.cs +++ b/src/TgSharp.TL/TL/TLTextUnderline.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1054465340)] public class TLTextUnderline : TLAbsRichText @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsRichText Text { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Text, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLTextUrl.cs b/src/TgSharp.TL/TL/TLTextUrl.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLTextUrl.cs rename to src/TgSharp.TL/TL/TLTextUrl.cs index b7be22b..484f88c 100644 --- a/src/TeleSharp.TL/TL/TLTextUrl.cs +++ b/src/TgSharp.TL/TL/TLTextUrl.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1009288385)] public class TLTextUrl : TLAbsRichText @@ -22,10 +24,9 @@ namespace TeleSharp.TL public string Url { get; set; } public long WebpageId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Text = (TLAbsRichText)ObjectUtils.DeserializeObject(br); Url = StringUtil.Deserialize(br); WebpageId = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Text, bw); StringUtil.Serialize(Url, bw); bw.Write(WebpageId); - } } } diff --git a/src/TgSharp.TL/TL/TLTheme.cs b/src/TgSharp.TL/TL/TLTheme.cs new file mode 100644 index 0000000..946ceb5 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTheme.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(42930452)] + public class TLTheme : TLObject + { + public override int Constructor + { + get + { + return 42930452; + } + } + + public int Flags { get; set; } + public bool Creator { get; set; } + public bool Default { get; set; } + public long Id { get; set; } + public long AccessHash { get; set; } + public string Slug { get; set; } + public string Title { get; set; } + public TLAbsDocument Document { get; set; } + public TLThemeSettings Settings { get; set; } + public int InstallsCount { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Creator = (Flags & 1) != 0; + Default = (Flags & 2) != 0; + Id = br.ReadInt64(); + AccessHash = br.ReadInt64(); + Slug = StringUtil.Deserialize(br); + Title = StringUtil.Deserialize(br); + if ((Flags & 4) != 0) + Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); + else + Document = null; + + if ((Flags & 8) != 0) + Settings = (TLThemeSettings)ObjectUtils.DeserializeObject(br); + else + Settings = null; + + InstallsCount = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(Id); + bw.Write(AccessHash); + StringUtil.Serialize(Slug, bw); + StringUtil.Serialize(Title, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(Document, bw); + if ((Flags & 8) != 0) + ObjectUtils.SerializeObject(Settings, bw); + bw.Write(InstallsCount); + } + } +} diff --git a/src/TgSharp.TL/TL/TLThemeSettings.cs b/src/TgSharp.TL/TL/TLThemeSettings.cs new file mode 100644 index 0000000..1d929dc --- /dev/null +++ b/src/TgSharp.TL/TL/TLThemeSettings.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1676371894)] + public class TLThemeSettings : TLObject + { + public override int Constructor + { + get + { + return -1676371894; + } + } + + public int Flags { get; set; } + public TLAbsBaseTheme BaseTheme { get; set; } + public int AccentColor { get; set; } + public int? MessageTopColor { get; set; } + public int? MessageBottomColor { get; set; } + public TLAbsWallPaper Wallpaper { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + BaseTheme = (TLAbsBaseTheme)ObjectUtils.DeserializeObject(br); + AccentColor = br.ReadInt32(); + if ((Flags & 1) != 0) + MessageTopColor = br.ReadInt32(); + else + MessageTopColor = null; + + if ((Flags & 1) != 0) + MessageBottomColor = br.ReadInt32(); + else + MessageBottomColor = null; + + if ((Flags & 2) != 0) + Wallpaper = (TLAbsWallPaper)ObjectUtils.DeserializeObject(br); + else + Wallpaper = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(BaseTheme, bw); + bw.Write(AccentColor); + if ((Flags & 1) != 0) + bw.Write(MessageTopColor.Value); + if ((Flags & 1) != 0) + bw.Write(MessageBottomColor.Value); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Wallpaper, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTopPeer.cs b/src/TgSharp.TL/TL/TLTopPeer.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLTopPeer.cs rename to src/TgSharp.TL/TL/TLTopPeer.cs index 485e397..d325daa 100644 --- a/src/TeleSharp.TL/TL/TLTopPeer.cs +++ b/src/TgSharp.TL/TL/TLTopPeer.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-305282981)] public class TLTopPeer : TLObject @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsPeer Peer { get; set; } public double Rating { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); Rating = br.ReadDouble(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); bw.Write(Rating); - } } } diff --git a/src/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryBotsInline.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs rename to src/TgSharp.TL/TL/TLTopPeerCategoryBotsInline.cs index 8d41db6..aba5d27 100644 --- a/src/TeleSharp.TL/TL/TLTopPeerCategoryBotsInline.cs +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryBotsInline.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(344356834)] public class TLTopPeerCategoryBotsInline : TLAbsTopPeerCategory @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryBotsPM.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs rename to src/TgSharp.TL/TL/TLTopPeerCategoryBotsPM.cs index efdc6b1..d998929 100644 --- a/src/TeleSharp.TL/TL/TLTopPeerCategoryBotsPM.cs +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryBotsPM.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1419371685)] public class TLTopPeerCategoryBotsPM : TLAbsTopPeerCategory @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryChannels.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs rename to src/TgSharp.TL/TL/TLTopPeerCategoryChannels.cs index 570af94..d0bb1d2 100644 --- a/src/TeleSharp.TL/TL/TLTopPeerCategoryChannels.cs +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryChannels.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(371037736)] public class TLTopPeerCategoryChannels : TLAbsTopPeerCategory @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs rename to src/TgSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs index 8e8a829..2d35890 100644 --- a/src/TeleSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryCorrespondents.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(104314861)] public class TLTopPeerCategoryCorrespondents : TLAbsTopPeerCategory @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLTopPeerCategoryForwardChats.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryForwardChats.cs new file mode 100644 index 0000000..6524019 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryForwardChats.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-68239120)] + public class TLTopPeerCategoryForwardChats : TLAbsTopPeerCategory + { + public override int Constructor + { + get + { + return -68239120; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLTopPeerCategoryForwardUsers.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryForwardUsers.cs new file mode 100644 index 0000000..2773009 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryForwardUsers.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1472172887)] + public class TLTopPeerCategoryForwardUsers : TLAbsTopPeerCategory + { + public override int Constructor + { + get + { + return -1472172887; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryGroups.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs rename to src/TgSharp.TL/TL/TLTopPeerCategoryGroups.cs index c283b15..6fc96f8 100644 --- a/src/TeleSharp.TL/TL/TLTopPeerCategoryGroups.cs +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryGroups.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1122524854)] public class TLTopPeerCategoryGroups : TLAbsTopPeerCategory @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryPeers.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs rename to src/TgSharp.TL/TL/TLTopPeerCategoryPeers.cs index d541479..f7c997f 100644 --- a/src/TeleSharp.TL/TL/TLTopPeerCategoryPeers.cs +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryPeers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-75283823)] public class TLTopPeerCategoryPeers : TLObject @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Count { get; set; } public TLVector Peers { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Category = (TLAbsTopPeerCategory)ObjectUtils.DeserializeObject(br); Count = br.ReadInt32(); Peers = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Category, bw); bw.Write(Count); ObjectUtils.SerializeObject(Peers, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLTopPeerCategoryPhoneCalls.cs b/src/TgSharp.TL/TL/TLTopPeerCategoryPhoneCalls.cs new file mode 100644 index 0000000..2b493b9 --- /dev/null +++ b/src/TgSharp.TL/TL/TLTopPeerCategoryPhoneCalls.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(511092620)] + public class TLTopPeerCategoryPhoneCalls : TLAbsTopPeerCategory + { + public override int Constructor + { + get + { + return 511092620; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLTrue.cs b/src/TgSharp.TL/TL/TLTrue.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLTrue.cs rename to src/TgSharp.TL/TL/TLTrue.cs index 7a08914..f455ad6 100644 --- a/src/TeleSharp.TL/TL/TLTrue.cs +++ b/src/TgSharp.TL/TL/TLTrue.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1072550713)] public class TLTrue : TLObject @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs b/src/TgSharp.TL/TL/TLUpdateBotCallbackQuery.cs similarity index 89% rename from src/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs rename to src/TgSharp.TL/TL/TLUpdateBotCallbackQuery.cs index a5b84ae..fc5af84 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotCallbackQuery.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotCallbackQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-415938591)] public class TLUpdateBotCallbackQuery : TLAbsUpdate @@ -27,13 +29,9 @@ namespace TeleSharp.TL public byte[] Data { get; set; } public string GameShortName { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Data != null ? (Flags | 1) : (Flags & ~1); - Flags = GameShortName != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -54,13 +52,11 @@ namespace TeleSharp.TL else GameShortName = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(QueryId); bw.Write(UserId); @@ -71,7 +67,6 @@ namespace TeleSharp.TL BytesUtil.Serialize(Data, bw); if ((Flags & 2) != 0) StringUtil.Serialize(GameShortName, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs b/src/TgSharp.TL/TL/TLUpdateBotInlineQuery.cs similarity index 90% rename from src/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs rename to src/TgSharp.TL/TL/TLUpdateBotInlineQuery.cs index 24fbfa2..bab6029 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotInlineQuery.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotInlineQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1417832080)] public class TLUpdateBotInlineQuery : TLAbsUpdate @@ -25,12 +27,9 @@ namespace TeleSharp.TL public TLAbsGeoPoint Geo { get; set; } public string Offset { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Geo != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -45,13 +44,11 @@ namespace TeleSharp.TL Geo = null; Offset = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(QueryId); bw.Write(UserId); @@ -59,7 +56,6 @@ namespace TeleSharp.TL if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Geo, bw); StringUtil.Serialize(Offset, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs b/src/TgSharp.TL/TL/TLUpdateBotInlineSend.cs similarity index 88% rename from src/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs rename to src/TgSharp.TL/TL/TLUpdateBotInlineSend.cs index ab22b9b..9943a67 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotInlineSend.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotInlineSend.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(239663460)] public class TLUpdateBotInlineSend : TLAbsUpdate @@ -25,13 +27,9 @@ namespace TeleSharp.TL public string Id { get; set; } public TLInputBotInlineMessageID MsgId { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Geo != null ? (Flags | 1) : (Flags & ~1); - Flags = MsgId != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -50,13 +48,11 @@ namespace TeleSharp.TL else MsgId = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(UserId); StringUtil.Serialize(Query, bw); @@ -65,7 +61,6 @@ namespace TeleSharp.TL StringUtil.Serialize(Id, bw); if ((Flags & 2) != 0) ObjectUtils.SerializeObject(MsgId, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotPrecheckoutQuery.cs b/src/TgSharp.TL/TL/TLUpdateBotPrecheckoutQuery.cs similarity index 89% rename from src/TeleSharp.TL/TL/TLUpdateBotPrecheckoutQuery.cs rename to src/TgSharp.TL/TL/TLUpdateBotPrecheckoutQuery.cs index 4db1daf..12257e2 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotPrecheckoutQuery.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotPrecheckoutQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1563376297)] public class TLUpdateBotPrecheckoutQuery : TLAbsUpdate @@ -27,13 +29,9 @@ namespace TeleSharp.TL public string Currency { get; set; } public long TotalAmount { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Info != null ? (Flags | 1) : (Flags & ~1); - Flags = ShippingOptionId != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -54,13 +52,11 @@ namespace TeleSharp.TL Currency = StringUtil.Deserialize(br); TotalAmount = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(QueryId); bw.Write(UserId); @@ -71,7 +67,6 @@ namespace TeleSharp.TL StringUtil.Serialize(ShippingOptionId, bw); StringUtil.Serialize(Currency, bw); bw.Write(TotalAmount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotShippingQuery.cs b/src/TgSharp.TL/TL/TLUpdateBotShippingQuery.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateBotShippingQuery.cs rename to src/TgSharp.TL/TL/TLUpdateBotShippingQuery.cs index 45a2cd4..7155101 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotShippingQuery.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotShippingQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-523384512)] public class TLUpdateBotShippingQuery : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public byte[] Payload { get; set; } public TLPostAddress ShippingAddress { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL UserId = br.ReadInt32(); Payload = BytesUtil.Deserialize(br); ShippingAddress = (TLPostAddress)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(UserId); BytesUtil.Serialize(Payload, bw); ObjectUtils.SerializeObject(ShippingAddress, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotWebhookJSON.cs b/src/TgSharp.TL/TL/TLUpdateBotWebhookJSON.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateBotWebhookJSON.cs rename to src/TgSharp.TL/TL/TLUpdateBotWebhookJSON.cs index 6eeb664..43d3b4c 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotWebhookJSON.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotWebhookJSON.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2095595325)] public class TLUpdateBotWebhookJSON : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLDataJSON Data { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Data = (TLDataJSON)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Data, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateBotWebhookJSONQuery.cs b/src/TgSharp.TL/TL/TLUpdateBotWebhookJSONQuery.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateBotWebhookJSONQuery.cs rename to src/TgSharp.TL/TL/TLUpdateBotWebhookJSONQuery.cs index 8d0c7d8..ac4d2e9 100644 --- a/src/TeleSharp.TL/TL/TLUpdateBotWebhookJSONQuery.cs +++ b/src/TgSharp.TL/TL/TLUpdateBotWebhookJSONQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1684914010)] public class TLUpdateBotWebhookJSONQuery : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public TLDataJSON Data { get; set; } public int Timeout { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL QueryId = br.ReadInt64(); Data = (TLDataJSON)ObjectUtils.DeserializeObject(br); Timeout = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(QueryId); ObjectUtils.SerializeObject(Data, bw); bw.Write(Timeout); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChannel.cs b/src/TgSharp.TL/TL/TLUpdateChannel.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLUpdateChannel.cs rename to src/TgSharp.TL/TL/TLUpdateChannel.cs index f50b00f..4ce3175 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChannel.cs +++ b/src/TgSharp.TL/TL/TLUpdateChannel.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1227598250)] public class TLUpdateChannel : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int ChannelId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChannelId); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs b/src/TgSharp.TL/TL/TLUpdateChannelAvailableMessages.cs similarity index 66% rename from src/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs rename to src/TgSharp.TL/TL/TLUpdateChannelAvailableMessages.cs index bc0e875..08b8ae7 100644 --- a/src/TeleSharp.TL/TL/TLUpdateReadChannelInbox.cs +++ b/src/TgSharp.TL/TL/TLUpdateChannelAvailableMessages.cs @@ -4,42 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1108669311)] - public class TLUpdateReadChannelInbox : TLAbsUpdate + [TLObject(1893427255)] + public class TLUpdateChannelAvailableMessages : TLAbsUpdate { public override int Constructor { get { - return 1108669311; + return 1893427255; } } public int ChannelId { get; set; } - public int MaxId { get; set; } - + public int AvailableMinId { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); - MaxId = br.ReadInt32(); - + AvailableMinId = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChannelId); - bw.Write(MaxId); - + bw.Write(AvailableMinId); } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs b/src/TgSharp.TL/TL/TLUpdateChannelMessageViews.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs rename to src/TgSharp.TL/TL/TLUpdateChannelMessageViews.cs index 8950aec..0ffdc5b 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChannelMessageViews.cs +++ b/src/TgSharp.TL/TL/TLUpdateChannelMessageViews.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1734268085)] public class TLUpdateChannelMessageViews : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Id { get; set; } public int Views { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL ChannelId = br.ReadInt32(); Id = br.ReadInt32(); Views = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(ChannelId); bw.Write(Id); bw.Write(Views); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs b/src/TgSharp.TL/TL/TLUpdateChannelPinnedMessage.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs rename to src/TgSharp.TL/TL/TLUpdateChannelPinnedMessage.cs index dd10790..8a74a20 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChannelPinnedMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateChannelPinnedMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1738988427)] public class TLUpdateChannelPinnedMessage : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int ChannelId { get; set; } public int Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(ChannelId); bw.Write(Id); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateChannelReadMessagesContents.cs b/src/TgSharp.TL/TL/TLUpdateChannelReadMessagesContents.cs new file mode 100644 index 0000000..14016e1 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateChannelReadMessagesContents.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1987495099)] + public class TLUpdateChannelReadMessagesContents : TLAbsUpdate + { + public override int Constructor + { + get + { + return -1987495099; + } + } + + public int ChannelId { get; set; } + public TLVector Messages { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + ChannelId = br.ReadInt32(); + Messages = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(ChannelId); + ObjectUtils.SerializeObject(Messages, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs b/src/TgSharp.TL/TL/TLUpdateChannelTooLong.cs similarity index 87% rename from src/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs rename to src/TgSharp.TL/TL/TLUpdateChannelTooLong.cs index e8c2b4d..c6832ea 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChannelTooLong.cs +++ b/src/TgSharp.TL/TL/TLUpdateChannelTooLong.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-352032773)] public class TLUpdateChannelTooLong : TLAbsUpdate @@ -22,12 +24,9 @@ namespace TeleSharp.TL public int ChannelId { get; set; } public int? Pts { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Pts != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,18 +38,15 @@ namespace TeleSharp.TL else Pts = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(ChannelId); if ((Flags & 1) != 0) bw.Write(Pts.Value); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChannelWebPage.cs b/src/TgSharp.TL/TL/TLUpdateChannelWebPage.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateChannelWebPage.cs rename to src/TgSharp.TL/TL/TLUpdateChannelWebPage.cs index 25df18d..ef8fdbd 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChannelWebPage.cs +++ b/src/TgSharp.TL/TL/TLUpdateChannelWebPage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1081547008)] public class TLUpdateChannelWebPage : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Webpage = (TLAbsWebPage)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Webpage, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateChatDefaultBannedRights.cs b/src/TgSharp.TL/TL/TLUpdateChatDefaultBannedRights.cs new file mode 100644 index 0000000..372ea15 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateChatDefaultBannedRights.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1421875280)] + public class TLUpdateChatDefaultBannedRights : TLAbsUpdate + { + public override int Constructor + { + get + { + return 1421875280; + } + } + + public TLAbsPeer Peer { get; set; } + public TLChatBannedRights DefaultBannedRights { get; set; } + public int Version { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + DefaultBannedRights = (TLChatBannedRights)ObjectUtils.DeserializeObject(br); + Version = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(DefaultBannedRights, bw); + bw.Write(Version); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs b/src/TgSharp.TL/TL/TLUpdateChatParticipantAdd.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs rename to src/TgSharp.TL/TL/TLUpdateChatParticipantAdd.cs index 6b3a488..7203a2e 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChatParticipantAdd.cs +++ b/src/TgSharp.TL/TL/TLUpdateChatParticipantAdd.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-364179876)] public class TLUpdateChatParticipantAdd : TLAbsUpdate @@ -24,10 +26,9 @@ namespace TeleSharp.TL public int Date { get; set; } public int Version { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL InviterId = br.ReadInt32(); Date = br.ReadInt32(); Version = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL bw.Write(InviterId); bw.Write(Date); bw.Write(Version); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs b/src/TgSharp.TL/TL/TLUpdateChatParticipantAdmin.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs rename to src/TgSharp.TL/TL/TLUpdateChatParticipantAdmin.cs index a212afb..be367de 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChatParticipantAdmin.cs +++ b/src/TgSharp.TL/TL/TLUpdateChatParticipantAdmin.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1232070311)] public class TLUpdateChatParticipantAdmin : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public bool IsAdmin { get; set; } public int Version { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL UserId = br.ReadInt32(); IsAdmin = BoolUtil.Deserialize(br); Version = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(UserId); BoolUtil.Serialize(IsAdmin, bw); bw.Write(Version); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs b/src/TgSharp.TL/TL/TLUpdateChatParticipantDelete.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs rename to src/TgSharp.TL/TL/TLUpdateChatParticipantDelete.cs index e2bbe3d..32b3410 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChatParticipantDelete.cs +++ b/src/TgSharp.TL/TL/TLUpdateChatParticipantDelete.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1851755554)] public class TLUpdateChatParticipantDelete : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int UserId { get; set; } public int Version { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL ChatId = br.ReadInt32(); UserId = br.ReadInt32(); Version = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(ChatId); bw.Write(UserId); bw.Write(Version); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChatParticipants.cs b/src/TgSharp.TL/TL/TLUpdateChatParticipants.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateChatParticipants.cs rename to src/TgSharp.TL/TL/TLUpdateChatParticipants.cs index 3b596b9..918995a 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChatParticipants.cs +++ b/src/TgSharp.TL/TL/TLUpdateChatParticipants.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(125178264)] public class TLUpdateChatParticipants : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsChatParticipants Participants { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Participants = (TLAbsChatParticipants)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Participants, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChatAdmins.cs b/src/TgSharp.TL/TL/TLUpdateChatPinnedMessage.cs similarity index 71% rename from src/TeleSharp.TL/TL/TLUpdateChatAdmins.cs rename to src/TgSharp.TL/TL/TLUpdateChatPinnedMessage.cs index 8632d9c..ae6a9b6 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChatAdmins.cs +++ b/src/TgSharp.TL/TL/TLUpdateChatPinnedMessage.cs @@ -4,45 +4,44 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1855224129)] - public class TLUpdateChatAdmins : TLAbsUpdate + [TLObject(-519195831)] + public class TLUpdateChatPinnedMessage : TLAbsUpdate { public override int Constructor { get { - return 1855224129; + return -519195831; } } public int ChatId { get; set; } - public bool Enabled { get; set; } + public int Id { get; set; } public int Version { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - Enabled = BoolUtil.Deserialize(br); + Id = br.ReadInt32(); Version = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - BoolUtil.Serialize(Enabled, bw); + bw.Write(Id); bw.Write(Version); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs b/src/TgSharp.TL/TL/TLUpdateChatUserTyping.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs rename to src/TgSharp.TL/TL/TLUpdateChatUserTyping.cs index ec8a008..e9d2d00 100644 --- a/src/TeleSharp.TL/TL/TLUpdateChatUserTyping.cs +++ b/src/TgSharp.TL/TL/TLUpdateChatUserTyping.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1704596961)] public class TLUpdateChatUserTyping : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int UserId { get; set; } public TLAbsSendMessageAction Action { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL ChatId = br.ReadInt32(); UserId = br.ReadInt32(); Action = (TLAbsSendMessageAction)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(ChatId); bw.Write(UserId); ObjectUtils.SerializeObject(Action, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateConfig.cs b/src/TgSharp.TL/TL/TLUpdateConfig.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUpdateConfig.cs rename to src/TgSharp.TL/TL/TLUpdateConfig.cs index 6f90595..d929c2e 100644 --- a/src/TeleSharp.TL/TL/TLUpdateConfig.cs +++ b/src/TgSharp.TL/TL/TLUpdateConfig.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1574314746)] public class TLUpdateConfig : TLAbsUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLUpdateContactsReset.cs b/src/TgSharp.TL/TL/TLUpdateContactsReset.cs new file mode 100644 index 0000000..b2f81b0 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateContactsReset.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1887741886)] + public class TLUpdateContactsReset : TLAbsUpdate + { + public override int Constructor + { + get + { + return 1887741886; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateDcOptions.cs b/src/TgSharp.TL/TL/TLUpdateDcOptions.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateDcOptions.cs rename to src/TgSharp.TL/TL/TLUpdateDcOptions.cs index 14741d8..620ccb3 100644 --- a/src/TeleSharp.TL/TL/TLUpdateDcOptions.cs +++ b/src/TgSharp.TL/TL/TLUpdateDcOptions.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1906403213)] public class TLUpdateDcOptions : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLVector DcOptions { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { DcOptions = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(DcOptions, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs b/src/TgSharp.TL/TL/TLUpdateDeleteChannelMessages.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs rename to src/TgSharp.TL/TL/TLUpdateDeleteChannelMessages.cs index a1d479e..9770d28 100644 --- a/src/TeleSharp.TL/TL/TLUpdateDeleteChannelMessages.cs +++ b/src/TgSharp.TL/TL/TLUpdateDeleteChannelMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1015733815)] public class TLUpdateDeleteChannelMessages : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Messages = (TLVector)ObjectUtils.DeserializeVector(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Messages, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs b/src/TgSharp.TL/TL/TLUpdateDeleteMessages.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs rename to src/TgSharp.TL/TL/TLUpdateDeleteMessages.cs index 45efb9d..52f355f 100644 --- a/src/TeleSharp.TL/TL/TLUpdateDeleteMessages.cs +++ b/src/TgSharp.TL/TL/TLUpdateDeleteMessages.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1576161051)] public class TLUpdateDeleteMessages : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Messages = (TLVector)ObjectUtils.DeserializeVector(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Messages, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateDeleteScheduledMessages.cs b/src/TgSharp.TL/TL/TLUpdateDeleteScheduledMessages.cs new file mode 100644 index 0000000..e8739fa --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateDeleteScheduledMessages.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1870238482)] + public class TLUpdateDeleteScheduledMessages : TLAbsUpdate + { + public override int Constructor + { + get + { + return -1870238482; + } + } + + public TLAbsPeer Peer { get; set; } + public TLVector Messages { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + Messages = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Messages, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateDialogPinned.cs b/src/TgSharp.TL/TL/TLUpdateDialogPinned.cs similarity index 61% rename from src/TeleSharp.TL/TL/TLUpdateDialogPinned.cs rename to src/TgSharp.TL/TL/TLUpdateDialogPinned.cs index e32d0c6..0778e11 100644 --- a/src/TeleSharp.TL/TL/TLUpdateDialogPinned.cs +++ b/src/TgSharp.TL/TL/TLUpdateDialogPinned.cs @@ -4,48 +4,51 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-686710068)] + [TLObject(1852826908)] public class TLUpdateDialogPinned : TLAbsUpdate { public override int Constructor { get { - return -686710068; + return 1852826908; } } public int Flags { get; set; } public bool Pinned { get; set; } - public TLAbsPeer Peer { get; set; } - + public int? FolderId { get; set; } + public TLAbsDialogPeer Peer { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Pinned ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); Pinned = (Flags & 1) != 0; - Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + if ((Flags & 2) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + Peer = (TLAbsDialogPeer)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - + if ((Flags & 2) != 0) + bw.Write(FolderId.Value); ObjectUtils.SerializeObject(Peer, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateDialogUnreadMark.cs b/src/TgSharp.TL/TL/TLUpdateDialogUnreadMark.cs new file mode 100644 index 0000000..f70bbaf --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateDialogUnreadMark.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-513517117)] + public class TLUpdateDialogUnreadMark : TLAbsUpdate + { + public override int Constructor + { + get + { + return -513517117; + } + } + + public int Flags { get; set; } + public bool Unread { get; set; } + public TLAbsDialogPeer Peer { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Unread = (Flags & 1) != 0; + Peer = (TLAbsDialogPeer)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Peer, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateDraftMessage.cs b/src/TgSharp.TL/TL/TLUpdateDraftMessage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateDraftMessage.cs rename to src/TgSharp.TL/TL/TLUpdateDraftMessage.cs index ab4b4fb..cf461a4 100644 --- a/src/TeleSharp.TL/TL/TLUpdateDraftMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateDraftMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-299124375)] public class TLUpdateDraftMessage : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsPeer Peer { get; set; } public TLAbsDraftMessage Draft { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); Draft = (TLAbsDraftMessage)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(Draft, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs b/src/TgSharp.TL/TL/TLUpdateEditChannelMessage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs rename to src/TgSharp.TL/TL/TLUpdateEditChannelMessage.cs index edebaae..66dde83 100644 --- a/src/TeleSharp.TL/TL/TLUpdateEditChannelMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateEditChannelMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(457133559)] public class TLUpdateEditChannelMessage : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Message, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateEditMessage.cs b/src/TgSharp.TL/TL/TLUpdateEditMessage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateEditMessage.cs rename to src/TgSharp.TL/TL/TLUpdateEditMessage.cs index 76b342d..8ae35cd 100644 --- a/src/TeleSharp.TL/TL/TLUpdateEditMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateEditMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-469536605)] public class TLUpdateEditMessage : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Message, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs b/src/TgSharp.TL/TL/TLUpdateEncryptedChatTyping.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs rename to src/TgSharp.TL/TL/TLUpdateEncryptedChatTyping.cs index 60789b9..8e0ae80 100644 --- a/src/TeleSharp.TL/TL/TLUpdateEncryptedChatTyping.cs +++ b/src/TgSharp.TL/TL/TLUpdateEncryptedChatTyping.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(386986326)] public class TLUpdateEncryptedChatTyping : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int ChatId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChatId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(ChatId); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs b/src/TgSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs rename to src/TgSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs index e37b75c..81ca57e 100644 --- a/src/TeleSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs +++ b/src/TgSharp.TL/TL/TLUpdateEncryptedMessagesRead.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(956179895)] public class TLUpdateEncryptedMessagesRead : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int MaxDate { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL ChatId = br.ReadInt32(); MaxDate = br.ReadInt32(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL bw.Write(ChatId); bw.Write(MaxDate); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateEncryption.cs b/src/TgSharp.TL/TL/TLUpdateEncryption.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateEncryption.cs rename to src/TgSharp.TL/TL/TLUpdateEncryption.cs index b41d6cd..99cfa77 100644 --- a/src/TeleSharp.TL/TL/TLUpdateEncryption.cs +++ b/src/TgSharp.TL/TL/TLUpdateEncryption.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1264392051)] public class TLUpdateEncryption : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsEncryptedChat Chat { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Chat = (TLAbsEncryptedChat)ObjectUtils.DeserializeObject(br); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Chat, bw); bw.Write(Date); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateFavedStickers.cs b/src/TgSharp.TL/TL/TLUpdateFavedStickers.cs new file mode 100644 index 0000000..21afd84 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateFavedStickers.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-451831443)] + public class TLUpdateFavedStickers : TLAbsUpdate + { + public override int Constructor + { + get + { + return -451831443; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLUpdateFolderPeers.cs b/src/TgSharp.TL/TL/TLUpdateFolderPeers.cs new file mode 100644 index 0000000..d418ba4 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateFolderPeers.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(422972864)] + public class TLUpdateFolderPeers : TLAbsUpdate + { + public override int Constructor + { + get + { + return 422972864; + } + } + + public TLVector FolderPeers { get; set; } + public int Pts { get; set; } + public int PtsCount { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + FolderPeers = (TLVector)ObjectUtils.DeserializeVector(br); + Pts = br.ReadInt32(); + PtsCount = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(FolderPeers, bw); + bw.Write(Pts); + bw.Write(PtsCount); + } + } +} diff --git a/src/TgSharp.TL/TL/TLUpdateGeoLiveViewed.cs b/src/TgSharp.TL/TL/TLUpdateGeoLiveViewed.cs new file mode 100644 index 0000000..a36ba05 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateGeoLiveViewed.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2027964103)] + public class TLUpdateGeoLiveViewed : TLAbsUpdate + { + public override int Constructor + { + get + { + return -2027964103; + } + } + + public TLAbsPeer Peer { get; set; } + public int MsgId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + MsgId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + bw.Write(MsgId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs b/src/TgSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs similarity index 88% rename from src/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs rename to src/TgSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs index 24d36be..532b3d6 100644 --- a/src/TeleSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs +++ b/src/TgSharp.TL/TL/TLUpdateInlineBotCallbackQuery.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-103646630)] public class TLUpdateInlineBotCallbackQuery : TLAbsUpdate @@ -26,13 +28,9 @@ namespace TeleSharp.TL public byte[] Data { get; set; } public string GameShortName { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Data != null ? (Flags | 1) : (Flags & ~1); - Flags = GameShortName != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -52,13 +50,11 @@ namespace TeleSharp.TL else GameShortName = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(QueryId); bw.Write(UserId); @@ -68,7 +64,6 @@ namespace TeleSharp.TL BytesUtil.Serialize(Data, bw); if ((Flags & 2) != 0) StringUtil.Serialize(GameShortName, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateLangPack.cs b/src/TgSharp.TL/TL/TLUpdateLangPack.cs new file mode 100644 index 0000000..338ed08 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateLangPack.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1442983757)] + public class TLUpdateLangPack : TLAbsUpdate + { + public override int Constructor + { + get + { + return 1442983757; + } + } + + public TLLangPackDifference Difference { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Difference = (TLLangPackDifference)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Difference, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLUpdateLangPackTooLong.cs b/src/TgSharp.TL/TL/TLUpdateLangPackTooLong.cs new file mode 100644 index 0000000..de97449 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateLangPackTooLong.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1180041828)] + public class TLUpdateLangPackTooLong : TLAbsUpdate + { + public override int Constructor + { + get + { + return 1180041828; + } + } + + public string LangCode { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + LangCode = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(LangCode, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLUpdateLoginToken.cs b/src/TgSharp.TL/TL/TLUpdateLoginToken.cs new file mode 100644 index 0000000..6e89cf3 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateLoginToken.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1448076945)] + public class TLUpdateLoginToken : TLAbsUpdate + { + public override int Constructor + { + get + { + return 1448076945; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateMessageID.cs b/src/TgSharp.TL/TL/TLUpdateMessageID.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateMessageID.cs rename to src/TgSharp.TL/TL/TLUpdateMessageID.cs index 53acc62..77c08af 100644 --- a/src/TeleSharp.TL/TL/TLUpdateMessageID.cs +++ b/src/TgSharp.TL/TL/TLUpdateMessageID.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1318109142)] public class TLUpdateMessageID : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int Id { get; set; } public long RandomId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); RandomId = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(RandomId); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateMessagePoll.cs b/src/TgSharp.TL/TL/TLUpdateMessagePoll.cs new file mode 100644 index 0000000..6d8ca66 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateMessagePoll.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1398708869)] + public class TLUpdateMessagePoll : TLAbsUpdate + { + public override int Constructor + { + get + { + return -1398708869; + } + } + + public int Flags { get; set; } + public long PollId { get; set; } + public TLPoll Poll { get; set; } + public TLPollResults Results { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + PollId = br.ReadInt64(); + if ((Flags & 1) != 0) + Poll = (TLPoll)ObjectUtils.DeserializeObject(br); + else + Poll = null; + + Results = (TLPollResults)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + bw.Write(PollId); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Poll, bw); + ObjectUtils.SerializeObject(Results, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs b/src/TgSharp.TL/TL/TLUpdateNewChannelMessage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs rename to src/TgSharp.TL/TL/TLUpdateNewChannelMessage.cs index 45648e5..24c8e05 100644 --- a/src/TeleSharp.TL/TL/TLUpdateNewChannelMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateNewChannelMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1656358105)] public class TLUpdateNewChannelMessage : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Message, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs b/src/TgSharp.TL/TL/TLUpdateNewEncryptedMessage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs rename to src/TgSharp.TL/TL/TLUpdateNewEncryptedMessage.cs index 9295859..39ee635 100644 --- a/src/TeleSharp.TL/TL/TLUpdateNewEncryptedMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateNewEncryptedMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(314359194)] public class TLUpdateNewEncryptedMessage : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsEncryptedMessage Message { get; set; } public int Qts { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Message = (TLAbsEncryptedMessage)ObjectUtils.DeserializeObject(br); Qts = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Message, bw); bw.Write(Qts); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateNewMessage.cs b/src/TgSharp.TL/TL/TLUpdateNewMessage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateNewMessage.cs rename to src/TgSharp.TL/TL/TLUpdateNewMessage.cs index e844364..93fa147 100644 --- a/src/TeleSharp.TL/TL/TLUpdateNewMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateNewMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(522914557)] public class TLUpdateNewMessage : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Message, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateNewScheduledMessage.cs b/src/TgSharp.TL/TL/TLUpdateNewScheduledMessage.cs new file mode 100644 index 0000000..c46832c --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateNewScheduledMessage.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(967122427)] + public class TLUpdateNewScheduledMessage : TLAbsUpdate + { + public override int Constructor + { + get + { + return 967122427; + } + } + + public TLAbsMessage Message { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Message = (TLAbsMessage)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Message, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs b/src/TgSharp.TL/TL/TLUpdateNewStickerSet.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs rename to src/TgSharp.TL/TL/TLUpdateNewStickerSet.cs index 99d3dcc..e04f231 100644 --- a/src/TeleSharp.TL/TL/TLUpdateNewStickerSet.cs +++ b/src/TgSharp.TL/TL/TLUpdateNewStickerSet.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1753886890)] public class TLUpdateNewStickerSet : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public Messages.TLStickerSet Stickerset { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Stickerset = (Messages.TLStickerSet)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Stickerset, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateNotifySettings.cs b/src/TgSharp.TL/TL/TLUpdateNotifySettings.cs similarity index 80% rename from src/TeleSharp.TL/TL/TLUpdateNotifySettings.cs rename to src/TgSharp.TL/TL/TLUpdateNotifySettings.cs index 7fa5fca..1c216b1 100644 --- a/src/TeleSharp.TL/TL/TLUpdateNotifySettings.cs +++ b/src/TgSharp.TL/TL/TLUpdateNotifySettings.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1094555409)] public class TLUpdateNotifySettings : TLAbsUpdate @@ -19,19 +21,17 @@ namespace TeleSharp.TL } public TLAbsNotifyPeer Peer { get; set; } - public TLAbsPeerNotifySettings NotifySettings { get; set; } - + public TLPeerNotifySettings NotifySettings { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Peer = (TLAbsNotifyPeer)ObjectUtils.DeserializeObject(br); - NotifySettings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); - + NotifySettings = (TLPeerNotifySettings)ObjectUtils.DeserializeObject(br); } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Peer, bw); ObjectUtils.SerializeObject(NotifySettings, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdatePeerLocated.cs b/src/TgSharp.TL/TL/TLUpdatePeerLocated.cs new file mode 100644 index 0000000..7438204 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdatePeerLocated.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1263546448)] + public class TLUpdatePeerLocated : TLAbsUpdate + { + public override int Constructor + { + get + { + return -1263546448; + } + } + + public TLVector Peers { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peers = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peers, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLUpdatePeerSettings.cs b/src/TgSharp.TL/TL/TLUpdatePeerSettings.cs new file mode 100644 index 0000000..63883d9 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdatePeerSettings.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1786671974)] + public class TLUpdatePeerSettings : TLAbsUpdate + { + public override int Constructor + { + get + { + return 1786671974; + } + } + + public TLAbsPeer Peer { get; set; } + public TLPeerSettings Settings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); + Settings = (TLPeerSettings)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Peer, bw); + ObjectUtils.SerializeObject(Settings, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdatePhoneCall.cs b/src/TgSharp.TL/TL/TLUpdatePhoneCall.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdatePhoneCall.cs rename to src/TgSharp.TL/TL/TLUpdatePhoneCall.cs index ddf34dd..bd57381 100644 --- a/src/TeleSharp.TL/TL/TLUpdatePhoneCall.cs +++ b/src/TgSharp.TL/TL/TLUpdatePhoneCall.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1425052898)] public class TLUpdatePhoneCall : TLAbsUpdate @@ -20,23 +22,20 @@ namespace TeleSharp.TL public TLAbsPhoneCall PhoneCall { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { PhoneCall = (TLAbsPhoneCall)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(PhoneCall, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdatePinnedDialogs.cs b/src/TgSharp.TL/TL/TLUpdatePinnedDialogs.cs similarity index 61% rename from src/TeleSharp.TL/TL/TLUpdatePinnedDialogs.cs rename to src/TgSharp.TL/TL/TLUpdatePinnedDialogs.cs index 270db76..84dc6ec 100644 --- a/src/TeleSharp.TL/TL/TLUpdatePinnedDialogs.cs +++ b/src/TgSharp.TL/TL/TLUpdatePinnedDialogs.cs @@ -4,50 +4,54 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-657787251)] + [TLObject(-99664734)] public class TLUpdatePinnedDialogs : TLAbsUpdate { public override int Constructor { get { - return -657787251; + return -99664734; } } public int Flags { get; set; } - public TLVector Order { get; set; } - + public int? FolderId { get; set; } + public TLVector Order { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Order != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) { Flags = br.ReadInt32(); + if ((Flags & 2) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + if ((Flags & 1) != 0) - Order = (TLVector)ObjectUtils.DeserializeVector(br); + Order = (TLVector)ObjectUtils.DeserializeVector(br); else Order = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); + if ((Flags & 2) != 0) + bw.Write(FolderId.Value); if ((Flags & 1) != 0) ObjectUtils.SerializeObject(Order, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdatePrivacy.cs b/src/TgSharp.TL/TL/TLUpdatePrivacy.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdatePrivacy.cs rename to src/TgSharp.TL/TL/TLUpdatePrivacy.cs index b6538df..7ec6c8f 100644 --- a/src/TeleSharp.TL/TL/TLUpdatePrivacy.cs +++ b/src/TgSharp.TL/TL/TLUpdatePrivacy.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-298113238)] public class TLUpdatePrivacy : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsPrivacyKey Key { get; set; } public TLVector Rules { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Key = (TLAbsPrivacyKey)ObjectUtils.DeserializeObject(br); Rules = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Key, bw); ObjectUtils.SerializeObject(Rules, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdatePtsChanged.cs b/src/TgSharp.TL/TL/TLUpdatePtsChanged.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUpdatePtsChanged.cs rename to src/TgSharp.TL/TL/TLUpdatePtsChanged.cs index 13f231d..b843bb0 100644 --- a/src/TeleSharp.TL/TL/TLUpdatePtsChanged.cs +++ b/src/TgSharp.TL/TL/TLUpdatePtsChanged.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(861169551)] public class TLUpdatePtsChanged : TLAbsUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLUpdateReadChannelInbox.cs b/src/TgSharp.TL/TL/TLUpdateReadChannelInbox.cs new file mode 100644 index 0000000..395efcb --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateReadChannelInbox.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(856380452)] + public class TLUpdateReadChannelInbox : TLAbsUpdate + { + public override int Constructor + { + get + { + return 856380452; + } + } + + public int Flags { get; set; } + public int? FolderId { get; set; } + public int ChannelId { get; set; } + public int MaxId { get; set; } + public int StillUnreadCount { get; set; } + public int Pts { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + + ChannelId = br.ReadInt32(); + MaxId = br.ReadInt32(); + StillUnreadCount = br.ReadInt32(); + Pts = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + bw.Write(FolderId.Value); + bw.Write(ChannelId); + bw.Write(MaxId); + bw.Write(StillUnreadCount); + bw.Write(Pts); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs b/src/TgSharp.TL/TL/TLUpdateReadChannelOutbox.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs rename to src/TgSharp.TL/TL/TLUpdateReadChannelOutbox.cs index ed3c059..2cea1ae 100644 --- a/src/TeleSharp.TL/TL/TLUpdateReadChannelOutbox.cs +++ b/src/TgSharp.TL/TL/TLUpdateReadChannelOutbox.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(634833351)] public class TLUpdateReadChannelOutbox : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int ChannelId { get; set; } public int MaxId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { ChannelId = br.ReadInt32(); MaxId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(ChannelId); bw.Write(MaxId); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs b/src/TgSharp.TL/TL/TLUpdateReadFeaturedStickers.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs rename to src/TgSharp.TL/TL/TLUpdateReadFeaturedStickers.cs index fdbec1e..f80582a 100644 --- a/src/TeleSharp.TL/TL/TLUpdateReadFeaturedStickers.cs +++ b/src/TgSharp.TL/TL/TLUpdateReadFeaturedStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1461528386)] public class TLUpdateReadFeaturedStickers : TLAbsUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs b/src/TgSharp.TL/TL/TLUpdateReadHistoryInbox.cs similarity index 62% rename from src/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs rename to src/TgSharp.TL/TL/TLUpdateReadHistoryInbox.cs index 7334caa..c7b7303 100644 --- a/src/TeleSharp.TL/TL/TLUpdateReadHistoryInbox.cs +++ b/src/TgSharp.TL/TL/TLUpdateReadHistoryInbox.cs @@ -4,48 +4,61 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1721631396)] + [TLObject(-1667805217)] public class TLUpdateReadHistoryInbox : TLAbsUpdate { public override int Constructor { get { - return -1721631396; + return -1667805217; } } + public int Flags { get; set; } + public int? FolderId { get; set; } public TLAbsPeer Peer { get; set; } public int MaxId { get; set; } + public int StillUnreadCount { get; set; } public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; + Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br); MaxId = br.ReadInt32(); + StillUnreadCount = br.ReadInt32(); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + bw.Write(FolderId.Value); ObjectUtils.SerializeObject(Peer, bw); bw.Write(MaxId); + bw.Write(StillUnreadCount); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs b/src/TgSharp.TL/TL/TLUpdateReadHistoryOutbox.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs rename to src/TgSharp.TL/TL/TLUpdateReadHistoryOutbox.cs index e279ef0..876f35e 100644 --- a/src/TeleSharp.TL/TL/TLUpdateReadHistoryOutbox.cs +++ b/src/TgSharp.TL/TL/TLUpdateReadHistoryOutbox.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(791617983)] public class TLUpdateReadHistoryOutbox : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL MaxId = br.ReadInt32(); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(MaxId); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs b/src/TgSharp.TL/TL/TLUpdateReadMessagesContents.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs rename to src/TgSharp.TL/TL/TLUpdateReadMessagesContents.cs index f009d6b..6f9408f 100644 --- a/src/TeleSharp.TL/TL/TLUpdateReadMessagesContents.cs +++ b/src/TgSharp.TL/TL/TLUpdateReadMessagesContents.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1757493555)] public class TLUpdateReadMessagesContents : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Messages = (TLVector)ObjectUtils.DeserializeVector(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Messages, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateRecentStickers.cs b/src/TgSharp.TL/TL/TLUpdateRecentStickers.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUpdateRecentStickers.cs rename to src/TgSharp.TL/TL/TLUpdateRecentStickers.cs index d3abb3d..e0b9a9e 100644 --- a/src/TeleSharp.TL/TL/TLUpdateRecentStickers.cs +++ b/src/TgSharp.TL/TL/TLUpdateRecentStickers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1706939360)] public class TLUpdateRecentStickers : TLAbsUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateSavedGifs.cs b/src/TgSharp.TL/TL/TLUpdateSavedGifs.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUpdateSavedGifs.cs rename to src/TgSharp.TL/TL/TLUpdateSavedGifs.cs index a8d322b..ef5d0bd 100644 --- a/src/TeleSharp.TL/TL/TLUpdateSavedGifs.cs +++ b/src/TgSharp.TL/TL/TLUpdateSavedGifs.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1821035490)] public class TLUpdateSavedGifs : TLAbsUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateServiceNotification.cs b/src/TgSharp.TL/TL/TLUpdateServiceNotification.cs similarity index 88% rename from src/TeleSharp.TL/TL/TLUpdateServiceNotification.cs rename to src/TgSharp.TL/TL/TLUpdateServiceNotification.cs index f2a70e8..f15c76e 100644 --- a/src/TeleSharp.TL/TL/TLUpdateServiceNotification.cs +++ b/src/TgSharp.TL/TL/TLUpdateServiceNotification.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-337352679)] public class TLUpdateServiceNotification : TLAbsUpdate @@ -26,13 +28,9 @@ namespace TeleSharp.TL public TLAbsMessageMedia Media { get; set; } public TLVector Entities { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Popup ? (Flags | 1) : (Flags & ~1); - Flags = InboxDate != null ? (Flags | 2) : (Flags & ~2); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -48,22 +46,18 @@ namespace TeleSharp.TL Message = StringUtil.Deserialize(br); Media = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br); Entities = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - if ((Flags & 2) != 0) bw.Write(InboxDate.Value); StringUtil.Serialize(Type, bw); StringUtil.Serialize(Message, bw); ObjectUtils.SerializeObject(Media, bw); ObjectUtils.SerializeObject(Entities, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateShort.cs b/src/TgSharp.TL/TL/TLUpdateShort.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateShort.cs rename to src/TgSharp.TL/TL/TLUpdateShort.cs index 2462ca1..dce3d83 100644 --- a/src/TeleSharp.TL/TL/TLUpdateShort.cs +++ b/src/TgSharp.TL/TL/TLUpdateShort.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2027216577)] public class TLUpdateShort : TLAbsUpdates @@ -21,17 +23,15 @@ namespace TeleSharp.TL public TLAbsUpdate Update { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Update = (TLAbsUpdate)ObjectUtils.DeserializeObject(br); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); ObjectUtils.SerializeObject(Update, bw); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs b/src/TgSharp.TL/TL/TLUpdateShortChatMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs rename to src/TgSharp.TL/TL/TLUpdateShortChatMessage.cs index eed4f17..4f21763 100644 --- a/src/TeleSharp.TL/TL/TLUpdateShortChatMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateShortChatMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(377562760)] public class TLUpdateShortChatMessage : TLAbsUpdates @@ -35,19 +37,9 @@ namespace TeleSharp.TL public int? ReplyToMsgId { 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 = MediaUnread ? (Flags | 32) : (Flags & ~32); - Flags = Silent ? (Flags | 8192) : (Flags & ~8192); - Flags = FwdFrom != null ? (Flags | 4) : (Flags & ~4); - Flags = ViaBotId != null ? (Flags | 2048) : (Flags & ~2048); - Flags = ReplyToMsgId != null ? (Flags | 8) : (Flags & ~8); - Flags = Entities != null ? (Flags | 128) : (Flags & ~128); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -84,18 +76,12 @@ namespace TeleSharp.TL else Entities = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - bw.Write(Id); bw.Write(FromId); bw.Write(ChatId); @@ -111,7 +97,6 @@ namespace TeleSharp.TL bw.Write(ReplyToMsgId.Value); if ((Flags & 128) != 0) ObjectUtils.SerializeObject(Entities, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateShortMessage.cs b/src/TgSharp.TL/TL/TLUpdateShortMessage.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUpdateShortMessage.cs rename to src/TgSharp.TL/TL/TLUpdateShortMessage.cs index 822d255..cf6dd8d 100644 --- a/src/TeleSharp.TL/TL/TLUpdateShortMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateShortMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1857044719)] public class TLUpdateShortMessage : TLAbsUpdates @@ -34,19 +36,9 @@ namespace TeleSharp.TL public int? ReplyToMsgId { 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 = MediaUnread ? (Flags | 32) : (Flags & ~32); - Flags = Silent ? (Flags | 8192) : (Flags & ~8192); - Flags = FwdFrom != null ? (Flags | 4) : (Flags & ~4); - Flags = ViaBotId != null ? (Flags | 2048) : (Flags & ~2048); - Flags = ReplyToMsgId != null ? (Flags | 8) : (Flags & ~8); - Flags = Entities != null ? (Flags | 128) : (Flags & ~128); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -82,18 +74,12 @@ namespace TeleSharp.TL else Entities = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - bw.Write(Id); bw.Write(UserId); StringUtil.Serialize(Message, bw); @@ -108,7 +94,6 @@ namespace TeleSharp.TL bw.Write(ReplyToMsgId.Value); if ((Flags & 128) != 0) ObjectUtils.SerializeObject(Entities, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs b/src/TgSharp.TL/TL/TLUpdateShortSentMessage.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs rename to src/TgSharp.TL/TL/TLUpdateShortSentMessage.cs index 24ddc2a..2e8c2da 100644 --- a/src/TeleSharp.TL/TL/TLUpdateShortSentMessage.cs +++ b/src/TgSharp.TL/TL/TLUpdateShortSentMessage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(301019932)] public class TLUpdateShortSentMessage : TLAbsUpdates @@ -27,14 +29,9 @@ namespace TeleSharp.TL 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -55,15 +52,12 @@ namespace TeleSharp.TL else Entities = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Id); bw.Write(Pts); bw.Write(PtsCount); @@ -72,7 +66,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Media, bw); if ((Flags & 128) != 0) ObjectUtils.SerializeObject(Entities, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateStickerSets.cs b/src/TgSharp.TL/TL/TLUpdateStickerSets.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUpdateStickerSets.cs rename to src/TgSharp.TL/TL/TLUpdateStickerSets.cs index e476fef..cb980e4 100644 --- a/src/TeleSharp.TL/TL/TLUpdateStickerSets.cs +++ b/src/TgSharp.TL/TL/TLUpdateStickerSets.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1135492588)] public class TLUpdateStickerSets : TLAbsUpdate @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs b/src/TgSharp.TL/TL/TLUpdateStickerSetsOrder.cs similarity index 86% rename from src/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs rename to src/TgSharp.TL/TL/TLUpdateStickerSetsOrder.cs index 0f0de13..5444f25 100644 --- a/src/TeleSharp.TL/TL/TLUpdateStickerSetsOrder.cs +++ b/src/TgSharp.TL/TL/TLUpdateStickerSetsOrder.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(196268545)] public class TLUpdateStickerSetsOrder : TLAbsUpdate @@ -22,12 +24,9 @@ namespace TeleSharp.TL public bool Masks { get; set; } public TLVector Order { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Masks ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,17 +34,13 @@ namespace TeleSharp.TL Flags = br.ReadInt32(); Masks = (Flags & 1) != 0; Order = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - ObjectUtils.SerializeObject(Order, bw); - } } } diff --git a/src/TgSharp.TL/TL/TLUpdateTheme.cs b/src/TgSharp.TL/TL/TLUpdateTheme.cs new file mode 100644 index 0000000..29f14eb --- /dev/null +++ b/src/TgSharp.TL/TL/TLUpdateTheme.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-2112423005)] + public class TLUpdateTheme : TLAbsUpdate + { + public override int Constructor + { + get + { + return -2112423005; + } + } + + public TLTheme Theme { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Theme = (TLTheme)ObjectUtils.DeserializeObject(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Theme, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUpdateUserBlocked.cs b/src/TgSharp.TL/TL/TLUpdateUserBlocked.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateUserBlocked.cs rename to src/TgSharp.TL/TL/TLUpdateUserBlocked.cs index 24decab..7ed2ea2 100644 --- a/src/TeleSharp.TL/TL/TLUpdateUserBlocked.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserBlocked.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2131957734)] public class TLUpdateUserBlocked : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public bool Blocked { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Blocked = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); BoolUtil.Serialize(Blocked, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateUserName.cs b/src/TgSharp.TL/TL/TLUpdateUserName.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateUserName.cs rename to src/TgSharp.TL/TL/TLUpdateUserName.cs index c1e2a4e..8a13f91 100644 --- a/src/TeleSharp.TL/TL/TLUpdateUserName.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserName.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1489818765)] public class TLUpdateUserName : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public string LastName { get; set; } public string Username { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL FirstName = StringUtil.Deserialize(br); LastName = StringUtil.Deserialize(br); Username = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL StringUtil.Serialize(FirstName, bw); StringUtil.Serialize(LastName, bw); StringUtil.Serialize(Username, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateUserPhone.cs b/src/TgSharp.TL/TL/TLUpdateUserPhone.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLUpdateUserPhone.cs rename to src/TgSharp.TL/TL/TLUpdateUserPhone.cs index db2613b..33b845b 100644 --- a/src/TeleSharp.TL/TL/TLUpdateUserPhone.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserPhone.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(314130811)] public class TLUpdateUserPhone : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public string Phone { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Phone = StringUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); StringUtil.Serialize(Phone, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateUserPhoto.cs b/src/TgSharp.TL/TL/TLUpdateUserPhoto.cs similarity index 94% rename from src/TeleSharp.TL/TL/TLUpdateUserPhoto.cs rename to src/TgSharp.TL/TL/TLUpdateUserPhoto.cs index 97c8c7a..627b723 100644 --- a/src/TeleSharp.TL/TL/TLUpdateUserPhoto.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserPhoto.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-1791935732)] public class TLUpdateUserPhoto : TLAbsUpdate @@ -23,10 +25,9 @@ namespace TeleSharp.TL public TLAbsUserProfilePhoto Photo { get; set; } public bool Previous { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +36,6 @@ namespace TeleSharp.TL Date = br.ReadInt32(); Photo = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); Previous = BoolUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +45,6 @@ namespace TeleSharp.TL bw.Write(Date); ObjectUtils.SerializeObject(Photo, bw); BoolUtil.Serialize(Previous, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLChannelParticipantCreator.cs b/src/TgSharp.TL/TL/TLUpdateUserPinnedMessage.cs similarity index 68% rename from src/TeleSharp.TL/TL/TLChannelParticipantCreator.cs rename to src/TgSharp.TL/TL/TLUpdateUserPinnedMessage.cs index a96c852..015e75d 100644 --- a/src/TeleSharp.TL/TL/TLChannelParticipantCreator.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserPinnedMessage.cs @@ -4,39 +4,41 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-471670279)] - public class TLChannelParticipantCreator : TLAbsChannelParticipant + [TLObject(1279515160)] + public class TLUpdateUserPinnedMessage : TLAbsUpdate { public override int Constructor { get { - return -471670279; + return 1279515160; } } public int UserId { get; set; } - + public int Id { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); - + Id = br.ReadInt32(); } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(UserId); - + bw.Write(Id); } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateUserStatus.cs b/src/TgSharp.TL/TL/TLUpdateUserStatus.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateUserStatus.cs rename to src/TgSharp.TL/TL/TLUpdateUserStatus.cs index 896d131..3fad2d5 100644 --- a/src/TeleSharp.TL/TL/TLUpdateUserStatus.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserStatus.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(469489699)] public class TLUpdateUserStatus : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public TLAbsUserStatus Status { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Status = (TLAbsUserStatus)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); ObjectUtils.SerializeObject(Status, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateUserTyping.cs b/src/TgSharp.TL/TL/TLUpdateUserTyping.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateUserTyping.cs rename to src/TgSharp.TL/TL/TLUpdateUserTyping.cs index 869c942..63611aa 100644 --- a/src/TeleSharp.TL/TL/TLUpdateUserTyping.cs +++ b/src/TgSharp.TL/TL/TLUpdateUserTyping.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1548249383)] public class TLUpdateUserTyping : TLAbsUpdate @@ -21,17 +23,15 @@ namespace TeleSharp.TL public int UserId { get; set; } public TLAbsSendMessageAction Action { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { UserId = br.ReadInt32(); Action = (TLAbsSendMessageAction)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(UserId); ObjectUtils.SerializeObject(Action, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdateWebPage.cs b/src/TgSharp.TL/TL/TLUpdateWebPage.cs similarity index 93% rename from src/TeleSharp.TL/TL/TLUpdateWebPage.cs rename to src/TgSharp.TL/TL/TLUpdateWebPage.cs index 0157cae..fd17171 100644 --- a/src/TeleSharp.TL/TL/TLUpdateWebPage.cs +++ b/src/TgSharp.TL/TL/TLUpdateWebPage.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2139689491)] public class TLUpdateWebPage : TLAbsUpdate @@ -22,10 +24,9 @@ namespace TeleSharp.TL public int Pts { get; set; } public int PtsCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL Webpage = (TLAbsWebPage)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); PtsCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Webpage, bw); bw.Write(Pts); bw.Write(PtsCount); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdates.cs b/src/TgSharp.TL/TL/TLUpdates.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLUpdates.cs rename to src/TgSharp.TL/TL/TLUpdates.cs index 8593de8..f80c529 100644 --- a/src/TeleSharp.TL/TL/TLUpdates.cs +++ b/src/TgSharp.TL/TL/TLUpdates.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1957577280)] public class TLUpdates : TLAbsUpdates @@ -24,10 +26,9 @@ namespace TeleSharp.TL public int Date { get; set; } public int Seq { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL Chats = (TLVector)ObjectUtils.DeserializeVector(br); Date = br.ReadInt32(); Seq = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Chats, bw); bw.Write(Date); bw.Write(Seq); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdatesCombined.cs b/src/TgSharp.TL/TL/TLUpdatesCombined.cs similarity index 95% rename from src/TeleSharp.TL/TL/TLUpdatesCombined.cs rename to src/TgSharp.TL/TL/TLUpdatesCombined.cs index e3ecd78..bfac4b6 100644 --- a/src/TeleSharp.TL/TL/TLUpdatesCombined.cs +++ b/src/TgSharp.TL/TL/TLUpdatesCombined.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1918567619)] public class TLUpdatesCombined : TLAbsUpdates @@ -25,10 +27,9 @@ namespace TeleSharp.TL public int SeqStart { get; set; } public int Seq { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,7 +40,6 @@ namespace TeleSharp.TL Date = br.ReadInt32(); SeqStart = br.ReadInt32(); Seq = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -51,7 +51,6 @@ namespace TeleSharp.TL bw.Write(Date); bw.Write(SeqStart); bw.Write(Seq); - } } } diff --git a/src/TeleSharp.TL/TL/TLUpdatesTooLong.cs b/src/TgSharp.TL/TL/TLUpdatesTooLong.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUpdatesTooLong.cs rename to src/TgSharp.TL/TL/TLUpdatesTooLong.cs index 201a1b5..c98eca5 100644 --- a/src/TeleSharp.TL/TL/TLUpdatesTooLong.cs +++ b/src/TgSharp.TL/TL/TLUpdatesTooLong.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-484987010)] public class TLUpdatesTooLong : TLAbsUpdates @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLUrlAuthResultAccepted.cs b/src/TgSharp.TL/TL/TLUrlAuthResultAccepted.cs new file mode 100644 index 0000000..f294552 --- /dev/null +++ b/src/TgSharp.TL/TL/TLUrlAuthResultAccepted.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1886646706)] + public class TLUrlAuthResultAccepted : TLAbsUrlAuthResult + { + public override int Constructor + { + get + { + return -1886646706; + } + } + + public string Url { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLUrlAuthResultDefault.cs b/src/TgSharp.TL/TL/TLUrlAuthResultDefault.cs new file mode 100644 index 0000000..dfd923d --- /dev/null +++ b/src/TgSharp.TL/TL/TLUrlAuthResultDefault.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1445536993)] + public class TLUrlAuthResultDefault : TLAbsUrlAuthResult + { + public override int Constructor + { + get + { + return -1445536993; + } + } + + // no fields + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + // do nothing + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + // do nothing + } + } +} diff --git a/src/TgSharp.TL/TL/TLUrlAuthResultRequest.cs b/src/TgSharp.TL/TL/TLUrlAuthResultRequest.cs new file mode 100644 index 0000000..fd676fe --- /dev/null +++ b/src/TgSharp.TL/TL/TLUrlAuthResultRequest.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1831650802)] + public class TLUrlAuthResultRequest : TLAbsUrlAuthResult + { + public override int Constructor + { + get + { + return -1831650802; + } + } + + public int Flags { get; set; } + public bool RequestWriteAccess { get; set; } + public TLAbsUser Bot { get; set; } + public string Domain { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + RequestWriteAccess = (Flags & 1) != 0; + Bot = (TLAbsUser)ObjectUtils.DeserializeObject(br); + Domain = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + ObjectUtils.SerializeObject(Bot, bw); + StringUtil.Serialize(Domain, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUser.cs b/src/TgSharp.TL/TL/TLUser.cs similarity index 71% rename from src/TeleSharp.TL/TL/TLUser.cs rename to src/TgSharp.TL/TL/TLUser.cs index 4456102..bf14387 100644 --- a/src/TeleSharp.TL/TL/TLUser.cs +++ b/src/TgSharp.TL/TL/TLUser.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(773059779)] + [TLObject(-1820043071)] public class TLUser : TLAbsUser { public override int Constructor { get { - return 773059779; + return -1820043071; } } @@ -30,6 +32,8 @@ namespace TeleSharp.TL public bool Restricted { get; set; } public bool Min { get; set; } public bool BotInlineGeo { get; set; } + public bool Support { get; set; } + public bool Scam { get; set; } public int Id { get; set; } public long? AccessHash { get; set; } public string FirstName { get; set; } @@ -39,37 +43,13 @@ namespace TeleSharp.TL public TLAbsUserProfilePhoto Photo { get; set; } public TLAbsUserStatus Status { get; set; } public int? BotInfoVersion { get; set; } - public string RestrictionReason { get; set; } + public TLVector RestrictionReason { get; set; } public string BotInlinePlaceholder { get; set; } public string LangCode { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Self ? (Flags | 1024) : (Flags & ~1024); - Flags = Contact ? (Flags | 2048) : (Flags & ~2048); - Flags = MutualContact ? (Flags | 4096) : (Flags & ~4096); - Flags = Deleted ? (Flags | 8192) : (Flags & ~8192); - Flags = Bot ? (Flags | 16384) : (Flags & ~16384); - Flags = BotChatHistory ? (Flags | 32768) : (Flags & ~32768); - Flags = BotNochats ? (Flags | 65536) : (Flags & ~65536); - Flags = Verified ? (Flags | 131072) : (Flags & ~131072); - Flags = Restricted ? (Flags | 262144) : (Flags & ~262144); - Flags = Min ? (Flags | 1048576) : (Flags & ~1048576); - Flags = BotInlineGeo ? (Flags | 2097152) : (Flags & ~2097152); - Flags = AccessHash != null ? (Flags | 1) : (Flags & ~1); - Flags = FirstName != null ? (Flags | 2) : (Flags & ~2); - Flags = LastName != 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 = BotInfoVersion != null ? (Flags | 16384) : (Flags & ~16384); - Flags = RestrictionReason != null ? (Flags | 262144) : (Flags & ~262144); - Flags = BotInlinePlaceholder != null ? (Flags | 524288) : (Flags & ~524288); - Flags = LangCode != null ? (Flags | 4194304) : (Flags & ~4194304); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -86,6 +66,8 @@ namespace TeleSharp.TL Restricted = (Flags & 262144) != 0; Min = (Flags & 1048576) != 0; BotInlineGeo = (Flags & 2097152) != 0; + Support = (Flags & 8388608) != 0; + Scam = (Flags & 16777216) != 0; Id = br.ReadInt32(); if ((Flags & 1) != 0) AccessHash = br.ReadInt64(); @@ -128,7 +110,7 @@ namespace TeleSharp.TL BotInfoVersion = null; if ((Flags & 262144) != 0) - RestrictionReason = StringUtil.Deserialize(br); + RestrictionReason = (TLVector)ObjectUtils.DeserializeVector(br); else RestrictionReason = null; @@ -142,25 +124,12 @@ namespace TeleSharp.TL else LangCode = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - - - - - - - - - bw.Write(Id); if ((Flags & 1) != 0) bw.Write(AccessHash.Value); @@ -179,12 +148,11 @@ namespace TeleSharp.TL if ((Flags & 16384) != 0) bw.Write(BotInfoVersion.Value); if ((Flags & 262144) != 0) - StringUtil.Serialize(RestrictionReason, bw); + ObjectUtils.SerializeObject(RestrictionReason, bw); if ((Flags & 524288) != 0) StringUtil.Serialize(BotInlinePlaceholder, bw); if ((Flags & 4194304) != 0) StringUtil.Serialize(LangCode, bw); - } } } diff --git a/src/TeleSharp.TL/TL/TLUserEmpty.cs b/src/TgSharp.TL/TL/TLUserEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLUserEmpty.cs rename to src/TgSharp.TL/TL/TLUserEmpty.cs index a3b7132..e4a93f4 100644 --- a/src/TeleSharp.TL/TL/TLUserEmpty.cs +++ b/src/TgSharp.TL/TL/TLUserEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(537022650)] public class TLUserEmpty : TLAbsUser @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLUserFull.cs b/src/TgSharp.TL/TL/TLUserFull.cs similarity index 65% rename from src/TeleSharp.TL/TL/TLUserFull.cs rename to src/TgSharp.TL/TL/TLUserFull.cs index 370852f..7eae31c 100644 --- a/src/TeleSharp.TL/TL/TLUserFull.cs +++ b/src/TgSharp.TL/TL/TLUserFull.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(253890367)] + [TLObject(-302941166)] public class TLUserFull : TLObject { public override int Constructor { get { - return 253890367; + return -302941166; } } @@ -22,25 +24,21 @@ namespace TeleSharp.TL public bool Blocked { get; set; } public bool PhoneCallsAvailable { get; set; } public bool PhoneCallsPrivate { get; set; } + public bool CanPinMessage { get; set; } + public bool HasScheduled { get; set; } public TLAbsUser User { get; set; } public string About { get; set; } - public Contacts.TLLink Link { get; set; } + public TLPeerSettings Settings { get; set; } public TLAbsPhoto ProfilePhoto { get; set; } - public TLAbsPeerNotifySettings NotifySettings { get; set; } + public TLPeerNotifySettings NotifySettings { get; set; } public TLBotInfo BotInfo { get; set; } + public int? PinnedMsgId { get; set; } public int CommonChatsCount { get; set; } - + public int? FolderId { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Blocked ? (Flags | 1) : (Flags & ~1); - Flags = PhoneCallsAvailable ? (Flags | 16) : (Flags & ~16); - Flags = PhoneCallsPrivate ? (Flags | 32) : (Flags & ~32); - Flags = About != null ? (Flags | 2) : (Flags & ~2); - Flags = ProfilePhoto != null ? (Flags | 4) : (Flags & ~4); - Flags = BotInfo != null ? (Flags | 8) : (Flags & ~8); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -49,47 +47,57 @@ namespace TeleSharp.TL Blocked = (Flags & 1) != 0; PhoneCallsAvailable = (Flags & 16) != 0; PhoneCallsPrivate = (Flags & 32) != 0; + CanPinMessage = (Flags & 128) != 0; + HasScheduled = (Flags & 4096) != 0; User = (TLAbsUser)ObjectUtils.DeserializeObject(br); if ((Flags & 2) != 0) About = StringUtil.Deserialize(br); else About = null; - Link = (Contacts.TLLink)ObjectUtils.DeserializeObject(br); + Settings = (TLPeerSettings)ObjectUtils.DeserializeObject(br); if ((Flags & 4) != 0) ProfilePhoto = (TLAbsPhoto)ObjectUtils.DeserializeObject(br); else ProfilePhoto = null; - NotifySettings = (TLAbsPeerNotifySettings)ObjectUtils.DeserializeObject(br); + NotifySettings = (TLPeerNotifySettings)ObjectUtils.DeserializeObject(br); if ((Flags & 8) != 0) BotInfo = (TLBotInfo)ObjectUtils.DeserializeObject(br); else BotInfo = null; + if ((Flags & 64) != 0) + PinnedMsgId = br.ReadInt32(); + else + PinnedMsgId = null; + CommonChatsCount = br.ReadInt32(); + if ((Flags & 2048) != 0) + FolderId = br.ReadInt32(); + else + FolderId = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - - ObjectUtils.SerializeObject(User, bw); if ((Flags & 2) != 0) StringUtil.Serialize(About, bw); - ObjectUtils.SerializeObject(Link, bw); + ObjectUtils.SerializeObject(Settings, bw); if ((Flags & 4) != 0) ObjectUtils.SerializeObject(ProfilePhoto, bw); ObjectUtils.SerializeObject(NotifySettings, bw); if ((Flags & 8) != 0) ObjectUtils.SerializeObject(BotInfo, bw); + if ((Flags & 64) != 0) + bw.Write(PinnedMsgId.Value); bw.Write(CommonChatsCount); - + if ((Flags & 2048) != 0) + bw.Write(FolderId.Value); } } } diff --git a/src/TgSharp.TL/TL/TLUserProfilePhoto.cs b/src/TgSharp.TL/TL/TLUserProfilePhoto.cs new file mode 100644 index 0000000..634cb3a --- /dev/null +++ b/src/TgSharp.TL/TL/TLUserProfilePhoto.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-321430132)] + public class TLUserProfilePhoto : TLAbsUserProfilePhoto + { + public override int Constructor + { + get + { + return -321430132; + } + } + + public long PhotoId { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoSmall { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoBig { get; set; } + public int DcId { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + PhotoId = br.ReadInt64(); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoSmall = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoBig = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); + DcId = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(PhotoId); + ObjectUtils.SerializeObject(PhotoSmall, bw); + ObjectUtils.SerializeObject(PhotoBig, bw); + bw.Write(DcId); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs b/src/TgSharp.TL/TL/TLUserProfilePhotoEmpty.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs rename to src/TgSharp.TL/TL/TLUserProfilePhotoEmpty.cs index 0390b73..c383aa1 100644 --- a/src/TeleSharp.TL/TL/TLUserProfilePhotoEmpty.cs +++ b/src/TgSharp.TL/TL/TLUserProfilePhotoEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(1326562017)] public class TLUserProfilePhotoEmpty : TLAbsUserProfilePhoto @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUserStatusEmpty.cs b/src/TgSharp.TL/TL/TLUserStatusEmpty.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUserStatusEmpty.cs rename to src/TgSharp.TL/TL/TLUserStatusEmpty.cs index bad421d..4ad4a49 100644 --- a/src/TeleSharp.TL/TL/TLUserStatusEmpty.cs +++ b/src/TgSharp.TL/TL/TLUserStatusEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(164646985)] public class TLUserStatusEmpty : TLAbsUserStatus @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUserStatusLastMonth.cs b/src/TgSharp.TL/TL/TLUserStatusLastMonth.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUserStatusLastMonth.cs rename to src/TgSharp.TL/TL/TLUserStatusLastMonth.cs index 7739d58..9cab6fd 100644 --- a/src/TeleSharp.TL/TL/TLUserStatusLastMonth.cs +++ b/src/TgSharp.TL/TL/TLUserStatusLastMonth.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(2011940674)] public class TLUserStatusLastMonth : TLAbsUserStatus @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUserStatusLastWeek.cs b/src/TgSharp.TL/TL/TLUserStatusLastWeek.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLUserStatusLastWeek.cs rename to src/TgSharp.TL/TL/TLUserStatusLastWeek.cs index bda3071..d37e916 100644 --- a/src/TeleSharp.TL/TL/TLUserStatusLastWeek.cs +++ b/src/TgSharp.TL/TL/TLUserStatusLastWeek.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(129960444)] public class TLUserStatusLastWeek : TLAbsUserStatus @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLUserStatusOffline.cs b/src/TgSharp.TL/TL/TLUserStatusOffline.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLUserStatusOffline.cs rename to src/TgSharp.TL/TL/TLUserStatusOffline.cs index 7d0a614..26b64b0 100644 --- a/src/TeleSharp.TL/TL/TLUserStatusOffline.cs +++ b/src/TgSharp.TL/TL/TLUserStatusOffline.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(9203775)] public class TLUserStatusOffline : TLAbsUserStatus @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int WasOnline { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { WasOnline = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(WasOnline); - } } } diff --git a/src/TeleSharp.TL/TL/TLUserStatusOnline.cs b/src/TgSharp.TL/TL/TLUserStatusOnline.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLUserStatusOnline.cs rename to src/TgSharp.TL/TL/TLUserStatusOnline.cs index f93bf88..49e65fd 100644 --- a/src/TeleSharp.TL/TL/TLUserStatusOnline.cs +++ b/src/TgSharp.TL/TL/TLUserStatusOnline.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-306628279)] public class TLUserStatusOnline : TLAbsUserStatus @@ -20,23 +22,20 @@ namespace TeleSharp.TL public int Expires { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Expires = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Expires); - } } } diff --git a/src/TeleSharp.TL/TL/TLUserStatusRecently.cs b/src/TgSharp.TL/TL/TLUserStatusRecently.cs similarity index 82% rename from src/TeleSharp.TL/TL/TLUserStatusRecently.cs rename to src/TgSharp.TL/TL/TLUserStatusRecently.cs index 5c17377..0e63ff0 100644 --- a/src/TeleSharp.TL/TL/TLUserStatusRecently.cs +++ b/src/TgSharp.TL/TL/TLUserStatusRecently.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-496024847)] public class TLUserStatusRecently : TLAbsUserStatus @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLChannelRoleEmpty.cs b/src/TgSharp.TL/TL/TLVector.cs similarity index 68% rename from src/TeleSharp.TL/TL/TLChannelRoleEmpty.cs rename to src/TgSharp.TL/TL/TLVector.cs index 5382073..d4562a8 100644 --- a/src/TeleSharp.TL/TL/TLChannelRoleEmpty.cs +++ b/src/TgSharp.TL/TL/TLVector.cs @@ -4,36 +4,38 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-1299865402)] - public class TLChannelRoleEmpty : TLAbsChannelParticipantRole + [TLObject(481674261)] + public class TLVector : TLObject { public override int Constructor { get { - return -1299865402; + return 481674261; } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TgSharp.TL/TL/TLWallPaper.cs b/src/TgSharp.TL/TL/TLWallPaper.cs new file mode 100644 index 0000000..19bc963 --- /dev/null +++ b/src/TgSharp.TL/TL/TLWallPaper.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1539849235)] + public class TLWallPaper : TLAbsWallPaper + { + public override int Constructor + { + get + { + return -1539849235; + } + } + + public long Id { get; set; } + public int Flags { get; set; } + public bool Creator { get; set; } + public bool Default { get; set; } + public bool Pattern { get; set; } + public bool Dark { get; set; } + public long AccessHash { get; set; } + public string Slug { get; set; } + public TLAbsDocument Document { get; set; } + public TLWallPaperSettings Settings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = br.ReadInt64(); + Flags = br.ReadInt32(); + Creator = (Flags & 1) != 0; + Default = (Flags & 2) != 0; + Pattern = (Flags & 8) != 0; + Dark = (Flags & 16) != 0; + AccessHash = br.ReadInt64(); + Slug = StringUtil.Deserialize(br); + Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br); + if ((Flags & 4) != 0) + Settings = (TLWallPaperSettings)ObjectUtils.DeserializeObject(br); + else + Settings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Id); + bw.Write(Flags); + bw.Write(AccessHash); + StringUtil.Serialize(Slug, bw); + ObjectUtils.SerializeObject(Document, bw); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(Settings, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLWallPaperNoFile.cs b/src/TgSharp.TL/TL/TLWallPaperNoFile.cs new file mode 100644 index 0000000..768bb4a --- /dev/null +++ b/src/TgSharp.TL/TL/TLWallPaperNoFile.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-1963717851)] + public class TLWallPaperNoFile : TLAbsWallPaper + { + public override int Constructor + { + get + { + return -1963717851; + } + } + + public int Flags { get; set; } + public bool Default { get; set; } + public bool Dark { get; set; } + public TLWallPaperSettings Settings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Default = (Flags & 2) != 0; + Dark = (Flags & 16) != 0; + if ((Flags & 4) != 0) + Settings = (TLWallPaperSettings)ObjectUtils.DeserializeObject(br); + else + Settings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 4) != 0) + ObjectUtils.SerializeObject(Settings, bw); + } + } +} diff --git a/src/TgSharp.TL/TL/TLWallPaperSettings.cs b/src/TgSharp.TL/TL/TLWallPaperSettings.cs new file mode 100644 index 0000000..c5064ba --- /dev/null +++ b/src/TgSharp.TL/TL/TLWallPaperSettings.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(84438264)] + public class TLWallPaperSettings : TLObject + { + public override int Constructor + { + get + { + return 84438264; + } + } + + public int Flags { get; set; } + public bool Blur { get; set; } + public bool Motion { get; set; } + public int? BackgroundColor { get; set; } + public int? SecondBackgroundColor { get; set; } + public int? Intensity { get; set; } + public int? Rotation { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + Blur = (Flags & 2) != 0; + Motion = (Flags & 4) != 0; + if ((Flags & 1) != 0) + BackgroundColor = br.ReadInt32(); + else + BackgroundColor = null; + + if ((Flags & 16) != 0) + SecondBackgroundColor = br.ReadInt32(); + else + SecondBackgroundColor = null; + + if ((Flags & 8) != 0) + Intensity = br.ReadInt32(); + else + Intensity = null; + + if ((Flags & 16) != 0) + Rotation = br.ReadInt32(); + else + Rotation = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + bw.Write(BackgroundColor.Value); + if ((Flags & 16) != 0) + bw.Write(SecondBackgroundColor.Value); + if ((Flags & 8) != 0) + bw.Write(Intensity.Value); + if ((Flags & 16) != 0) + bw.Write(Rotation.Value); + } + } +} diff --git a/src/TgSharp.TL/TL/TLWebAuthorization.cs b/src/TgSharp.TL/TL/TLWebAuthorization.cs new file mode 100644 index 0000000..c8754e4 --- /dev/null +++ b/src/TgSharp.TL/TL/TLWebAuthorization.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-892779534)] + public class TLWebAuthorization : TLObject + { + public override int Constructor + { + get + { + return -892779534; + } + } + + public long Hash { get; set; } + public int BotId { get; set; } + public string Domain { get; set; } + public string Browser { get; set; } + public string Platform { get; set; } + public int DateCreated { get; set; } + public int DateActive { get; set; } + public string Ip { get; set; } + public string Region { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Hash = br.ReadInt64(); + BotId = br.ReadInt32(); + Domain = StringUtil.Deserialize(br); + Browser = StringUtil.Deserialize(br); + Platform = StringUtil.Deserialize(br); + DateCreated = br.ReadInt32(); + DateActive = br.ReadInt32(); + Ip = StringUtil.Deserialize(br); + Region = StringUtil.Deserialize(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Hash); + bw.Write(BotId); + StringUtil.Serialize(Domain, bw); + StringUtil.Serialize(Browser, bw); + StringUtil.Serialize(Platform, bw); + bw.Write(DateCreated); + bw.Write(DateActive); + StringUtil.Serialize(Ip, bw); + StringUtil.Serialize(Region, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLWebDocument.cs b/src/TgSharp.TL/TL/TLWebDocument.cs similarity index 83% rename from src/TeleSharp.TL/TL/TLWebDocument.cs rename to src/TgSharp.TL/TL/TLWebDocument.cs index 321d0dd..60f1879 100644 --- a/src/TeleSharp.TL/TL/TLWebDocument.cs +++ b/src/TgSharp.TL/TL/TLWebDocument.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(-971322408)] - public class TLWebDocument : TLObject + [TLObject(475467473)] + public class TLWebDocument : TLAbsWebDocument { public override int Constructor { get { - return -971322408; + return 475467473; } } @@ -23,12 +25,10 @@ namespace TeleSharp.TL public int Size { get; set; } public string MimeType { get; set; } public TLVector Attributes { get; set; } - public int DcId { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -38,8 +38,6 @@ namespace TeleSharp.TL Size = br.ReadInt32(); MimeType = StringUtil.Deserialize(br); Attributes = (TLVector)ObjectUtils.DeserializeVector(br); - DcId = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -50,8 +48,6 @@ namespace TeleSharp.TL bw.Write(Size); StringUtil.Serialize(MimeType, bw); ObjectUtils.SerializeObject(Attributes, bw); - bw.Write(DcId); - } } } diff --git a/src/TgSharp.TL/TL/TLWebDocumentNoProxy.cs b/src/TgSharp.TL/TL/TLWebDocumentNoProxy.cs new file mode 100644 index 0000000..7db0b90 --- /dev/null +++ b/src/TgSharp.TL/TL/TLWebDocumentNoProxy.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(-104284986)] + public class TLWebDocumentNoProxy : TLAbsWebDocument + { + public override int Constructor + { + get + { + return -104284986; + } + } + + public string Url { get; set; } + public int Size { get; set; } + public string MimeType { get; set; } + public TLVector Attributes { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Url = StringUtil.Deserialize(br); + Size = br.ReadInt32(); + MimeType = StringUtil.Deserialize(br); + Attributes = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + StringUtil.Serialize(Url, bw); + bw.Write(Size); + StringUtil.Serialize(MimeType, bw); + ObjectUtils.SerializeObject(Attributes, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLWebPage.cs b/src/TgSharp.TL/TL/TLWebPage.cs similarity index 79% rename from src/TeleSharp.TL/TL/TLWebPage.cs rename to src/TgSharp.TL/TL/TLWebPage.cs index b673437..5d5551b 100644 --- a/src/TeleSharp.TL/TL/TLWebPage.cs +++ b/src/TgSharp.TL/TL/TLWebPage.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { - [TLObject(1594340540)] + [TLObject(-392411726)] public class TLWebPage : TLAbsWebPage { public override int Constructor { get { - return 1594340540; + return -392411726; } } @@ -35,26 +37,13 @@ namespace TeleSharp.TL public int? Duration { get; set; } public string Author { get; set; } public TLAbsDocument Document { get; set; } - public TLAbsPage CachedPage { get; set; } - + public TLPage CachedPage { get; set; } + // manual edit: WebPageAttribute->TLWebPageAttributeTheme + public TLVector Attributes { get; set; } public void ComputeFlags() { - Flags = 0; - Flags = Type != null ? (Flags | 1) : (Flags & ~1); - Flags = SiteName != 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 = EmbedUrl != null ? (Flags | 32) : (Flags & ~32); - Flags = EmbedType != null ? (Flags | 32) : (Flags & ~32); - Flags = EmbedWidth != null ? (Flags | 64) : (Flags & ~64); - Flags = EmbedHeight != 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); - Flags = CachedPage != null ? (Flags | 1024) : (Flags & ~1024); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -125,17 +114,21 @@ namespace TeleSharp.TL Document = null; if ((Flags & 1024) != 0) - CachedPage = (TLAbsPage)ObjectUtils.DeserializeObject(br); + CachedPage = (TLPage)ObjectUtils.DeserializeObject(br); else CachedPage = null; + if ((Flags & 4096) != 0) + // manual edit: WebPageAttribute->TLWebPageAttributeTheme + Attributes = (TLVector)ObjectUtils.DeserializeVector (br); + else + Attributes = null; } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(Id); StringUtil.Serialize(Url, bw); @@ -167,7 +160,8 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(Document, bw); if ((Flags & 1024) != 0) ObjectUtils.SerializeObject(CachedPage, bw); - + if ((Flags & 4096) != 0) + ObjectUtils.SerializeObject(Attributes, bw); } } } diff --git a/src/TgSharp.TL/TL/TLWebPageAttributeTheme.cs b/src/TgSharp.TL/TL/TLWebPageAttributeTheme.cs new file mode 100644 index 0000000..566f855 --- /dev/null +++ b/src/TgSharp.TL/TL/TLWebPageAttributeTheme.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL +{ + [TLObject(1421174295)] + public class TLWebPageAttributeTheme : TLObject + { + public override int Constructor + { + get + { + return 1421174295; + } + } + + public int Flags { get; set; } + public TLVector Documents { get; set; } + public TLThemeSettings Settings { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Flags = br.ReadInt32(); + if ((Flags & 1) != 0) + Documents = (TLVector)ObjectUtils.DeserializeVector(br); + else + Documents = null; + + if ((Flags & 2) != 0) + Settings = (TLThemeSettings)ObjectUtils.DeserializeObject(br); + else + Settings = null; + + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + bw.Write(Flags); + if ((Flags & 1) != 0) + ObjectUtils.SerializeObject(Documents, bw); + if ((Flags & 2) != 0) + ObjectUtils.SerializeObject(Settings, bw); + } + } +} diff --git a/src/TeleSharp.TL/TL/TLWebPageEmpty.cs b/src/TgSharp.TL/TL/TLWebPageEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/TLWebPageEmpty.cs rename to src/TgSharp.TL/TL/TLWebPageEmpty.cs index e3cf8a0..b8ad702 100644 --- a/src/TeleSharp.TL/TL/TLWebPageEmpty.cs +++ b/src/TgSharp.TL/TL/TLWebPageEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-350980120)] public class TLWebPageEmpty : TLAbsWebPage @@ -20,23 +22,20 @@ namespace TeleSharp.TL public long Id { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Id); - } } } diff --git a/src/TeleSharp.TL/TL/TLWebPageNotModified.cs b/src/TgSharp.TL/TL/TLWebPageNotModified.cs similarity index 81% rename from src/TeleSharp.TL/TL/TLWebPageNotModified.cs rename to src/TgSharp.TL/TL/TLWebPageNotModified.cs index 724b6b0..2e302c2 100644 --- a/src/TeleSharp.TL/TL/TLWebPageNotModified.cs +++ b/src/TgSharp.TL/TL/TLWebPageNotModified.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-2054908813)] public class TLWebPageNotModified : TLAbsWebPage @@ -18,22 +20,22 @@ namespace TeleSharp.TL } } - + // no fields public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing } } } diff --git a/src/TeleSharp.TL/TL/TLWebPagePending.cs b/src/TgSharp.TL/TL/TLWebPagePending.cs similarity index 92% rename from src/TeleSharp.TL/TL/TLWebPagePending.cs rename to src/TgSharp.TL/TL/TLWebPagePending.cs index b5fb208..e82b378 100644 --- a/src/TeleSharp.TL/TL/TLWebPagePending.cs +++ b/src/TgSharp.TL/TL/TLWebPagePending.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL + +using TgSharp.TL; + +namespace TgSharp.TL { [TLObject(-981018084)] public class TLWebPagePending : TLAbsWebPage @@ -21,17 +23,15 @@ namespace TeleSharp.TL public long Id { get; set; } public int Date { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = br.ReadInt64(); Date = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL bw.Write(Constructor); bw.Write(Id); bw.Write(Date); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs b/src/TgSharp.TL/TL/Updates/TLAbsChannelDifference.cs similarity index 80% rename from src/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs rename to src/TgSharp.TL/TL/Updates/TLAbsChannelDifference.cs index ca3c10a..96533a2 100644 --- a/src/TeleSharp.TL/TL/Updates/TLAbsChannelDifference.cs +++ b/src/TgSharp.TL/TL/Updates/TLAbsChannelDifference.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { public abstract class TLAbsChannelDifference : TLObject { diff --git a/src/TeleSharp.TL/TL/Updates/TLAbsDifference.cs b/src/TgSharp.TL/TL/Updates/TLAbsDifference.cs similarity index 79% rename from src/TeleSharp.TL/TL/Updates/TLAbsDifference.cs rename to src/TgSharp.TL/TL/Updates/TLAbsDifference.cs index 10807ea..ced1e73 100644 --- a/src/TeleSharp.TL/TL/Updates/TLAbsDifference.cs +++ b/src/TgSharp.TL/TL/Updates/TLAbsDifference.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { public abstract class TLAbsDifference : TLObject { diff --git a/src/TeleSharp.TL/TL/Updates/TLChannelDifference.cs b/src/TgSharp.TL/TL/Updates/TLChannelDifference.cs similarity index 89% rename from src/TeleSharp.TL/TL/Updates/TLChannelDifference.cs rename to src/TgSharp.TL/TL/Updates/TLChannelDifference.cs index deb181d..bfa3b4b 100644 --- a/src/TeleSharp.TL/TL/Updates/TLChannelDifference.cs +++ b/src/TgSharp.TL/TL/Updates/TLChannelDifference.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(543450958)] public class TLChannelDifference : TLAbsChannelDifference @@ -27,13 +29,9 @@ namespace TeleSharp.TL.Updates 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -50,15 +48,12 @@ namespace TeleSharp.TL.Updates OtherUpdates = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Pts); if ((Flags & 2) != 0) bw.Write(Timeout.Value); @@ -66,7 +61,6 @@ namespace TeleSharp.TL.Updates ObjectUtils.SerializeObject(OtherUpdates, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs b/src/TgSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs similarity index 83% rename from src/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs rename to src/TgSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs index 9850a3f..63f5857 100644 --- a/src/TeleSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs +++ b/src/TgSharp.TL/TL/Updates/TLChannelDifferenceEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(1041346555)] public class TLChannelDifferenceEmpty : TLAbsChannelDifference @@ -23,13 +25,9 @@ namespace TeleSharp.TL.Updates 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); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,19 +40,15 @@ namespace TeleSharp.TL.Updates else Timeout = null; - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - bw.Write(Pts); if ((Flags & 2) != 0) bw.Write(Timeout.Value); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs b/src/TgSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs similarity index 64% rename from src/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs rename to src/TgSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs index a21b8fb..162b65c 100644 --- a/src/TeleSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs +++ b/src/TgSharp.TL/TL/Updates/TLChannelDifferenceTooLong.cs @@ -4,78 +4,60 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { - [TLObject(1091431943)] + [TLObject(-1531132162)] public class TLChannelDifferenceTooLong : TLAbsChannelDifference { public override int Constructor { get { - return 1091431943; + return -1531132162; } } public int Flags { get; set; } public bool Final { get; set; } - public int Pts { get; set; } public int? Timeout { get; set; } - public int TopMessage { get; set; } - public int ReadInboxMaxId { get; set; } - public int ReadOutboxMaxId { get; set; } - public int UnreadCount { get; set; } + public TLAbsDialog Dialog { 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); - + // do nothing } 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; - TopMessage = br.ReadInt32(); - ReadInboxMaxId = br.ReadInt32(); - ReadOutboxMaxId = br.ReadInt32(); - UnreadCount = br.ReadInt32(); + Dialog = (TLAbsDialog)ObjectUtils.DeserializeObject(br); Messages = (TLVector)ObjectUtils.DeserializeVector(br); Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - - bw.Write(Pts); if ((Flags & 2) != 0) bw.Write(Timeout.Value); - bw.Write(TopMessage); - bw.Write(ReadInboxMaxId); - bw.Write(ReadOutboxMaxId); - bw.Write(UnreadCount); + ObjectUtils.SerializeObject(Dialog, bw); ObjectUtils.SerializeObject(Messages, bw); ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLDifference.cs b/src/TgSharp.TL/TL/Updates/TLDifference.cs similarity index 96% rename from src/TeleSharp.TL/TL/Updates/TLDifference.cs rename to src/TgSharp.TL/TL/Updates/TLDifference.cs index 83ef9dc..c166546 100644 --- a/src/TeleSharp.TL/TL/Updates/TLDifference.cs +++ b/src/TgSharp.TL/TL/Updates/TLDifference.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(16030880)] public class TLDifference : TLAbsDifference @@ -25,10 +27,9 @@ namespace TeleSharp.TL.Updates public TLVector Users { get; set; } public Updates.TLState State { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,7 +40,6 @@ namespace TeleSharp.TL.Updates Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); State = (Updates.TLState)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -51,7 +51,6 @@ namespace TeleSharp.TL.Updates ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); ObjectUtils.SerializeObject(State, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs b/src/TgSharp.TL/TL/Updates/TLDifferenceEmpty.cs similarity index 91% rename from src/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs rename to src/TgSharp.TL/TL/Updates/TLDifferenceEmpty.cs index 250cb09..29d7c11 100644 --- a/src/TeleSharp.TL/TL/Updates/TLDifferenceEmpty.cs +++ b/src/TgSharp.TL/TL/Updates/TLDifferenceEmpty.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(1567990072)] public class TLDifferenceEmpty : TLAbsDifference @@ -21,17 +23,15 @@ namespace TeleSharp.TL.Updates public int Date { get; set; } public int Seq { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Date = br.ReadInt32(); Seq = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -39,7 +39,6 @@ namespace TeleSharp.TL.Updates bw.Write(Constructor); bw.Write(Date); bw.Write(Seq); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs b/src/TgSharp.TL/TL/Updates/TLDifferenceSlice.cs similarity index 96% rename from src/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs rename to src/TgSharp.TL/TL/Updates/TLDifferenceSlice.cs index b3c8f8d..0fbb1c4 100644 --- a/src/TeleSharp.TL/TL/Updates/TLDifferenceSlice.cs +++ b/src/TgSharp.TL/TL/Updates/TLDifferenceSlice.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(-1459938943)] public class TLDifferenceSlice : TLAbsDifference @@ -25,10 +27,9 @@ namespace TeleSharp.TL.Updates public TLVector Users { get; set; } public Updates.TLState IntermediateState { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -39,7 +40,6 @@ namespace TeleSharp.TL.Updates Chats = (TLVector)ObjectUtils.DeserializeVector(br); Users = (TLVector)ObjectUtils.DeserializeVector(br); IntermediateState = (Updates.TLState)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) @@ -51,7 +51,6 @@ namespace TeleSharp.TL.Updates ObjectUtils.SerializeObject(Chats, bw); ObjectUtils.SerializeObject(Users, bw); ObjectUtils.SerializeObject(IntermediateState, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLDifferenceTooLong.cs b/src/TgSharp.TL/TL/Updates/TLDifferenceTooLong.cs similarity index 90% rename from src/TeleSharp.TL/TL/Updates/TLDifferenceTooLong.cs rename to src/TgSharp.TL/TL/Updates/TLDifferenceTooLong.cs index 6a847ad..b94d2ba 100644 --- a/src/TeleSharp.TL/TL/Updates/TLDifferenceTooLong.cs +++ b/src/TgSharp.TL/TL/Updates/TLDifferenceTooLong.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(1258196845)] public class TLDifferenceTooLong : TLAbsDifference @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Updates public int Pts { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Pts = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); bw.Write(Pts); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs b/src/TgSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs similarity index 91% rename from src/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs rename to src/TgSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs index dc212f6..792bdba 100644 --- a/src/TeleSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs +++ b/src/TgSharp.TL/TL/Updates/TLRequestGetChannelDifference.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(51854712)] public class TLRequestGetChannelDifference : TLMethod @@ -26,12 +28,9 @@ namespace TeleSharp.TL.Updates public int Limit { get; set; } public Updates.TLAbsChannelDifference Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = Force ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -42,25 +41,21 @@ namespace TeleSharp.TL.Updates Filter = (TLAbsChannelMessagesFilter)ObjectUtils.DeserializeObject(br); Pts = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); - 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); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs b/src/TgSharp.TL/TL/Updates/TLRequestGetDifference.cs similarity index 89% rename from src/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs rename to src/TgSharp.TL/TL/Updates/TLRequestGetDifference.cs index c02d8f6..ffee860 100644 --- a/src/TeleSharp.TL/TL/Updates/TLRequestGetDifference.cs +++ b/src/TgSharp.TL/TL/Updates/TLRequestGetDifference.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(630429265)] public class TLRequestGetDifference : TLMethod @@ -25,12 +27,9 @@ namespace TeleSharp.TL.Updates public int Qts { get; set; } public Updates.TLAbsDifference Response { get; set; } - public void ComputeFlags() { - Flags = 0; - Flags = PtsTotalLimit != null ? (Flags | 1) : (Flags & ~1); - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -44,25 +43,22 @@ namespace TeleSharp.TL.Updates Date = br.ReadInt32(); Qts = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - ComputeFlags(); bw.Write(Flags); bw.Write(Pts); if ((Flags & 1) != 0) bw.Write(PtsTotalLimit.Value); bw.Write(Date); bw.Write(Qts); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Updates.TLAbsDifference)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLRequestGetState.cs b/src/TgSharp.TL/TL/Updates/TLRequestGetState.cs similarity index 86% rename from src/TeleSharp.TL/TL/Updates/TLRequestGetState.cs rename to src/TgSharp.TL/TL/Updates/TLRequestGetState.cs index 0540cf0..a0e7688 100644 --- a/src/TeleSharp.TL/TL/Updates/TLRequestGetState.cs +++ b/src/TgSharp.TL/TL/Updates/TLRequestGetState.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(-304838614)] public class TLRequestGetState : TLMethod @@ -20,26 +22,25 @@ namespace TeleSharp.TL.Updates public Updates.TLState Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - + // do nothing } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); - + // do nothing else } + public override void DeserializeResponse(BinaryReader br) { Response = (Updates.TLState)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Updates/TLState.cs b/src/TgSharp.TL/TL/Updates/TLState.cs similarity index 93% rename from src/TeleSharp.TL/TL/Updates/TLState.cs rename to src/TgSharp.TL/TL/Updates/TLState.cs index 9ea8657..9fc0b1d 100644 --- a/src/TeleSharp.TL/TL/Updates/TLState.cs +++ b/src/TgSharp.TL/TL/Updates/TLState.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Updates + +using TgSharp.TL; + +namespace TgSharp.TL.Updates { [TLObject(-1519637954)] public class TLState : TLObject @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Updates public int Seq { get; set; } public int UnreadCount { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL.Updates Date = br.ReadInt32(); Seq = br.ReadInt32(); UnreadCount = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL.Updates bw.Write(Date); bw.Write(Seq); bw.Write(UnreadCount); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLAbsCdnFile.cs b/src/TgSharp.TL/TL/Upload/TLAbsCdnFile.cs similarity index 79% rename from src/TeleSharp.TL/TL/Upload/TLAbsCdnFile.cs rename to src/TgSharp.TL/TL/Upload/TLAbsCdnFile.cs index e2ffe61..4a56cf9 100644 --- a/src/TeleSharp.TL/TL/Upload/TLAbsCdnFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLAbsCdnFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { public abstract class TLAbsCdnFile : TLObject { diff --git a/src/TeleSharp.TL/TL/Upload/TLAbsFile.cs b/src/TgSharp.TL/TL/Upload/TLAbsFile.cs similarity index 79% rename from src/TeleSharp.TL/TL/Upload/TLAbsFile.cs rename to src/TgSharp.TL/TL/Upload/TLAbsFile.cs index 14db55f..4ebff66 100644 --- a/src/TeleSharp.TL/TL/Upload/TLAbsFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLAbsFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { public abstract class TLAbsFile : TLObject { diff --git a/src/TeleSharp.TL/TL/Upload/TLCdnFile.cs b/src/TgSharp.TL/TL/Upload/TLCdnFile.cs similarity index 91% rename from src/TeleSharp.TL/TL/Upload/TLCdnFile.cs rename to src/TgSharp.TL/TL/Upload/TLCdnFile.cs index 5d966c9..cb4a05f 100644 --- a/src/TeleSharp.TL/TL/Upload/TLCdnFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLCdnFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(-1449145777)] public class TLCdnFile : TLAbsCdnFile @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Upload public byte[] Bytes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); BytesUtil.Serialize(Bytes, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLCdnFileReuploadNeeded.cs b/src/TgSharp.TL/TL/Upload/TLCdnFileReuploadNeeded.cs similarity index 91% rename from src/TeleSharp.TL/TL/Upload/TLCdnFileReuploadNeeded.cs rename to src/TgSharp.TL/TL/Upload/TLCdnFileReuploadNeeded.cs index f88fbac..c2f249d 100644 --- a/src/TeleSharp.TL/TL/Upload/TLCdnFileReuploadNeeded.cs +++ b/src/TgSharp.TL/TL/Upload/TLCdnFileReuploadNeeded.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(-290921362)] public class TLCdnFileReuploadNeeded : TLAbsCdnFile @@ -20,23 +22,20 @@ namespace TeleSharp.TL.Upload public byte[] RequestToken { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { RequestToken = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); BytesUtil.Serialize(RequestToken, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLFile.cs b/src/TgSharp.TL/TL/Upload/TLFile.cs similarity index 93% rename from src/TeleSharp.TL/TL/Upload/TLFile.cs rename to src/TgSharp.TL/TL/Upload/TLFile.cs index bd8131d..d0a0a71 100644 --- a/src/TeleSharp.TL/TL/Upload/TLFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(157948117)] public class TLFile : TLAbsFile @@ -22,10 +24,9 @@ namespace TeleSharp.TL.Upload public int Mtime { get; set; } public byte[] Bytes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -33,7 +34,6 @@ namespace TeleSharp.TL.Upload Type = (Storage.TLAbsFileType)ObjectUtils.DeserializeObject(br); Mtime = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -42,7 +42,6 @@ namespace TeleSharp.TL.Upload ObjectUtils.SerializeObject(Type, bw); bw.Write(Mtime); BytesUtil.Serialize(Bytes, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLFileCdnRedirect.cs b/src/TgSharp.TL/TL/Upload/TLFileCdnRedirect.cs similarity index 76% rename from src/TeleSharp.TL/TL/Upload/TLFileCdnRedirect.cs rename to src/TgSharp.TL/TL/Upload/TLFileCdnRedirect.cs index 5d492b5..2f0878b 100644 --- a/src/TeleSharp.TL/TL/Upload/TLFileCdnRedirect.cs +++ b/src/TgSharp.TL/TL/Upload/TLFileCdnRedirect.cs @@ -4,17 +4,19 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { - [TLObject(352864346)] + [TLObject(-242427324)] public class TLFileCdnRedirect : TLAbsFile { public override int Constructor { get { - return 352864346; + return -242427324; } } @@ -22,11 +24,11 @@ namespace TeleSharp.TL.Upload public byte[] FileToken { get; set; } public byte[] EncryptionKey { get; set; } public byte[] EncryptionIv { get; set; } - + public TLVector FileHashes { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -35,7 +37,7 @@ namespace TeleSharp.TL.Upload FileToken = BytesUtil.Deserialize(br); EncryptionKey = BytesUtil.Deserialize(br); EncryptionIv = BytesUtil.Deserialize(br); - + FileHashes = (TLVector)ObjectUtils.DeserializeVector(br); } public override void SerializeBody(BinaryWriter bw) @@ -45,7 +47,7 @@ namespace TeleSharp.TL.Upload BytesUtil.Serialize(FileToken, bw); BytesUtil.Serialize(EncryptionKey, bw); BytesUtil.Serialize(EncryptionIv, bw); - + ObjectUtils.SerializeObject(FileHashes, bw); } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLRequestGetCdnFile.cs b/src/TgSharp.TL/TL/Upload/TLRequestGetCdnFile.cs similarity index 94% rename from src/TeleSharp.TL/TL/Upload/TLRequestGetCdnFile.cs rename to src/TgSharp.TL/TL/Upload/TLRequestGetCdnFile.cs index 8d0033b..9ed6005 100644 --- a/src/TeleSharp.TL/TL/Upload/TLRequestGetCdnFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLRequestGetCdnFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(536919235)] public class TLRequestGetCdnFile : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Upload public int Limit { get; set; } public Upload.TLAbsCdnFile Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Upload FileToken = BytesUtil.Deserialize(br); Offset = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Upload BytesUtil.Serialize(FileToken, bw); bw.Write(Offset); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Upload.TLAbsCdnFile)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Upload/TLRequestGetCdnFileHashes.cs b/src/TgSharp.TL/TL/Upload/TLRequestGetCdnFileHashes.cs new file mode 100644 index 0000000..cec1662 --- /dev/null +++ b/src/TgSharp.TL/TL/Upload/TLRequestGetCdnFileHashes.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Upload +{ + [TLObject(1302676017)] + public class TLRequestGetCdnFileHashes : TLMethod + { + public override int Constructor + { + get + { + return 1302676017; + } + } + + public byte[] FileToken { get; set; } + public int Offset { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + FileToken = BytesUtil.Deserialize(br); + Offset = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + BytesUtil.Serialize(FileToken, bw); + bw.Write(Offset); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs b/src/TgSharp.TL/TL/Upload/TLRequestGetFile.cs similarity index 74% rename from src/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs rename to src/TgSharp.TL/TL/Upload/TLRequestGetFile.cs index 69737fe..20b19da 100644 --- a/src/TeleSharp.TL/TL/Upload/TLRequestGetFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLRequestGetFile.cs @@ -4,51 +4,57 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { - [TLObject(-475607115)] + [TLObject(-1319462148)] public class TLRequestGetFile : TLMethod { public override int Constructor { get { - return -475607115; + return -1319462148; } } + public int Flags { get; set; } + public bool Precise { get; set; } + public bool CdnSupported { get; set; } public TLAbsInputFileLocation Location { get; set; } public int Offset { get; set; } public int Limit { get; set; } public Upload.TLAbsFile Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { + Flags = br.ReadInt32(); + Precise = (Flags & 1) != 0; + CdnSupported = (Flags & 2) != 0; Location = (TLAbsInputFileLocation)ObjectUtils.DeserializeObject(br); Offset = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); + bw.Write(Flags); ObjectUtils.SerializeObject(Location, bw); bw.Write(Offset); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Upload.TLAbsFile)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TgSharp.TL/TL/Upload/TLRequestGetFileHashes.cs b/src/TgSharp.TL/TL/Upload/TLRequestGetFileHashes.cs new file mode 100644 index 0000000..7df63be --- /dev/null +++ b/src/TgSharp.TL/TL/Upload/TLRequestGetFileHashes.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Upload +{ + [TLObject(-956147407)] + public class TLRequestGetFileHashes : TLMethod + { + public override int Constructor + { + get + { + return -956147407; + } + } + + public TLAbsInputFileLocation Location { get; set; } + public int Offset { get; set; } + public TLVector Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Location = (TLAbsInputFileLocation)ObjectUtils.DeserializeObject(br); + Offset = br.ReadInt32(); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Location, bw); + bw.Write(Offset); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = (TLVector)ObjectUtils.DeserializeVector(br); + } + } +} diff --git a/src/TeleSharp.TL/TL/Upload/TLRequestGetWebFile.cs b/src/TgSharp.TL/TL/Upload/TLRequestGetWebFile.cs similarity index 83% rename from src/TeleSharp.TL/TL/Upload/TLRequestGetWebFile.cs rename to src/TgSharp.TL/TL/Upload/TLRequestGetWebFile.cs index 3f4b946..effcd52 100644 --- a/src/TeleSharp.TL/TL/Upload/TLRequestGetWebFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLRequestGetWebFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(619086221)] public class TLRequestGetWebFile : TLMethod @@ -18,23 +20,21 @@ namespace TeleSharp.TL.Upload } } - public TLInputWebFileLocation Location { get; set; } + public TLAbsInputWebFileLocation Location { get; set; } public int Offset { get; set; } public int Limit { get; set; } public Upload.TLWebFile Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { - Location = (TLInputWebFileLocation)ObjectUtils.DeserializeObject(br); + Location = (TLAbsInputWebFileLocation)ObjectUtils.DeserializeObject(br); Offset = br.ReadInt32(); Limit = br.ReadInt32(); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Upload ObjectUtils.SerializeObject(Location, bw); bw.Write(Offset); bw.Write(Limit); - } + public override void DeserializeResponse(BinaryReader br) { Response = (Upload.TLWebFile)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLRequestReuploadCdnFile.cs b/src/TgSharp.TL/TL/Upload/TLRequestReuploadCdnFile.cs similarity index 76% rename from src/TeleSharp.TL/TL/Upload/TLRequestReuploadCdnFile.cs rename to src/TgSharp.TL/TL/Upload/TLRequestReuploadCdnFile.cs index 9602cd1..beb98e9 100644 --- a/src/TeleSharp.TL/TL/Upload/TLRequestReuploadCdnFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLRequestReuploadCdnFile.cs @@ -4,35 +4,35 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { - [TLObject(779755552)] + [TLObject(-1691921240)] public class TLRequestReuploadCdnFile : TLMethod { public override int Constructor { get { - return 779755552; + return -1691921240; } } public byte[] FileToken { get; set; } public byte[] RequestToken { get; set; } - public bool Response { get; set; } - + public TLVector Response { get; set; } public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { FileToken = BytesUtil.Deserialize(br); RequestToken = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -40,12 +40,11 @@ namespace TeleSharp.TL.Upload bw.Write(Constructor); BytesUtil.Serialize(FileToken, bw); BytesUtil.Serialize(RequestToken, bw); - } + public override void DeserializeResponse(BinaryReader br) { - Response = BoolUtil.Deserialize(br); - + Response = (TLVector)ObjectUtils.DeserializeVector(br); } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs b/src/TgSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs similarity index 94% rename from src/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs rename to src/TgSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs index b662b4f..edca2d4 100644 --- a/src/TeleSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs +++ b/src/TgSharp.TL/TL/Upload/TLRequestSaveBigFilePart.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(-562337987)] public class TLRequestSaveBigFilePart : TLMethod @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Upload public byte[] Bytes { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -36,7 +37,6 @@ namespace TeleSharp.TL.Upload FilePart = br.ReadInt32(); FileTotalParts = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -46,12 +46,11 @@ namespace TeleSharp.TL.Upload bw.Write(FilePart); bw.Write(FileTotalParts); BytesUtil.Serialize(Bytes, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs b/src/TgSharp.TL/TL/Upload/TLRequestSaveFilePart.cs similarity index 94% rename from src/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs rename to src/TgSharp.TL/TL/Upload/TLRequestSaveFilePart.cs index bb4a5e1..239bf57 100644 --- a/src/TeleSharp.TL/TL/Upload/TLRequestSaveFilePart.cs +++ b/src/TgSharp.TL/TL/Upload/TLRequestSaveFilePart.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(-1291540959)] public class TLRequestSaveFilePart : TLMethod @@ -23,10 +25,9 @@ namespace TeleSharp.TL.Upload public byte[] Bytes { get; set; } public bool Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -34,7 +35,6 @@ namespace TeleSharp.TL.Upload FileId = br.ReadInt64(); FilePart = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -43,12 +43,11 @@ namespace TeleSharp.TL.Upload bw.Write(FileId); bw.Write(FilePart); BytesUtil.Serialize(Bytes, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = BoolUtil.Deserialize(br); - } } } diff --git a/src/TeleSharp.TL/TL/Upload/TLWebFile.cs b/src/TgSharp.TL/TL/Upload/TLWebFile.cs similarity index 94% rename from src/TeleSharp.TL/TL/Upload/TLWebFile.cs rename to src/TgSharp.TL/TL/Upload/TLWebFile.cs index 336fe70..351e81b 100644 --- a/src/TeleSharp.TL/TL/Upload/TLWebFile.cs +++ b/src/TgSharp.TL/TL/Upload/TLWebFile.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Upload + +using TgSharp.TL; + +namespace TgSharp.TL.Upload { [TLObject(568808380)] public class TLWebFile : TLObject @@ -24,10 +26,9 @@ namespace TeleSharp.TL.Upload public int Mtime { get; set; } public byte[] Bytes { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) @@ -37,7 +38,6 @@ namespace TeleSharp.TL.Upload FileType = (Storage.TLAbsFileType)ObjectUtils.DeserializeObject(br); Mtime = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); - } public override void SerializeBody(BinaryWriter bw) @@ -48,7 +48,6 @@ namespace TeleSharp.TL.Upload ObjectUtils.SerializeObject(FileType, bw); bw.Write(Mtime); BytesUtil.Serialize(Bytes, bw); - } } } diff --git a/src/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs b/src/TgSharp.TL/TL/Users/TLRequestGetFullUser.cs similarity index 93% rename from src/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs rename to src/TgSharp.TL/TL/Users/TLRequestGetFullUser.cs index 1f139f6..b696e3e 100644 --- a/src/TeleSharp.TL/TL/Users/TLRequestGetFullUser.cs +++ b/src/TgSharp.TL/TL/Users/TLRequestGetFullUser.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Users + +using TgSharp.TL; + +namespace TgSharp.TL.Users { [TLObject(-902781519)] public class TLRequestGetFullUser : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Users public TLAbsInputUser Id { get; set; } public TLUserFull Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLUserFull)ObjectUtils.DeserializeObject(br); - } } } diff --git a/src/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs b/src/TgSharp.TL/TL/Users/TLRequestGetUsers.cs similarity index 93% rename from src/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs rename to src/TgSharp.TL/TL/Users/TLRequestGetUsers.cs index 579d54b..6a2fcc3 100644 --- a/src/TeleSharp.TL/TL/Users/TLRequestGetUsers.cs +++ b/src/TgSharp.TL/TL/Users/TLRequestGetUsers.cs @@ -4,8 +4,10 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL.Users + +using TgSharp.TL; + +namespace TgSharp.TL.Users { [TLObject(227648840)] public class TLRequestGetUsers : TLMethod @@ -21,28 +23,25 @@ namespace TeleSharp.TL.Users public TLVector Id { get; set; } public TLVector Response { get; set; } - public void ComputeFlags() { - + // do nothing } public override void DeserializeBody(BinaryReader br) { Id = (TLVector)ObjectUtils.DeserializeVector(br); - } public override void SerializeBody(BinaryWriter bw) { bw.Write(Constructor); ObjectUtils.SerializeObject(Id, bw); - } + public override void DeserializeResponse(BinaryReader br) { Response = (TLVector)ObjectUtils.DeserializeVector(br); - } } } diff --git a/src/TgSharp.TL/TL/Users/TLRequestSetSecureValueErrors.cs b/src/TgSharp.TL/TL/Users/TLRequestSetSecureValueErrors.cs new file mode 100644 index 0000000..e081ccc --- /dev/null +++ b/src/TgSharp.TL/TL/Users/TLRequestSetSecureValueErrors.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using TgSharp.TL; + +namespace TgSharp.TL.Users +{ + [TLObject(-1865902923)] + public class TLRequestSetSecureValueErrors : TLMethod + { + public override int Constructor + { + get + { + return -1865902923; + } + } + + public TLAbsInputUser Id { get; set; } + public TLVector Errors { get; set; } + public bool Response { get; set; } + + public void ComputeFlags() + { + // do nothing + } + + public override void DeserializeBody(BinaryReader br) + { + Id = (TLAbsInputUser)ObjectUtils.DeserializeObject(br); + Errors = (TLVector)ObjectUtils.DeserializeVector(br); + } + + public override void SerializeBody(BinaryWriter bw) + { + bw.Write(Constructor); + ObjectUtils.SerializeObject(Id, bw); + ObjectUtils.SerializeObject(Errors, bw); + } + + public override void DeserializeResponse(BinaryReader br) + { + Response = BoolUtil.Deserialize(br); + } + } +} diff --git a/src/TeleSharp.TL/TLContext.cs b/src/TgSharp.TL/TLContext.cs similarity index 87% rename from src/TeleSharp.TL/TLContext.cs rename to src/TgSharp.TL/TLContext.cs index be43936..2d04707 100644 --- a/src/TeleSharp.TL/TLContext.cs +++ b/src/TgSharp.TL/TLContext.cs @@ -5,8 +5,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL +namespace TgSharp.TL { public static class TLContext { @@ -16,7 +15,7 @@ namespace TeleSharp.TL { Types = new Dictionary(); Types = (from t in Assembly.GetExecutingAssembly().GetTypes() - where t.IsClass && t.Namespace.StartsWith("TeleSharp.TL") + where t.IsClass && t.Namespace.StartsWith(typeof(TLContext).Namespace) where t.IsSubclassOf(typeof(TLObject)) where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); diff --git a/src/TeleSharp.TL/TLMethod.cs b/src/TgSharp.TL/TLMethod.cs similarity index 96% rename from src/TeleSharp.TL/TLMethod.cs rename to src/TgSharp.TL/TLMethod.cs index 25b8d99..b7a75ae 100644 --- a/src/TeleSharp.TL/TLMethod.cs +++ b/src/TgSharp.TL/TLMethod.cs @@ -5,8 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL +namespace TgSharp.TL { public abstract class TLMethod : TLObject { diff --git a/src/TeleSharp.TL/TLObject.cs b/src/TgSharp.TL/TLObject.cs similarity index 96% rename from src/TeleSharp.TL/TLObject.cs rename to src/TgSharp.TL/TLObject.cs index f398ddf..27b478e 100644 --- a/src/TeleSharp.TL/TLObject.cs +++ b/src/TgSharp.TL/TLObject.cs @@ -5,8 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL +namespace TgSharp.TL { public class TLObjectAttribute : Attribute { diff --git a/src/TeleSharp.TL/TLUtils.cs b/src/TgSharp.TL/TLUtils.cs similarity index 99% rename from src/TeleSharp.TL/TLUtils.cs rename to src/TgSharp.TL/TLUtils.cs index 1f8c80c..e4501fa 100644 --- a/src/TeleSharp.TL/TLUtils.cs +++ b/src/TgSharp.TL/TLUtils.cs @@ -6,8 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using TeleSharp.TL; -namespace TeleSharp.TL +namespace TgSharp.TL { public class IntegerUtil { diff --git a/src/TeleSharp.TL/TLVector.cs b/src/TgSharp.TL/TLVector.cs similarity index 99% rename from src/TeleSharp.TL/TLVector.cs rename to src/TgSharp.TL/TLVector.cs index 29f82e7..f0dc084 100644 --- a/src/TeleSharp.TL/TLVector.cs +++ b/src/TgSharp.TL/TLVector.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace TeleSharp.TL +namespace TgSharp.TL { public class TLVector : TLObject, IList { diff --git a/src/TeleSharp.TL/TeleSharp.TL.csproj b/src/TgSharp.TL/TgSharp.TL.csproj similarity index 96% rename from src/TeleSharp.TL/TeleSharp.TL.csproj rename to src/TgSharp.TL/TgSharp.TL.csproj index b6c36d5..0e7e43c 100644 --- a/src/TeleSharp.TL/TeleSharp.TL.csproj +++ b/src/TgSharp.TL/TgSharp.TL.csproj @@ -7,8 +7,8 @@ {D6144517-91D2-4880-86DF-E9FF5D7F383A} Library Properties - TeleSharp.TL - TeleSharp.TL + TgSharp.TL + TgSharp.TL v4.6 512 @@ -77,4 +77,4 @@ --> - \ No newline at end of file + diff --git a/src/TeleSharp.TL/packages.config b/src/TgSharp.TL/packages.config similarity index 100% rename from src/TeleSharp.TL/packages.config rename to src/TgSharp.TL/packages.config diff --git a/src/TgSharp.Tests.NUnit/Test.cs b/src/TgSharp.Tests.NUnit/Test.cs index b8a49a5..7845f08 100644 --- a/src/TgSharp.Tests.NUnit/Test.cs +++ b/src/TgSharp.Tests.NUnit/Test.cs @@ -63,19 +63,6 @@ namespace TgSharp.Tests await base.SignUpNewUser(); } - [Test] - public override async Task CheckPhones() - { - await base.CheckPhones(); - } - - [Test] - [Ignore("FIXME")] - public override async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError() - { - await base.FloodExceptionShouldNotCauseCannotReadPackageLengthError(); - } - [Test] public override async Task SendMessageByUserNameTest() { diff --git a/src/TgSharp.Tests.VS/TgSharpTestsVs.cs b/src/TgSharp.Tests.VS/TgSharpTestsVs.cs index b06d896..a063a35 100644 --- a/src/TgSharp.Tests.VS/TgSharpTestsVs.cs +++ b/src/TgSharp.Tests.VS/TgSharpTestsVs.cs @@ -62,18 +62,6 @@ namespace TgSharp.Tests await base.SignUpNewUser(); } - [TestMethod] - public override async Task CheckPhones() - { - await base.CheckPhones(); - } - [TestMethod] - [Ignore] - public override async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError() - { - await base.FloodExceptionShouldNotCauseCannotReadPackageLengthError(); - } - [TestMethod] public override async Task SendMessageByUserNameTest() { diff --git a/src/TgSharp.Tests/TgSharp.Tests.csproj b/src/TgSharp.Tests/TgSharp.Tests.csproj index 96f4529..ba8b83d 100644 --- a/src/TgSharp.Tests/TgSharp.Tests.csproj +++ b/src/TgSharp.Tests/TgSharp.Tests.csproj @@ -43,14 +43,14 @@ - - {d6144517-91d2-4880-86df-e9ff5d7f383a} - TeleSharp.TL - {400d2544-1cc6-4d8a-a62c-2292d9947a16} TgSharp.Core + + {D6144517-91D2-4880-86DF-E9FF5D7F383A} + TgSharp.TL + diff --git a/src/TgSharp.Tests/TgSharpTests.cs b/src/TgSharp.Tests/TgSharpTests.cs index 7d757fc..4d8cb97 100644 --- a/src/TgSharp.Tests/TgSharpTests.cs +++ b/src/TgSharp.Tests/TgSharpTests.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using TeleSharp.TL; -using TeleSharp.TL.Messages; +using TgSharp.TL; +using TgSharp.TL.Messages; using TgSharp.Core; using TgSharp.Core.Exceptions; using TgSharp.Core.Network; @@ -139,13 +139,6 @@ namespace TgSharp.Tests { user = await client.MakeAuthAsync(NumberToAuthenticate, hash, code); } - catch (CloudPasswordNeededException ex) - { - var passwordSetting = await client.GetPasswordSetting(); - var password = PasswordToAuthenticate; - - user = await client.MakeAuthWithPasswordAsync(passwordSetting, password); - } 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", @@ -192,7 +185,7 @@ namespace TgSharp.Tests await client.ConnectAsync(); - var dialogs = (TLDialogs) await client.GetUserDialogsAsync(); + var dialogs = (TLDialogs)await client.GetUserDialogsAsync(); var chat = dialogs.Chats .OfType() .FirstOrDefault(c => c.Title == "TestGroup"); @@ -213,7 +206,7 @@ namespace TgSharp.Tests .FirstOrDefault(x => x.Phone == NumberToSendMessage); var fileResult = (TLInputFile)await client.UploadFile("cat.jpg", new StreamReader("data/cat.jpg")); - await client.SendUploadedPhoto(new TLInputPeerUser() { UserId = user.Id }, fileResult, "kitty"); + await client.SendUploadedPhoto(new TLInputPeerUser() { UserId = user.Id }, fileResult); } public virtual async Task SendBigFileToContactTest() @@ -233,7 +226,6 @@ namespace TgSharp.Tests await client.SendUploadedDocument( new TLInputPeerUser() { UserId = user.Id }, fileResult, - "some zips", "application/zip", new TLVector()); } @@ -266,10 +258,11 @@ namespace TgSharp.Tests { AccessHash = document.AccessHash, Id = document.Id, - Version = document.Version + FileReference = document.FileReference, + ThumbSize = "250x250" }, document.Size); - + Assert.IsTrue(resFile.Bytes.Length > 0); } @@ -284,18 +277,19 @@ namespace TgSharp.Tests var user = result.Users .OfType() .FirstOrDefault(x => x.Id == 5880094); - - var photo = ((TLUserProfilePhoto)user.Photo); - var photoLocation = (TLFileLocation) photo.PhotoBig; - var resFile = await client.GetFile(new TLInputFileLocation() + var photo = ((TLUserProfilePhoto)user.Photo); + var photoLocation = (TLFileLocationToBeDeprecated)photo.PhotoBig; + + var resFile = await client.GetFile(new TLInputPeerPhotoFileLocation() { + Big = true, LocalId = photoLocation.LocalId, - Secret = photoLocation.Secret, - VolumeId = photoLocation.VolumeId + VolumeId = photoLocation.VolumeId, + Peer = new TLInputPeerUser { UserId = user.Id, AccessHash = user.AccessHash.Value } }, 1024); - var res = await client.GetUserDialogsAsync(); + var res = await client.GetUserDialogsAsync(); Assert.IsTrue(resFile.Bytes.Length > 0); } @@ -308,37 +302,9 @@ namespace TgSharp.Tests var hash = await client.SendCodeRequestAsync(NotRegisteredNumberToSignUp); var code = ""; - var registeredUser = await client.SignUpAsync(NotRegisteredNumberToSignUp, hash, code, "TgSharp", "User"); + var registeredUser = await client.MakeAuthAsync(NotRegisteredNumberToSignUp, hash, code, "TgSharp", "User"); Assert.IsNotNull(registeredUser); Assert.IsTrue(client.IsUserAuthorized()); - - var loggedInUser = await client.MakeAuthAsync(NotRegisteredNumberToSignUp, hash, code); - Assert.IsNotNull(loggedInUser); - } - - public virtual async Task CheckPhones() - { - var client = NewClient(); - await client.ConnectAsync(); - - var result = await client.IsPhoneRegisteredAsync(NumberToAuthenticate); - Assert.IsTrue(result); - } - - public virtual async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError() - { - for (int i = 0; i < 50; i++) - { - try - { - await CheckPhones(); - } - catch (FloodException floodException) - { - Console.WriteLine($"FLOODEXCEPTION: {floodException}"); - Thread.Sleep(floodException.TimeToWait); - } - } } public virtual async Task SendMessageByUserNameTest() diff --git a/src/TgSharp.sln b/src/TgSharp.sln index 7b36be7..dbd2969 100644 --- a/src/TgSharp.sln +++ b/src/TgSharp.sln @@ -5,9 +5,9 @@ VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TgSharp.Core", "TgSharp.Core\TgSharp.Core.csproj", "{400D2544-1CC6-4D8A-A62C-2292D9947A16}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeleSharp.TL", "TeleSharp.TL\TeleSharp.TL.csproj", "{D6144517-91D2-4880-86DF-E9FF5D7F383A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TgSharp.TL", "TgSharp.TL\TgSharp.TL.csproj", "{D6144517-91D2-4880-86DF-E9FF5D7F383A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeleSharp.Generator", "TeleSharp.Generator\TeleSharp.Generator.csproj", "{9BE3B9D4-9FF6-4DC8-B9CC-EB2E3F390129}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TgSharp.Generator", "TgSharp.Generator\TgSharp.Generator.csproj", "{9BE3B9D4-9FF6-4DC8-B9CC-EB2E3F390129}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TgSharp.Tests", "TgSharp.Tests\TgSharp.Tests.csproj", "{DE5C0467-EE99-4734-95F2-EFF7A0B99924}" EndProject