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)
|
$version = $Env:GITHUB_REF.Substring($tagPrefix.Length)
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
$baseVersion = "0.1.1"
|
$baseVersion = "0.3.1"
|
||||||
$version = "$baseVersion--date$date.git-$hash"
|
$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.SendUploadedPhoto(new TLInputPeerUser() { UserId = user.Id }, fileResult, "kitty");
|
||||||
await client.SendUploadedDocument(new TLInputPeerUser() { UserId = user.Id },
|
await client.SendUploadedDocument(new TLInputPeerUser() { UserId = user.Id },
|
||||||
fileResult,
|
fileResult,
|
||||||
"some zips", //caption
|
|
||||||
"application/zip", //mime-type
|
"application/zip", //mime-type
|
||||||
|
|
||||||
//document attributes, such as file name
|
//document attributes, such as file name
|
||||||
|
|
@ -138,7 +137,8 @@ To download a file you should call the **GetFile** method:
|
||||||
{
|
{
|
||||||
AccessHash = document.AccessHash,
|
AccessHash = document.AccessHash,
|
||||||
Id = document.Id,
|
Id = document.Id,
|
||||||
Version = document.Version
|
FileReference = document.FileReference,
|
||||||
|
ThumbSize = "250x250"
|
||||||
},
|
},
|
||||||
|
|
||||||
//size of fileChunk you want to retrieve
|
//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.
|
For your convenience TgSharp have wrappers for several Telegram API methods. You could add your own, see details below.
|
||||||
|
|
||||||
1. IsPhoneRegisteredAsync
|
|
||||||
1. SendCodeRequestAsync
|
1. SendCodeRequestAsync
|
||||||
1. MakeAuthAsync
|
1. MakeAuthAsync
|
||||||
1. SignUpAsync
|
|
||||||
1. GetContactsAsync
|
1. GetContactsAsync
|
||||||
1. SendMessageAsync
|
1. SendMessageAsync
|
||||||
1. SendTypingAsync
|
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?**
|
**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.
|
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://gist.github.com/aarani/b22b7cda024973dff68e1672794b0298)
|
Latest scheme in JSON format you can find [here](https://core.telegram.org/schema/json)
|
||||||
|
|
||||||
|
|
||||||
## What things can I help on (Project Roadmap)?
|
## What things can I help on (Project Roadmap)?
|
||||||
|
|
||||||
* Add Updates handling via events (WIP PR: https://github.com/sochix/TLSharp/pull/892 )
|
* Add Updates handling via events (WIP PR: https://github.com/sochix/TLSharp/pull/892 )
|
||||||
* GithubActions CI job for running tests
|
* GithubActions CI job for running tests
|
||||||
* Update to latest Layer (WIP PR: https://github.com/nblockchain/TgSharp/pull/5 ).
|
|
||||||
* Upgrade to .NETStandard 2.0.
|
* 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?
|
#### 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!
|
#### 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.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
using TgSharp.Core.Exceptions;
|
using TgSharp.Core.Exceptions;
|
||||||
using TgSharp.Core.MTProto;
|
using TgSharp.Core.MTProto;
|
||||||
using TgSharp.Core.MTProto.Crypto;
|
using TgSharp.Core.MTProto.Crypto;
|
||||||
|
|
@ -37,7 +38,7 @@ namespace TgSharp.Core.Network
|
||||||
return confirmed ? session.Sequence++ * 2 + 1 : session.Sequence * 2;
|
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();
|
token.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
|
@ -65,7 +66,7 @@ namespace TgSharp.Core.Network
|
||||||
session.Save();
|
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();
|
token.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
|
@ -134,7 +135,7 @@ namespace TgSharp.Core.Network
|
||||||
return new Tuple<byte[], ulong, int>(message, remoteMessageId, remoteSequence);
|
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)
|
while (!request.ConfirmReceived)
|
||||||
{
|
{
|
||||||
|
|
@ -270,7 +271,7 @@ namespace TgSharp.Core.Network
|
||||||
return true;
|
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();
|
uint code = messageReader.ReadUInt32();
|
||||||
ulong requestId = messageReader.ReadUInt64();
|
ulong requestId = messageReader.ReadUInt64();
|
||||||
|
|
@ -492,7 +493,7 @@ namespace TgSharp.Core.Network
|
||||||
return true;
|
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();
|
uint code = messageReader.ReadUInt32();
|
||||||
ulong msgId = messageReader.ReadUInt64();
|
ulong msgId = messageReader.ReadUInt64();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
|
|
||||||
namespace TgSharp.Core.Network.Requests
|
namespace TgSharp.Core.Network.Requests
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
using TgSharp.Core.Utils;
|
using TgSharp.Core.Utils;
|
||||||
|
|
||||||
namespace TgSharp.Core.Network.Requests
|
namespace TgSharp.Core.Network.Requests
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
using TgSharp.Core.MTProto;
|
using TgSharp.Core.MTProto;
|
||||||
using TgSharp.Core.MTProto.Crypto;
|
using TgSharp.Core.MTProto.Crypto;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,21 @@ using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
using TeleSharp.TL.Account;
|
using TgSharp.TL;
|
||||||
using TeleSharp.TL.Auth;
|
using TgSharp.TL.Account;
|
||||||
using TeleSharp.TL.Contacts;
|
using TgSharp.TL.Auth;
|
||||||
using TeleSharp.TL.Help;
|
using TgSharp.TL.Contacts;
|
||||||
using TeleSharp.TL.Messages;
|
using TgSharp.TL.Help;
|
||||||
using TeleSharp.TL.Upload;
|
using TgSharp.TL.Messages;
|
||||||
|
using TgSharp.TL.Upload;
|
||||||
using TgSharp.Core.Auth;
|
using TgSharp.Core.Auth;
|
||||||
using TgSharp.Core.Exceptions;
|
using TgSharp.Core.Exceptions;
|
||||||
using TgSharp.Core.MTProto.Crypto;
|
using TgSharp.Core.MTProto.Crypto;
|
||||||
using TgSharp.Core.Network;
|
using TgSharp.Core.Network;
|
||||||
using TgSharp.Core.Network.Exceptions;
|
using TgSharp.Core.Network.Exceptions;
|
||||||
using TgSharp.Core.Utils;
|
using TgSharp.Core.Utils;
|
||||||
using TLAuthorization = TeleSharp.TL.Auth.TLAuthorization;
|
using TLAuthorization = TgSharp.TL.Auth.TLAuthorization;
|
||||||
|
|
||||||
namespace TgSharp.Core
|
namespace TgSharp.Core
|
||||||
{
|
{
|
||||||
|
|
@ -100,9 +101,11 @@ namespace TgSharp.Core
|
||||||
DeviceModel = "PC",
|
DeviceModel = "PC",
|
||||||
LangCode = "en",
|
LangCode = "en",
|
||||||
Query = config,
|
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.Send(invokewithLayer, token).ConfigureAwait(false);
|
||||||
await sender.Receive(invokewithLayer, token).ConfigureAwait(false);
|
await sender.Receive(invokewithLayer, token).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|
@ -192,31 +195,19 @@ namespace TgSharp.Core
|
||||||
return session.TLUser != null;
|
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))
|
public async Task<string> SendCodeRequestAsync(string phoneNumber, CancellationToken token = default(CancellationToken))
|
||||||
{
|
{
|
||||||
if (String.IsNullOrWhiteSpace(phoneNumber))
|
if (String.IsNullOrWhiteSpace(phoneNumber))
|
||||||
throw new ArgumentNullException(nameof(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);
|
await RequestWithDcMigration(request, token).ConfigureAwait(false);
|
||||||
|
|
||||||
return request.Response.PhoneCodeHash;
|
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))
|
if (String.IsNullOrWhiteSpace(phoneNumber))
|
||||||
throw new ArgumentNullException(nameof(phoneNumber));
|
throw new ArgumentNullException(nameof(phoneNumber));
|
||||||
|
|
@ -231,48 +222,18 @@ namespace TgSharp.Core
|
||||||
|
|
||||||
await RequestWithDcMigration(request, token).ConfigureAwait(false);
|
await RequestWithDcMigration(request, token).ConfigureAwait(false);
|
||||||
|
|
||||||
OnUserAuthenticated(((TLUser)request.Response.User));
|
if (request.Response is TLAuthorization)
|
||||||
|
|
||||||
return ((TLUser)request.Response.User);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<TLPassword> GetPasswordSetting(CancellationToken token = default(CancellationToken))
|
|
||||||
{
|
{
|
||||||
var request = new TLRequestGetPassword();
|
OnUserAuthenticated(((TLUser)((TLAuthorization)request.Response).User));
|
||||||
|
return ((TLUser)((TLAuthorization)request.Response).User);
|
||||||
await RequestWithDcMigration(request, token).ConfigureAwait(false);
|
|
||||||
|
|
||||||
return (TLPassword)request.Response;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public async Task<TLUser> MakeAuthWithPasswordAsync(TLPassword password, string password_str, CancellationToken token = default(CancellationToken))
|
|
||||||
{
|
{
|
||||||
token.ThrowIfCancellationRequested();
|
var signUpRequest = new TLRequestSignUp() { PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash, FirstName = firstName, LastName = lastName };
|
||||||
|
await RequestWithDcMigration(signUpRequest, token).ConfigureAwait(false);
|
||||||
byte[] password_Bytes = Encoding.UTF8.GetBytes(password_str);
|
OnUserAuthenticated((TLUser)signUpRequest.Response.User);
|
||||||
IEnumerable<byte> rv = password.CurrentSalt.Concat(password_Bytes).Concat(password.CurrentSalt);
|
return (TLUser)signUpRequest.Response.User;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<T> SendRequestAsync<T>(TLMethod methodToExecute, CancellationToken token = default(CancellationToken))
|
public async Task<T> SendRequestAsync<T>(TLMethod methodToExecute, CancellationToken token = default(CancellationToken))
|
||||||
|
|
@ -325,17 +286,9 @@ namespace TgSharp.Core
|
||||||
.ConfigureAwait(false);
|
.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))
|
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)
|
return await SendAuthenticatedRequestAsync<TLContacts>(req, token)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
@ -380,21 +333,21 @@ namespace TgSharp.Core
|
||||||
.ConfigureAwait(false);
|
.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()
|
return await SendAuthenticatedRequestAsync<TLAbsUpdates>(new TLRequestSendMedia()
|
||||||
{
|
{
|
||||||
RandomId = Helpers.GenerateRandomLong(),
|
RandomId = Helpers.GenerateRandomLong(),
|
||||||
Background = false,
|
Background = false,
|
||||||
ClearDraft = false,
|
ClearDraft = false,
|
||||||
Media = new TLInputMediaUploadedPhoto() { File = file, Caption = caption },
|
Media = new TLInputMediaUploadedPhoto() { File = file },
|
||||||
Peer = peer
|
Peer = peer
|
||||||
}, token)
|
}, token)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<TLAbsUpdates> SendUploadedDocument(
|
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()
|
return await SendAuthenticatedRequestAsync<TLAbsUpdates>(new TLRequestSendMedia()
|
||||||
{
|
{
|
||||||
|
|
@ -404,7 +357,6 @@ namespace TgSharp.Core
|
||||||
Media = new TLInputMediaUploadedDocument()
|
Media = new TLInputMediaUploadedDocument()
|
||||||
{
|
{
|
||||||
File = file,
|
File = file,
|
||||||
Caption = caption,
|
|
||||||
MimeType = mimeType,
|
MimeType = mimeType,
|
||||||
Attributes = attributes
|
Attributes = attributes
|
||||||
},
|
},
|
||||||
|
|
@ -455,7 +407,7 @@ namespace TgSharp.Core
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<TLFound> SearchUserAsync(string q, int limit = 10, CancellationToken token = default(CancellationToken))
|
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,
|
Q = q,
|
||||||
Limit = limit
|
Limit = limit
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\TeleSharp.TL\TeleSharp.TL.csproj">
|
<ProjectReference Include="..\TgSharp.TL\TgSharp.TL.csproj">
|
||||||
<Project>{d6144517-91d2-4880-86df-e9ff5d7f383a}</Project>
|
<Project>{d6144517-91d2-4880-86df-e9ff5d7f383a}</Project>
|
||||||
<Name>TeleSharp.TL</Name>
|
<Name>TeleSharp.TL</Name>
|
||||||
</ProjectReference>
|
</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>
|
<copyright>Copyright 2015-2020</copyright>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<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>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,9 @@ using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
using TeleSharp.TL.Upload;
|
using TgSharp.TL;
|
||||||
|
using TgSharp.TL.Upload;
|
||||||
|
|
||||||
namespace TgSharp.Core.Utils
|
namespace TgSharp.Core.Utils
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
|
|
||||||
namespace /* NAMESPACE */
|
namespace /* NAMESPACE */
|
||||||
{
|
{
|
||||||
[TLObject(/*Constructor*/)]
|
[TLObject(/*Constructor*/)]
|
||||||
|
|
@ -4,7 +4,9 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
|
|
||||||
namespace /* NAMESPACE */
|
namespace /* NAMESPACE */
|
||||||
{
|
{
|
||||||
public abstract class /* NAME */ : TLObject
|
public abstract class /* NAME */ : TLObject
|
||||||
|
|
@ -4,7 +4,9 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
|
using TgSharp.TL;
|
||||||
|
|
||||||
namespace /* NAMESPACE */
|
namespace /* NAMESPACE */
|
||||||
{
|
{
|
||||||
[TLObject(/*Constructor*/)]
|
[TLObject(/*Constructor*/)]
|
||||||
|
|
@ -35,6 +37,7 @@ namespace /* NAMESPACE */
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
/* SERIALIZE */
|
/* SERIALIZE */
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
/* DESERIALIZEResp */
|
/* DESERIALIZEResp */
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace TeleSharp.Generator.Models
|
namespace TgSharp.Generator.Models
|
||||||
{
|
{
|
||||||
internal class TlConstructor
|
internal class Constructor
|
||||||
{
|
{
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
@ -12,7 +13,7 @@ namespace TeleSharp.Generator.Models
|
||||||
public string Predicate { get; set; }
|
public string Predicate { get; set; }
|
||||||
|
|
||||||
[JsonProperty("params")]
|
[JsonProperty("params")]
|
||||||
public List<TlParam> Params { get; set; }
|
public List<Param> Params { get; set; }
|
||||||
|
|
||||||
[JsonProperty("type")]
|
[JsonProperty("type")]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
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")]
|
[JsonProperty("id")]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
@ -12,7 +14,7 @@ namespace TeleSharp.Generator.Models
|
||||||
public string Method { get; set; }
|
public string Method { get; set; }
|
||||||
|
|
||||||
[JsonProperty("params")]
|
[JsonProperty("params")]
|
||||||
public List<TlParam> Params { get; set; }
|
public List<Param> Params { get; set; }
|
||||||
|
|
||||||
[JsonProperty("type")]
|
[JsonProperty("type")]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace TeleSharp.Generator.Models
|
namespace TgSharp.Generator.Models
|
||||||
{
|
{
|
||||||
internal class TlParam
|
internal class Param
|
||||||
{
|
{
|
||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
public string Name { get; set; }
|
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.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using TeleSharp.Generator.Models;
|
|
||||||
|
|
||||||
namespace TeleSharp.Generator
|
using TgSharp.Generator.Models;
|
||||||
|
|
||||||
|
namespace TgSharp.Generator
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
|
@ -17,6 +18,8 @@ namespace TeleSharp.Generator
|
||||||
static string constructorTemplate = "Constructor.tmp";
|
static string constructorTemplate = "Constructor.tmp";
|
||||||
static string methodTemplate = "Method.tmp";
|
static string methodTemplate = "Method.tmp";
|
||||||
|
|
||||||
|
static string rootNamespace = "TgSharp";
|
||||||
|
|
||||||
static List<string> templateFiles = new List<string> (new [] {
|
static List<string> templateFiles = new List<string> (new [] {
|
||||||
constructorAbsTemplate,
|
constructorAbsTemplate,
|
||||||
constructorTemplate,
|
constructorTemplate,
|
||||||
|
|
@ -88,7 +91,7 @@ namespace TeleSharp.Generator
|
||||||
}
|
}
|
||||||
FileStream file = File.OpenWrite("Result.cs");
|
FileStream file = File.OpenWrite("Result.cs");
|
||||||
StreamWriter sw = new StreamWriter(file);
|
StreamWriter sw = new StreamWriter(file);
|
||||||
TlSchema schema = JsonConvert.DeserializeObject<TlSchema>(Json);
|
Schema schema = JsonConvert.DeserializeObject<Schema>(Json);
|
||||||
foreach (var c in schema.Constructors)
|
foreach (var c in schema.Constructors)
|
||||||
{
|
{
|
||||||
interfacesList.Add(c.Type);
|
interfacesList.Add(c.Type);
|
||||||
|
|
@ -101,7 +104,7 @@ namespace TeleSharp.Generator
|
||||||
{
|
{
|
||||||
string path =
|
string path =
|
||||||
(GetNameSpace(c.Type)
|
(GetNameSpace(c.Type)
|
||||||
.Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar)
|
.Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar)
|
||||||
.Replace(".", "") + Path.DirectorySeparatorChar +
|
.Replace(".", "") + Path.DirectorySeparatorChar +
|
||||||
GetNameofClass(c.Type, true) + ".cs")
|
GetNameofClass(c.Type, true) + ".cs")
|
||||||
.Replace("\\\\", Path.DirectorySeparatorChar.ToString());
|
.Replace("\\\\", Path.DirectorySeparatorChar.ToString());
|
||||||
|
|
@ -110,13 +113,13 @@ namespace TeleSharp.Generator
|
||||||
{
|
{
|
||||||
string nspace =
|
string nspace =
|
||||||
(GetNameSpace(c.Type)
|
(GetNameSpace(c.Type)
|
||||||
.Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar)
|
.Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar)
|
||||||
.Replace(".", ""))
|
.Replace(".", ""))
|
||||||
.Replace("\\\\", Path.DirectorySeparatorChar.ToString())
|
.Replace("\\\\", Path.DirectorySeparatorChar.ToString())
|
||||||
.Replace(Path.DirectorySeparatorChar, '.');
|
.Replace(Path.DirectorySeparatorChar, '.');
|
||||||
if (nspace.EndsWith("."))
|
if (nspace.EndsWith("."))
|
||||||
nspace = nspace.Remove(nspace.Length - 1, 1);
|
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));
|
temp = temp.Replace("/* NAME */", GetNameofClass(c.Type, true));
|
||||||
writer.Write(temp);
|
writer.Write(temp);
|
||||||
writer.Close();
|
writer.Close();
|
||||||
|
|
@ -133,7 +136,7 @@ namespace TeleSharp.Generator
|
||||||
{
|
{
|
||||||
string path =
|
string path =
|
||||||
(GetNameSpace(c.Predicate)
|
(GetNameSpace(c.Predicate)
|
||||||
.Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar)
|
.Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar)
|
||||||
.Replace(".", "") + Path.DirectorySeparatorChar +
|
.Replace(".", "") + Path.DirectorySeparatorChar +
|
||||||
GetNameofClass(c.Predicate, false) + ".cs")
|
GetNameofClass(c.Predicate, false) + ".cs")
|
||||||
.Replace("\\\\", Path.DirectorySeparatorChar.ToString());
|
.Replace("\\\\", Path.DirectorySeparatorChar.ToString());
|
||||||
|
|
@ -143,27 +146,35 @@ namespace TeleSharp.Generator
|
||||||
#region About Class
|
#region About Class
|
||||||
string nspace =
|
string nspace =
|
||||||
(GetNameSpace(c.Predicate)
|
(GetNameSpace(c.Predicate)
|
||||||
.Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar)
|
.Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar)
|
||||||
.Replace(".", ""))
|
.Replace(".", ""))
|
||||||
.Replace("\\\\", Path.DirectorySeparatorChar.ToString())
|
.Replace("\\\\", Path.DirectorySeparatorChar.ToString())
|
||||||
.Replace(Path.DirectorySeparatorChar, '.');
|
.Replace(Path.DirectorySeparatorChar, '.');
|
||||||
if (nspace.EndsWith("."))
|
if (nspace.EndsWith("."))
|
||||||
nspace = nspace.Remove(nspace.Length - 1, 1);
|
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 = (c.Type == "himself") ? temp.Replace("/* PARENT */", "TLObject") : temp.Replace("/* PARENT */", GetNameofClass(c.Type, true));
|
||||||
temp = temp.Replace("/*Constructor*/", c.Id.ToString());
|
temp = temp.Replace("/*Constructor*/", c.Id.ToString());
|
||||||
temp = temp.Replace("/* NAME */", GetNameofClass(c.Predicate, false));
|
temp = temp.Replace("/* NAME */", GetNameofClass(c.Predicate, false));
|
||||||
#endregion
|
#endregion
|
||||||
#region Fields
|
#region Fields
|
||||||
string fields = "";
|
string fields = String.Empty;
|
||||||
|
bool first = true;
|
||||||
foreach (var tmp in c.Params)
|
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);
|
temp = temp.Replace("/* PARAMS */", fields);
|
||||||
#endregion
|
#endregion
|
||||||
#region ComputeFlagFunc
|
#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
|
else
|
||||||
{
|
{
|
||||||
var compute = "Flags = 0;" + Environment.NewLine;
|
var compute = "Flags = 0;" + Environment.NewLine;
|
||||||
|
|
@ -182,22 +193,45 @@ namespace TeleSharp.Generator
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region SerializeFunc
|
#region SerializeFunc
|
||||||
var serialize = "";
|
var serialize = String.Empty;
|
||||||
|
first = true;
|
||||||
if (c.Params.Any(x => x.Name == "Flags")) serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(Flags);" + Environment.NewLine;
|
if (c.Params.Any (x => x.Name == "Flags")) {
|
||||||
|
serialize += "ComputeFlags();" +
|
||||||
|
Environment.NewLine + " " +
|
||||||
|
"bw.Write(Flags);";
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
foreach (var p in c.Params.Where(x => x.Name != "Flags"))
|
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);
|
temp = temp.Replace("/* SERIALIZE */", serialize);
|
||||||
#endregion
|
#endregion
|
||||||
#region DeSerializeFunc
|
#region DeSerializeFunc
|
||||||
var deserialize = "";
|
var deserialize = String.Empty;
|
||||||
|
first = true;
|
||||||
foreach (var p in c.Params)
|
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);
|
temp = temp.Replace("/* DESERIALIZE */", deserialize);
|
||||||
#endregion
|
#endregion
|
||||||
writer.Write(temp);
|
writer.Write(temp);
|
||||||
|
|
@ -209,7 +243,7 @@ namespace TeleSharp.Generator
|
||||||
{
|
{
|
||||||
string path =
|
string path =
|
||||||
(GetNameSpace(c.Method)
|
(GetNameSpace(c.Method)
|
||||||
.Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar)
|
.Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar)
|
||||||
.Replace(".", "") + Path.DirectorySeparatorChar +
|
.Replace(".", "") + Path.DirectorySeparatorChar +
|
||||||
GetNameofClass(c.Method, false, true) + ".cs")
|
GetNameofClass(c.Method, false, true) + ".cs")
|
||||||
.Replace("\\\\", Path.DirectorySeparatorChar.ToString());
|
.Replace("\\\\", Path.DirectorySeparatorChar.ToString());
|
||||||
|
|
@ -219,28 +253,39 @@ namespace TeleSharp.Generator
|
||||||
#region About Class
|
#region About Class
|
||||||
string nspace =
|
string nspace =
|
||||||
(GetNameSpace(c.Method)
|
(GetNameSpace(c.Method)
|
||||||
.Replace("TeleSharp.TL", "TL" + Path.DirectorySeparatorChar)
|
.Replace(rootNamespace + ".TL", "TL" + Path.DirectorySeparatorChar)
|
||||||
.Replace(".", ""))
|
.Replace(".", ""))
|
||||||
.Replace("\\\\", Path.DirectorySeparatorChar.ToString())
|
.Replace("\\\\", Path.DirectorySeparatorChar.ToString())
|
||||||
.Replace(Path.DirectorySeparatorChar, '.');
|
.Replace(Path.DirectorySeparatorChar, '.');
|
||||||
if (nspace.EndsWith("."))
|
if (nspace.EndsWith("."))
|
||||||
nspace = nspace.Remove(nspace.Length - 1, 1);
|
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("/* PARENT */", "TLMethod");
|
||||||
temp = temp.Replace("/*Constructor*/", c.Id.ToString());
|
temp = temp.Replace("/*Constructor*/", c.Id.ToString());
|
||||||
temp = temp.Replace("/* NAME */", GetNameofClass(c.Method, false, true));
|
temp = temp.Replace("/* NAME */", GetNameofClass(c.Method, false, true));
|
||||||
#endregion
|
#endregion
|
||||||
#region Fields
|
#region Fields
|
||||||
string fields = "";
|
string fields = "";
|
||||||
|
bool first = true;
|
||||||
foreach (var tmp in c.Params)
|
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(c.Type, GetTypeName(c.Type))} Response" + "{ get; set;}" + Environment.NewLine;
|
fields += $"public {CheckForFlagBase(tmp.Type, GetTypeName(tmp.Type))} {CheckForKeywordAndPascalCase(tmp.Name)}" + " { get; set; }";
|
||||||
|
}
|
||||||
|
if (!first) {
|
||||||
|
fields += Environment.NewLine + " ";
|
||||||
|
} else {
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
fields += $"public {CheckForFlagBase(c.Type, GetTypeName(c.Type))} Response" + " { get; set; }";
|
||||||
temp = temp.Replace("/* PARAMS */", fields);
|
temp = temp.Replace("/* PARAMS */", fields);
|
||||||
#endregion
|
#endregion
|
||||||
#region ComputeFlagFunc
|
#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
|
else
|
||||||
{
|
{
|
||||||
var compute = "Flags = 0;" + Environment.NewLine;
|
var compute = "Flags = 0;" + Environment.NewLine;
|
||||||
|
|
@ -259,28 +304,50 @@ namespace TeleSharp.Generator
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region SerializeFunc
|
#region SerializeFunc
|
||||||
var serialize = "";
|
var serialize = String.Empty;
|
||||||
|
first = true;
|
||||||
if (c.Params.Any(x => x.Name == "Flags")) serialize += "ComputeFlags();" + Environment.NewLine + "bw.Write(Flags);" + Environment.NewLine;
|
if (c.Params.Any (x => x.Name == "Flags")) {
|
||||||
|
serialize += "ComputeFlags();" + Environment.NewLine +
|
||||||
|
" " + "bw.Write(Flags);";
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
foreach (var p in c.Params.Where(x => x.Name != "Flags"))
|
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);
|
temp = temp.Replace("/* SERIALIZE */", serialize);
|
||||||
#endregion
|
#endregion
|
||||||
#region DeSerializeFunc
|
#region DeSerializeFunc
|
||||||
var deserialize = "";
|
var deserialize = String.Empty;
|
||||||
|
first = true;
|
||||||
foreach (var p in c.Params)
|
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);
|
temp = temp.Replace("/* DESERIALIZE */", deserialize);
|
||||||
#endregion
|
#endregion
|
||||||
#region DeSerializeRespFunc
|
#region DeSerializeRespFunc
|
||||||
var deserializeResp = "";
|
var deserializeResp = "";
|
||||||
TlParam p2 = new TlParam() { Name = "Response", Type = c.Type };
|
var p2 = new Param() { Name = "Response", Type = c.Type };
|
||||||
deserializeResp += WriteReadCode(p2) + Environment.NewLine;
|
deserializeResp += WriteReadCode(p2);
|
||||||
temp = temp.Replace("/* DESERIALIZEResp */", deserializeResp);
|
temp = temp.Replace("/* DESERIALIZEResp */", deserializeResp);
|
||||||
#endregion
|
#endregion
|
||||||
writer.Write(temp);
|
writer.Write(temp);
|
||||||
|
|
@ -289,6 +356,7 @@ namespace TeleSharp.Generator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string FormatName(string input)
|
public static string FormatName(string input)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(input))
|
if (string.IsNullOrEmpty(input))
|
||||||
|
|
@ -305,6 +373,7 @@ namespace TeleSharp.Generator
|
||||||
}
|
}
|
||||||
return input.First().ToString().ToUpper() + input.Substring(1);
|
return input.First().ToString().ToUpper() + input.Substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string CheckForKeywordAndPascalCase(string name)
|
public static string CheckForKeywordAndPascalCase(string name)
|
||||||
{
|
{
|
||||||
name = name.Replace("_", " ");
|
name = name.Replace("_", " ");
|
||||||
|
|
@ -314,6 +383,7 @@ namespace TeleSharp.Generator
|
||||||
if (keywords.Contains(name)) return "@" + name;
|
if (keywords.Contains(name)) return "@" + name;
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetNameofClass(string type, bool isinterface = false, bool ismethod = false)
|
public static string GetNameofClass(string type, bool isinterface = false, bool ismethod = false)
|
||||||
{
|
{
|
||||||
if (!ismethod)
|
if (!ismethod)
|
||||||
|
|
@ -335,25 +405,31 @@ namespace TeleSharp.Generator
|
||||||
return "TLRequest" + FormatName(type);
|
return "TLRequest" + FormatName(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsFlagBase(string type)
|
private static bool IsFlagBase(string type)
|
||||||
{
|
{
|
||||||
return type.IndexOf("?") != -1;
|
return type.IndexOf("?") != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int GetBitMask(string type)
|
private static int GetBitMask(string type)
|
||||||
{
|
{
|
||||||
return (int)Math.Pow((double)2, (double)int.Parse(type.Split('?')[0].Split('.')[1]));
|
return (int)Math.Pow((double)2, (double)int.Parse(type.Split('?')[0].Split('.')[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsTrueFlag(string type)
|
private static bool IsTrueFlag(string type)
|
||||||
{
|
{
|
||||||
return type.Split('?')[1] == "true";
|
return type.Split('?')[1] == "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetNameSpace(string type)
|
public static string GetNameSpace(string type)
|
||||||
{
|
{
|
||||||
|
var baseNamespace = rootNamespace + ".TL";
|
||||||
if (type.IndexOf('.') != -1)
|
if (type.IndexOf('.') != -1)
|
||||||
return "TeleSharp.TL" + FormatName(type.Split('.')[0]);
|
return baseNamespace + FormatName(type.Split('.')[0]);
|
||||||
else
|
else
|
||||||
return "TeleSharp.TL";
|
return baseNamespace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string CheckForFlagBase(string type, string result)
|
public static string CheckForFlagBase(string type, string result)
|
||||||
{
|
{
|
||||||
if (type.IndexOf('?') == -1)
|
if (type.IndexOf('?') == -1)
|
||||||
|
|
@ -366,6 +442,7 @@ namespace TeleSharp.Generator
|
||||||
else return result;
|
else return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetTypeName(string type)
|
public static string GetTypeName(string type)
|
||||||
{
|
{
|
||||||
switch (type.ToLower())
|
switch (type.ToLower())
|
||||||
|
|
@ -401,7 +478,6 @@ namespace TeleSharp.Generator
|
||||||
|
|
||||||
if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1)
|
if (type.IndexOf('.') != -1 && type.IndexOf('?') == -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (interfacesList.Any(x => x.ToLower() == (type).ToLower()))
|
if (interfacesList.Any(x => x.ToLower() == (type).ToLower()))
|
||||||
return FormatName(type.Split('.')[0]) + "." + "TLAbs" + type.Split('.')[1];
|
return FormatName(type.Split('.')[0]) + "." + "TLAbs" + type.Split('.')[1];
|
||||||
else if (classesList.Any(x => x.ToLower() == (type).ToLower()))
|
else if (classesList.Any(x => x.ToLower() == (type).ToLower()))
|
||||||
|
|
@ -422,9 +498,8 @@ namespace TeleSharp.Generator
|
||||||
{
|
{
|
||||||
return GetTypeName(type.Split('?')[1]);
|
return GetTypeName(type.Split('?')[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string LookTypeInLists(string src)
|
public static string LookTypeInLists(string src)
|
||||||
{
|
{
|
||||||
if (interfacesList.Any(x => x.ToLower() == src.ToLower()))
|
if (interfacesList.Any(x => x.ToLower() == src.ToLower()))
|
||||||
|
|
@ -434,7 +509,8 @@ namespace TeleSharp.Generator
|
||||||
else
|
else
|
||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
public static string WriteWriteCode(TlParam p, bool flag = false)
|
|
||||||
|
public static string WriteWriteCode(Param p, bool flag = false)
|
||||||
{
|
{
|
||||||
switch (p.Type.ToLower())
|
switch (p.Type.ToLower())
|
||||||
{
|
{
|
||||||
|
|
@ -462,14 +538,15 @@ namespace TeleSharp.Generator
|
||||||
return $"";
|
return $"";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TlParam p2 = new TlParam() { Name = p.Name, Type = p.Type.Split('?')[1] };
|
Param p2 = new Param() { Name = p.Name, Type = p.Type.Split('?')[1] };
|
||||||
return $"if ((Flags & {GetBitMask(p.Type).ToString()}) != 0)" + Environment.NewLine +
|
return $"if ((Flags & {GetBitMask(p.Type).ToString()}) != 0)" +
|
||||||
|
Environment.NewLine + " " +
|
||||||
WriteWriteCode(p2, true);
|
WriteWriteCode(p2, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static string WriteReadCode(TlParam p)
|
public static string WriteReadCode(Param p)
|
||||||
{
|
{
|
||||||
switch (p.Type.ToLower())
|
switch (p.Type.ToLower())
|
||||||
{
|
{
|
||||||
|
|
@ -502,10 +579,11 @@ namespace TeleSharp.Generator
|
||||||
return $"{CheckForKeywordAndPascalCase(p.Name)} = (Flags & {GetBitMask(p.Type).ToString()}) != 0;";
|
return $"{CheckForKeywordAndPascalCase(p.Name)} = (Flags & {GetBitMask(p.Type).ToString()}) != 0;";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TlParam p2 = new TlParam() { Name = p.Name, Type = p.Type.Split('?')[1] };
|
Param p2 = new Param() { Name = p.Name, Type = p.Type.Split('?')[1] };
|
||||||
return $"if ((Flags & {GetBitMask(p.Type).ToString()}) != 0)" + Environment.NewLine +
|
return $"if ((Flags & {GetBitMask(p.Type).ToString()}) != 0)" +
|
||||||
WriteReadCode(p2) + Environment.NewLine +
|
Environment.NewLine + " " +
|
||||||
"else" + Environment.NewLine +
|
WriteReadCode(p2) + Environment.NewLine + " " +
|
||||||
|
"else" + Environment.NewLine + " " +
|
||||||
$"{CheckForKeywordAndPascalCase(p.Name)} = null;" + 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
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("TeleSharp.Generator")]
|
[assembly: AssemblyTitle("TgSharp.Generator")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("TeleSharp.Generator")]
|
[assembly: AssemblyProduct("TgSharp.Generator")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
<ProjectGuid>{9BE3B9D4-9FF6-4DC8-B9CC-EB2E3F390129}</ProjectGuid>
|
<ProjectGuid>{9BE3B9D4-9FF6-4DC8-B9CC-EB2E3F390129}</ProjectGuid>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>TeleSharp.Generator</RootNamespace>
|
<RootNamespace>TgSharp.Generator</RootNamespace>
|
||||||
<AssemblyName>TeleSharp.Generator</AssemblyName>
|
<AssemblyName>TgSharp.Generator</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
|
@ -48,12 +48,12 @@
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Models\TlMethod.cs" />
|
<Compile Include="Models\Function.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Models\TlConstructor.cs" />
|
<Compile Include="Models\Constructor.cs" />
|
||||||
<Compile Include="Models\TlParam.cs" />
|
<Compile Include="Models\Param.cs" />
|
||||||
<Compile Include="Models\TlSchema.cs" />
|
<Compile Include="Models\Schema.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
|
|
@ -5,8 +5,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using TeleSharp.TL;
|
namespace TgSharp.TL
|
||||||
namespace TeleSharp.TL
|
|
||||||
{
|
{
|
||||||
public class ObjectUtils
|
public class ObjectUtils
|
||||||
{
|
{
|
||||||
|
|
@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("TeleSharp.TL")]
|
[assembly: AssemblyTitle("TgSharp.TL")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("TeleSharp.TL")]
|
[assembly: AssemblyProduct("TgSharp.TL")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
@ -4,10 +4,12 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(307276766)]
|
[TLObject(307276766)]
|
||||||
public class TLAuthorizations : TLObject
|
public class TLAuthorizations : TLObject
|
||||||
|
|
@ -20,23 +22,20 @@ namespace TeleSharp.TL.Account
|
||||||
|
|
||||||
public TLVector<TLAuthorization> Authorizations { get; set; }
|
public TLVector<TLAuthorization> Authorizations { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Authorizations = (TLVector<TLAuthorization>)ObjectUtils.DeserializeVector<TLAuthorization>(br);
|
Authorizations = (TLVector<TLAuthorization>)ObjectUtils.DeserializeVector<TLAuthorization>(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
ObjectUtils.SerializeObject(Authorizations, bw);
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(-2122045747)]
|
[TLObject(1474462241)]
|
||||||
public class TLPeerSettings : TLObject
|
public class TLContentSettings : TLObject
|
||||||
{
|
{
|
||||||
public override int Constructor
|
public override int Constructor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return -2122045747;
|
return 1474462241;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Flags { get; set; }
|
public int Flags { get; set; }
|
||||||
public bool ReportSpam { get; set; }
|
public bool SensitiveEnabled { get; set; }
|
||||||
|
public bool SensitiveCanChange { get; set; }
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
Flags = 0;
|
// do nothing
|
||||||
Flags = ReportSpam ? (Flags | 1) : (Flags & ~1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Flags = br.ReadInt32();
|
Flags = br.ReadInt32();
|
||||||
ReportSpam = (Flags & 1) != 0;
|
SensitiveEnabled = (Flags & 1) != 0;
|
||||||
|
SensitiveCanChange = (Flags & 2) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
ComputeFlags();
|
|
||||||
bw.Write(Flags);
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
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 class TLPasswordInputSettings : TLObject
|
||||||
{
|
{
|
||||||
public override int Constructor
|
public override int Constructor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return -2037289493;
|
return -1036572727;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Flags { get; set; }
|
public int Flags { get; set; }
|
||||||
public byte[] NewSalt { get; set; }
|
public TLAbsPasswordKdfAlgo NewAlgo { get; set; }
|
||||||
public byte[] NewPasswordHash { get; set; }
|
public byte[] NewPasswordHash { get; set; }
|
||||||
public string Hint { get; set; }
|
public string Hint { get; set; }
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
|
public TLSecureSecretSettings NewSecureSettings { get; set; }
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
Flags = 0;
|
// do nothing
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Flags = br.ReadInt32();
|
Flags = br.ReadInt32();
|
||||||
if ((Flags & 1) != 0)
|
if ((Flags & 1) != 0)
|
||||||
NewSalt = BytesUtil.Deserialize(br);
|
NewAlgo = (TLAbsPasswordKdfAlgo)ObjectUtils.DeserializeObject(br);
|
||||||
else
|
else
|
||||||
NewSalt = null;
|
NewAlgo = null;
|
||||||
|
|
||||||
if ((Flags & 1) != 0)
|
if ((Flags & 1) != 0)
|
||||||
NewPasswordHash = BytesUtil.Deserialize(br);
|
NewPasswordHash = BytesUtil.Deserialize(br);
|
||||||
|
|
@ -58,23 +55,27 @@ namespace TeleSharp.TL.Account
|
||||||
else
|
else
|
||||||
Email = null;
|
Email = null;
|
||||||
|
|
||||||
|
if ((Flags & 4) != 0)
|
||||||
|
NewSecureSettings = (TLSecureSecretSettings)ObjectUtils.DeserializeObject(br);
|
||||||
|
else
|
||||||
|
NewSecureSettings = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
ComputeFlags();
|
|
||||||
bw.Write(Flags);
|
bw.Write(Flags);
|
||||||
if ((Flags & 1) != 0)
|
if ((Flags & 1) != 0)
|
||||||
BytesUtil.Serialize(NewSalt, bw);
|
ObjectUtils.SerializeObject(NewAlgo, bw);
|
||||||
if ((Flags & 1) != 0)
|
if ((Flags & 1) != 0)
|
||||||
BytesUtil.Serialize(NewPasswordHash, bw);
|
BytesUtil.Serialize(NewPasswordHash, bw);
|
||||||
if ((Flags & 1) != 0)
|
if ((Flags & 1) != 0)
|
||||||
StringUtil.Serialize(Hint, bw);
|
StringUtil.Serialize(Hint, bw);
|
||||||
if ((Flags & 2) != 0)
|
if ((Flags & 2) != 0)
|
||||||
StringUtil.Serialize(Email, bw);
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
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 class TLPrivacyRules : TLObject
|
||||||
{
|
{
|
||||||
public override int Constructor
|
public override int Constructor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return 1430961007;
|
return 1352683077;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TLVector<TLAbsPrivacyRule> Rules { get; set; }
|
public TLVector<TLAbsPrivacyRule> Rules { get; set; }
|
||||||
|
public TLVector<TLAbsChat> Chats { get; set; }
|
||||||
public TLVector<TLAbsUser> Users { get; set; }
|
public TLVector<TLAbsUser> Users { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Rules = (TLVector<TLAbsPrivacyRule>)ObjectUtils.DeserializeVector<TLAbsPrivacyRule>(br);
|
Rules = (TLVector<TLAbsPrivacyRule>)ObjectUtils.DeserializeVector<TLAbsPrivacyRule>(br);
|
||||||
|
Chats = (TLVector<TLAbsChat>)ObjectUtils.DeserializeVector<TLAbsChat>(br);
|
||||||
Users = (TLVector<TLAbsUser>)ObjectUtils.DeserializeVector<TLAbsUser>(br);
|
Users = (TLVector<TLAbsUser>)ObjectUtils.DeserializeVector<TLAbsUser>(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
ObjectUtils.SerializeObject(Rules, bw);
|
ObjectUtils.SerializeObject(Rules, bw);
|
||||||
|
ObjectUtils.SerializeObject(Chats, bw);
|
||||||
ObjectUtils.SerializeObject(Users, 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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(1891839707)]
|
[TLObject(1891839707)]
|
||||||
public class TLRequestChangePhone : TLMethod
|
public class TLRequestChangePhone : TLMethod
|
||||||
|
|
@ -23,10 +25,9 @@ namespace TeleSharp.TL.Account
|
||||||
public string PhoneCode { get; set; }
|
public string PhoneCode { get; set; }
|
||||||
public TLAbsUser Response { get; set; }
|
public TLAbsUser Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
|
|
@ -34,7 +35,6 @@ namespace TeleSharp.TL.Account
|
||||||
PhoneNumber = StringUtil.Deserialize(br);
|
PhoneNumber = StringUtil.Deserialize(br);
|
||||||
PhoneCodeHash = StringUtil.Deserialize(br);
|
PhoneCodeHash = StringUtil.Deserialize(br);
|
||||||
PhoneCode = StringUtil.Deserialize(br);
|
PhoneCode = StringUtil.Deserialize(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
|
|
@ -43,12 +43,11 @@ namespace TeleSharp.TL.Account
|
||||||
StringUtil.Serialize(PhoneNumber, bw);
|
StringUtil.Serialize(PhoneNumber, bw);
|
||||||
StringUtil.Serialize(PhoneCodeHash, bw);
|
StringUtil.Serialize(PhoneCodeHash, bw);
|
||||||
StringUtil.Serialize(PhoneCode, bw);
|
StringUtil.Serialize(PhoneCode, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = (TLAbsUser)ObjectUtils.DeserializeObject(br);
|
Response = (TLAbsUser)ObjectUtils.DeserializeObject(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,8 +4,10 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(655677548)]
|
[TLObject(655677548)]
|
||||||
public class TLRequestCheckUsername : TLMethod
|
public class TLRequestCheckUsername : TLMethod
|
||||||
|
|
@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
public bool Response { get; set; }
|
public bool Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Username = StringUtil.Deserialize(br);
|
Username = StringUtil.Deserialize(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
StringUtil.Serialize(Username, bw);
|
StringUtil.Serialize(Username, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = BoolUtil.Deserialize(br);
|
Response = BoolUtil.Deserialize(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,48 +4,44 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(1669245048)]
|
[TLObject(-1881204448)]
|
||||||
public class TLRequestRegisterDevice : TLMethod
|
public class TLRequestConfirmPasswordEmail : TLMethod
|
||||||
{
|
{
|
||||||
public override int Constructor
|
public override int Constructor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return 1669245048;
|
return -1881204448;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int TokenType { get; set; }
|
public string Code { get; set; }
|
||||||
public string Token { get; set; }
|
|
||||||
public bool Response { get; set; }
|
public bool Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
TokenType = br.ReadInt32();
|
Code = StringUtil.Deserialize(br);
|
||||||
Token = StringUtil.Deserialize(br);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
bw.Write(TokenType);
|
StringUtil.Serialize(Code, bw);
|
||||||
StringUtil.Serialize(Token, bw);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = BoolUtil.Deserialize(br);
|
Response = BoolUtil.Deserialize(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,8 +4,10 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(1596029123)]
|
[TLObject(1596029123)]
|
||||||
public class TLRequestConfirmPhone : TLMethod
|
public class TLRequestConfirmPhone : TLMethod
|
||||||
|
|
@ -22,17 +24,15 @@ namespace TeleSharp.TL.Account
|
||||||
public string PhoneCode { get; set; }
|
public string PhoneCode { get; set; }
|
||||||
public bool Response { get; set; }
|
public bool Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
PhoneCodeHash = StringUtil.Deserialize(br);
|
PhoneCodeHash = StringUtil.Deserialize(br);
|
||||||
PhoneCode = StringUtil.Deserialize(br);
|
PhoneCode = StringUtil.Deserialize(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
|
|
@ -40,12 +40,11 @@ namespace TeleSharp.TL.Account
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
StringUtil.Serialize(PhoneCodeHash, bw);
|
StringUtil.Serialize(PhoneCodeHash, bw);
|
||||||
StringUtil.Serialize(PhoneCode, bw);
|
StringUtil.Serialize(PhoneCode, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = BoolUtil.Deserialize(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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(1099779595)]
|
[TLObject(1099779595)]
|
||||||
public class TLRequestDeleteAccount : TLMethod
|
public class TLRequestDeleteAccount : TLMethod
|
||||||
|
|
@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account
|
||||||
public string Reason { get; set; }
|
public string Reason { get; set; }
|
||||||
public bool Response { get; set; }
|
public bool Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Reason = StringUtil.Deserialize(br);
|
Reason = StringUtil.Deserialize(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
StringUtil.Serialize(Reason, bw);
|
StringUtil.Serialize(Reason, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = BoolUtil.Deserialize(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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(150761757)]
|
[TLObject(150761757)]
|
||||||
public class TLRequestGetAccountTTL : TLMethod
|
public class TLRequestGetAccountTTL : TLMethod
|
||||||
|
|
@ -20,26 +22,25 @@ namespace TeleSharp.TL.Account
|
||||||
|
|
||||||
public TLAccountDaysTTL Response { get; set; }
|
public TLAccountDaysTTL Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
|
// do nothing else
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = (TLAccountDaysTTL)ObjectUtils.DeserializeObject(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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(-484392616)]
|
[TLObject(-484392616)]
|
||||||
public class TLRequestGetAuthorizations : TLMethod
|
public class TLRequestGetAuthorizations : TLMethod
|
||||||
|
|
@ -20,26 +22,25 @@ namespace TeleSharp.TL.Account
|
||||||
|
|
||||||
public Account.TLAuthorizations Response { get; set; }
|
public Account.TLAuthorizations Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
|
// do nothing else
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = (Account.TLAuthorizations)ObjectUtils.DeserializeObject(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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(313765169)]
|
[TLObject(313765169)]
|
||||||
public class TLRequestGetNotifySettings : TLMethod
|
public class TLRequestGetNotifySettings : TLMethod
|
||||||
|
|
@ -19,30 +21,27 @@ namespace TeleSharp.TL.Account
|
||||||
}
|
}
|
||||||
|
|
||||||
public TLAbsInputNotifyPeer Peer { get; set; }
|
public TLAbsInputNotifyPeer Peer { get; set; }
|
||||||
public TLAbsPeerNotifySettings Response { get; set; }
|
public TLPeerNotifySettings Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br);
|
Peer = (TLAbsInputNotifyPeer)ObjectUtils.DeserializeObject(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
ObjectUtils.SerializeObject(Peer, bw);
|
ObjectUtils.SerializeObject(Peer, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(1418342645)]
|
[TLObject(1418342645)]
|
||||||
public class TLRequestGetPassword : TLMethod
|
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()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
|
// do nothing else
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
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 class TLRequestGetPasswordSettings : TLMethod
|
||||||
{
|
{
|
||||||
public override int Constructor
|
public override int Constructor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return -1131605573;
|
return -1663767815;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] CurrentPasswordHash { get; set; }
|
public TLAbsInputCheckPasswordSRP Password { get; set; }
|
||||||
public Account.TLPasswordSettings Response { get; set; }
|
public Account.TLPasswordSettings Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
CurrentPasswordHash = BytesUtil.Deserialize(br);
|
Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
BytesUtil.Serialize(CurrentPasswordHash, bw);
|
ObjectUtils.SerializeObject(Password, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = (Account.TLPasswordSettings)ObjectUtils.DeserializeObject(br);
|
Response = (Account.TLPasswordSettings)ObjectUtils.DeserializeObject(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,8 +4,10 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TeleSharp.TL;
|
|
||||||
namespace TeleSharp.TL.Account
|
using TgSharp.TL;
|
||||||
|
|
||||||
|
namespace TgSharp.TL.Account
|
||||||
{
|
{
|
||||||
[TLObject(-623130288)]
|
[TLObject(-623130288)]
|
||||||
public class TLRequestGetPrivacy : TLMethod
|
public class TLRequestGetPrivacy : TLMethod
|
||||||
|
|
@ -21,28 +23,25 @@ namespace TeleSharp.TL.Account
|
||||||
public TLAbsInputPrivacyKey Key { get; set; }
|
public TLAbsInputPrivacyKey Key { get; set; }
|
||||||
public Account.TLPrivacyRules Response { get; set; }
|
public Account.TLPrivacyRules Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
Key = (TLAbsInputPrivacyKey)ObjectUtils.DeserializeObject(br);
|
Key = (TLAbsInputPrivacyKey)ObjectUtils.DeserializeObject(br);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
ObjectUtils.SerializeObject(Key, bw);
|
ObjectUtils.SerializeObject(Key, bw);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = (Account.TLPrivacyRules)ObjectUtils.DeserializeObject(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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
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 class TLRequestGetTmpPassword : TLMethod
|
||||||
{
|
{
|
||||||
public override int Constructor
|
public override int Constructor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return 1250046590;
|
return 1151208273;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] PasswordHash { get; set; }
|
public TLAbsInputCheckPasswordSRP Password { get; set; }
|
||||||
public int Period { get; set; }
|
public int Period { get; set; }
|
||||||
public Account.TLTmpPassword Response { get; set; }
|
public Account.TLTmpPassword Response { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public void ComputeFlags()
|
public void ComputeFlags()
|
||||||
{
|
{
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeBody(BinaryReader br)
|
public override void DeserializeBody(BinaryReader br)
|
||||||
{
|
{
|
||||||
PasswordHash = BytesUtil.Deserialize(br);
|
Password = (TLAbsInputCheckPasswordSRP)ObjectUtils.DeserializeObject(br);
|
||||||
Period = br.ReadInt32();
|
Period = br.ReadInt32();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SerializeBody(BinaryWriter bw)
|
public override void SerializeBody(BinaryWriter bw)
|
||||||
{
|
{
|
||||||
bw.Write(Constructor);
|
bw.Write(Constructor);
|
||||||
BytesUtil.Serialize(PasswordHash, bw);
|
ObjectUtils.SerializeObject(Password, bw);
|
||||||
bw.Write(Period);
|
bw.Write(Period);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DeserializeResponse(BinaryReader br)
|
public override void DeserializeResponse(BinaryReader br)
|
||||||
{
|
{
|
||||||
Response = (Account.TLTmpPassword)ObjectUtils.DeserializeObject(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