mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Merge pull request #13 from nblockchain/layerUpdate
Layer update (to 108)
This commit is contained in:
commit
501ebb936d
2
.github/workflows/nugetUpload.yml
vendored
2
.github/workflows/nugetUpload.yml
vendored
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
|||
13
README.md
13
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!
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace TeleSharp.Generator.Models
|
||||
{
|
||||
internal class TlSchema
|
||||
{
|
||||
[JsonProperty("constructors")]
|
||||
public List<TlConstructor> Constructors { get; set; }
|
||||
|
||||
[JsonProperty("methods")]
|
||||
public List<TlMethod> Methods { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<int> ExportCard { get; set; }
|
||||
public TLAbsUser Response { get; set; }
|
||||
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
ExportCard = (TLVector<int>)ObjectUtils.DeserializeVector<int>(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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TLBotInfo> 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<TLBotInfo>)ObjectUtils.DeserializeVector<TLBotInfo>(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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TLAbsDocumentAttribute> Attributes { get; set; }
|
||||
public string Caption { get; set; }
|
||||
public TLVector<TLAbsInputDocument> 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<TLAbsDocumentAttribute>)ObjectUtils.DeserializeVector<TLAbsDocumentAttribute>(br);
|
||||
Caption = StringUtil.Deserialize(br);
|
||||
if ((Flags & 1) != 0)
|
||||
Stickers = (TLVector<TLAbsInputDocument>)ObjectUtils.DeserializeVector<TLAbsInputDocument>(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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TLAbsPhotoSize> 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<TLAbsPhotoSize>)ObjectUtils.DeserializeVector<TLAbsPhotoSize>(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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<byte[], ulong, int>(message, remoteMessageId, remoteSequence);
|
||||
}
|
||||
|
||||
public async Task<byte[]> Receive(TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken))
|
||||
public async Task<byte[]> 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();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using TeleSharp.TL;
|
||||
|
||||
using TgSharp.TL;
|
||||
|
||||
namespace TgSharp.Core.Network.Requests
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using TeleSharp.TL;
|
||||
|
||||
using TgSharp.TL;
|
||||
using TgSharp.Core.Utils;
|
||||
|
||||
namespace TgSharp.Core.Network.Requests
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using TeleSharp.TL;
|
||||
|
||||
using TgSharp.TL;
|
||||
using TgSharp.Core.MTProto;
|
||||
using TgSharp.Core.MTProto.Crypto;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<bool> 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<string> 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<TLUser> MakeAuthAsync(string phoneNumber, string phoneCodeHash, string code, CancellationToken token = default(CancellationToken))
|
||||
public async Task<TLUser> 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<TLPassword> GetPasswordSetting(CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
var request = new TLRequestGetPassword();
|
||||
|
||||
await RequestWithDcMigration(request, token).ConfigureAwait(false);
|
||||
|
||||
return (TLPassword)request.Response;
|
||||
}
|
||||
|
||||
public async Task<TLUser> MakeAuthWithPasswordAsync(TLPassword password, string password_str, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
byte[] password_Bytes = Encoding.UTF8.GetBytes(password_str);
|
||||
IEnumerable<byte> 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<TLUser> 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<T> SendRequestAsync<T>(TLMethod methodToExecute, CancellationToken token = default(CancellationToken))
|
||||
|
|
@ -284,7 +245,7 @@ namespace TgSharp.Core
|
|||
return (T)result;
|
||||
}
|
||||
|
||||
internal async Task<T> SendAuthenticatedRequestAsync<T> (TLMethod methodToExecute, CancellationToken token = default(CancellationToken))
|
||||
internal async Task<T> SendAuthenticatedRequestAsync<T>(TLMethod methodToExecute, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
if (!IsUserAuthorized())
|
||||
throw new InvalidOperationException("Authorize user first!");
|
||||
|
|
@ -311,7 +272,7 @@ namespace TgSharp.Core
|
|||
|
||||
public async Task<TLImportedContacts> ImportContactsAsync(IReadOnlyList<TLInputPhoneContact> contacts, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
var req = new TLRequestImportContacts { Contacts = new TLVector<TLInputPhoneContact>(contacts)};
|
||||
var req = new TLRequestImportContacts { Contacts = new TLVector<TLInputPhoneContact>(contacts) };
|
||||
|
||||
return await SendAuthenticatedRequestAsync<TLImportedContacts>(req, token)
|
||||
.ConfigureAwait(false);
|
||||
|
|
@ -319,23 +280,15 @@ namespace TgSharp.Core
|
|||
|
||||
public async Task<bool> DeleteContactsAsync(IReadOnlyList<TLAbsInputUser> users, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
var req = new TLRequestDeleteContacts {Id = new TLVector<TLAbsInputUser>(users)};
|
||||
var req = new TLRequestDeleteContacts { Id = new TLVector<TLAbsInputUser>(users) };
|
||||
|
||||
return await SendAuthenticatedRequestAsync<bool>(req, token)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<TLLink> DeleteContactAsync(TLAbsInputUser user, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
var req = new TLRequestDeleteContact {Id = user};
|
||||
|
||||
return await SendAuthenticatedRequestAsync<TLLink>(req, token)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<TLContacts> GetContactsAsync(CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
var req = new TLRequestGetContacts() { Hash = "" };
|
||||
var req = new TLRequestGetContacts() { Hash = 0 };
|
||||
|
||||
return await SendAuthenticatedRequestAsync<TLContacts>(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<TLAbsDialogs>(req, token)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<TLAbsUpdates> SendUploadedPhoto(TLAbsInputPeer peer, TLAbsInputFile file, string caption, CancellationToken token = default(CancellationToken))
|
||||
public async Task<TLAbsUpdates> SendUploadedPhoto(TLAbsInputPeer peer, TLAbsInputFile file, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
return await SendAuthenticatedRequestAsync<TLAbsUpdates>(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<TLAbsUpdates> SendUploadedDocument(
|
||||
TLAbsInputPeer peer, TLAbsInputFile file, string caption, string mimeType, TLVector<TLAbsDocumentAttribute> attributes, CancellationToken token = default(CancellationToken))
|
||||
TLAbsInputPeer peer, TLAbsInputFile file, string mimeType, TLVector<TLAbsDocumentAttribute> attributes, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
return await SendAuthenticatedRequestAsync<TLAbsUpdates>(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<TLFile> GetFile(TLAbsInputFileLocation location, int filePartSize, int offset = 0, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
TLFile result = await SendAuthenticatedRequestAsync<TLFile>(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
|
|||
/// <returns></returns>
|
||||
public async Task<TLFound> 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
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TeleSharp.TL\TeleSharp.TL.csproj">
|
||||
<ProjectReference Include="..\TgSharp.TL\TgSharp.TL.csproj">
|
||||
<Project>{d6144517-91d2-4880-86df-e9ff5d7f383a}</Project>
|
||||
<Name>TeleSharp.TL</Name>
|
||||
</ProjectReference>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ It's a perfect fit for any developer who would like to send data directly to Tel
|
|||
<copyright>Copyright 2015-2020</copyright>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="bin\Release\TeleSharp.TL.dll" target="lib\net46\TeleSharp.TL.dll" />
|
||||
<file src="bin\Release\TgSharp.TL.dll" target="lib\net46\TgSharp.TL.dll" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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 */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TlParam> Params { get; set; }
|
||||
public List<Param> Params { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
|
@ -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<TlParam> Params { get; set; }
|
||||
public List<Param> Params { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
|
@ -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; }
|
||||
14
src/TgSharp.Generator/Models/Schema.cs
Normal file
14
src/TgSharp.Generator/Models/Schema.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace TgSharp.Generator.Models
|
||||
{
|
||||
internal class Schema
|
||||
{
|
||||
[JsonProperty("constructors")]
|
||||
public List<Constructor> Constructors { get; set; }
|
||||
|
||||
[JsonProperty("methods")]
|
||||
public List<Function> Methods { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -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<string> templateFiles = new List<string> (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<TlSchema>(Json);
|
||||
Schema schema = JsonConvert.DeserializeObject<Schema>(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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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("")]
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
<ProjectGuid>{9BE3B9D4-9FF6-4DC8-B9CC-EB2E3F390129}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TeleSharp.Generator</RootNamespace>
|
||||
<AssemblyName>TeleSharp.Generator</AssemblyName>
|
||||
<RootNamespace>TgSharp.Generator</RootNamespace>
|
||||
<AssemblyName>TgSharp.Generator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
|
|
@ -48,12 +48,12 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Models\TlMethod.cs" />
|
||||
<Compile Include="Models\Function.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Models\TlConstructor.cs" />
|
||||
<Compile Include="Models\TlParam.cs" />
|
||||
<Compile Include="Models\TlSchema.cs" />
|
||||
<Compile Include="Models\Constructor.cs" />
|
||||
<Compile Include="Models\Param.cs" />
|
||||
<Compile Include="Models\Schema.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
|
@ -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
|
||||
{
|
||||
|
|
@ -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("")]
|
||||
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
61
src/TgSharp.TL/TL/Account/TLAuthorizationForm.cs
Normal file
61
src/TgSharp.TL/TL/Account/TLAuthorizationForm.cs
Normal file
|
|
@ -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<TLAbsSecureRequiredType> RequiredTypes { get; set; }
|
||||
public TLVector<TLSecureValue> Values { get; set; }
|
||||
public TLVector<TLAbsSecureValueError> Errors { get; set; }
|
||||
public TLVector<TLAbsUser> Users { get; set; }
|
||||
public string PrivacyPolicyUrl { get; set; }
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
Flags = br.ReadInt32();
|
||||
RequiredTypes = (TLVector<TLAbsSecureRequiredType>)ObjectUtils.DeserializeVector<TLAbsSecureRequiredType>(br);
|
||||
Values = (TLVector<TLSecureValue>)ObjectUtils.DeserializeVector<TLSecureValue>(br);
|
||||
Errors = (TLVector<TLAbsSecureValueError>)ObjectUtils.DeserializeVector<TLAbsSecureValueError>(br);
|
||||
Users = (TLVector<TLAbsUser>)ObjectUtils.DeserializeVector<TLAbsUser>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TLAuthorization> Authorizations { get; set; }
|
||||
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
Authorizations = (TLVector<TLAuthorization>)ObjectUtils.DeserializeVector<TLAuthorization>(br);
|
||||
|
||||
}
|
||||
|
||||
public override void SerializeBody(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(Constructor);
|
||||
ObjectUtils.SerializeObject(Authorizations, bw);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/TgSharp.TL/TL/Account/TLAutoDownloadSettings.cs
Normal file
47
src/TgSharp.TL/TL/Account/TLAutoDownloadSettings.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
96
src/TgSharp.TL/TL/Account/TLPassword.cs
Normal file
96
src/TgSharp.TL/TL/Account/TLPassword.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/TgSharp.TL/TL/Account/TLPasswordSettings.cs
Normal file
57
src/TgSharp.TL/TL/Account/TLPasswordSettings.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TLAbsPrivacyRule> Rules { get; set; }
|
||||
public TLVector<TLAbsChat> Chats { get; set; }
|
||||
public TLVector<TLAbsUser> Users { get; set; }
|
||||
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
Rules = (TLVector<TLAbsPrivacyRule>)ObjectUtils.DeserializeVector<TLAbsPrivacyRule>(br);
|
||||
Chats = (TLVector<TLAbsChat>)ObjectUtils.DeserializeVector<TLAbsChat>(br);
|
||||
Users = (TLVector<TLAbsUser>)ObjectUtils.DeserializeVector<TLAbsUser>(br);
|
||||
|
||||
}
|
||||
|
||||
public override void SerializeBody(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(Constructor);
|
||||
ObjectUtils.SerializeObject(Rules, bw);
|
||||
ObjectUtils.SerializeObject(Chats, bw);
|
||||
ObjectUtils.SerializeObject(Users, bw);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
59
src/TgSharp.TL/TL/Account/TLRequestAcceptAuthorization.cs
Normal file
59
src/TgSharp.TL/TL/Account/TLRequestAcceptAuthorization.cs
Normal file
|
|
@ -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<TLSecureValueHash> 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<TLSecureValueHash>)ObjectUtils.DeserializeVector<TLSecureValueHash>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/TgSharp.TL/TL/Account/TLRequestCancelPasswordEmail.cs
Normal file
46
src/TgSharp.TL/TL/Account/TLRequestCancelPasswordEmail.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
69
src/TgSharp.TL/TL/Account/TLRequestCreateTheme.cs
Normal file
69
src/TgSharp.TL/TL/Account/TLRequestCreateTheme.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/TgSharp.TL/TL/Account/TLRequestDeleteSecureValue.cs
Normal file
47
src/TgSharp.TL/TL/Account/TLRequestDeleteSecureValue.cs
Normal file
|
|
@ -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<TLAbsSecureValueType> Types { get; set; }
|
||||
public bool Response { get; set; }
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
Types = (TLVector<TLAbsSecureValueType>)ObjectUtils.DeserializeVector<TLAbsSecureValueType>(br);
|
||||
}
|
||||
|
||||
public override void SerializeBody(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(Constructor);
|
||||
ObjectUtils.SerializeObject(Types, bw);
|
||||
}
|
||||
|
||||
public override void DeserializeResponse(BinaryReader br)
|
||||
{
|
||||
Response = BoolUtil.Deserialize(br);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
src/TgSharp.TL/TL/Account/TLRequestFinishTakeoutSession.cs
Normal file
49
src/TgSharp.TL/TL/Account/TLRequestFinishTakeoutSession.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/TgSharp.TL/TL/Account/TLRequestGetAllSecureValues.cs
Normal file
46
src/TgSharp.TL/TL/Account/TLRequestGetAllSecureValues.cs
Normal file
|
|
@ -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<TLSecureValue> 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<TLSecureValue>)ObjectUtils.DeserializeVector<TLSecureValue>(br);
|
||||
}
|
||||
}
|
||||
}
|
||||
53
src/TgSharp.TL/TL/Account/TLRequestGetAuthorizationForm.cs
Normal file
53
src/TgSharp.TL/TL/Account/TLRequestGetAuthorizationForm.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/TgSharp.TL/TL/Account/TLRequestGetContentSettings.cs
Normal file
46
src/TgSharp.TL/TL/Account/TLRequestGetContentSettings.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/TgSharp.TL/TL/Account/TLRequestGetMultiWallPapers.cs
Normal file
47
src/TgSharp.TL/TL/Account/TLRequestGetMultiWallPapers.cs
Normal file
|
|
@ -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<TLAbsInputWallPaper> Wallpapers { get; set; }
|
||||
public TLVector<TLAbsWallPaper> Response { get; set; }
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
Wallpapers = (TLVector<TLAbsInputWallPaper>)ObjectUtils.DeserializeVector<TLAbsInputWallPaper>(br);
|
||||
}
|
||||
|
||||
public override void SerializeBody(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(Constructor);
|
||||
ObjectUtils.SerializeObject(Wallpapers, bw);
|
||||
}
|
||||
|
||||
public override void DeserializeResponse(BinaryReader br)
|
||||
{
|
||||
Response = (TLVector<TLAbsWallPaper>)ObjectUtils.DeserializeVector<TLAbsWallPaper>(br);
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/TgSharp.TL/TL/Account/TLRequestGetNotifyExceptions.cs
Normal file
57
src/TgSharp.TL/TL/Account/TLRequestGetNotifyExceptions.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/TgSharp.TL/TL/Account/TLRequestGetSecureValue.cs
Normal file
47
src/TgSharp.TL/TL/Account/TLRequestGetSecureValue.cs
Normal file
|
|
@ -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<TLAbsSecureValueType> Types { get; set; }
|
||||
public TLVector<TLSecureValue> Response { get; set; }
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
Types = (TLVector<TLAbsSecureValueType>)ObjectUtils.DeserializeVector<TLAbsSecureValueType>(br);
|
||||
}
|
||||
|
||||
public override void SerializeBody(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(Constructor);
|
||||
ObjectUtils.SerializeObject(Types, bw);
|
||||
}
|
||||
|
||||
public override void DeserializeResponse(BinaryReader br)
|
||||
{
|
||||
Response = (TLVector<TLSecureValue>)ObjectUtils.DeserializeVector<TLSecureValue>(br);
|
||||
}
|
||||
}
|
||||
}
|
||||
53
src/TgSharp.TL/TL/Account/TLRequestGetTheme.cs
Normal file
53
src/TgSharp.TL/TL/Account/TLRequestGetTheme.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
50
src/TgSharp.TL/TL/Account/TLRequestGetThemes.cs
Normal file
50
src/TgSharp.TL/TL/Account/TLRequestGetThemes.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/TgSharp.TL/TL/Account/TLRequestGetWallPaper.cs
Normal file
47
src/TgSharp.TL/TL/Account/TLRequestGetWallPaper.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/TgSharp.TL/TL/Account/TLRequestGetWallPapers.cs
Normal file
47
src/TgSharp.TL/TL/Account/TLRequestGetWallPapers.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/TgSharp.TL/TL/Account/TLRequestGetWebAuthorizations.cs
Normal file
46
src/TgSharp.TL/TL/Account/TLRequestGetWebAuthorizations.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
67
src/TgSharp.TL/TL/Account/TLRequestInitTakeoutSession.cs
Normal file
67
src/TgSharp.TL/TL/Account/TLRequestInitTakeoutSession.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
65
src/TgSharp.TL/TL/Account/TLRequestInstallTheme.cs
Normal file
65
src/TgSharp.TL/TL/Account/TLRequestInstallTheme.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue