2016-09-24 15:38:26 +02:00
|
|
|
using 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
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
[TLObject(-2037289493)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLPasswordInputSettings : TLObject
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return -2037289493;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
public int Flags { get; set; }
|
|
|
|
|
public byte[] NewSalt { get; set; }
|
|
|
|
|
public byte[] NewPasswordHash { get; set; }
|
|
|
|
|
public string Hint { get; set; }
|
|
|
|
|
public string Email { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = 0;
|
|
|
|
|
Flags = NewSalt != null ? (Flags | 1) : (Flags & ~1);
|
|
|
|
|
Flags = NewPasswordHash != null ? (Flags | 1) : (Flags & ~1);
|
|
|
|
|
Flags = Hint != null ? (Flags | 1) : (Flags & ~1);
|
|
|
|
|
Flags = Email != null ? (Flags | 2) : (Flags & ~2);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
}
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
public override void DeserializeBody(BinaryReader br)
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = br.ReadInt32();
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
NewSalt = BytesUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
NewSalt = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
NewPasswordHash = BytesUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
NewPasswordHash = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
Hint = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Hint = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 2) != 0)
|
|
|
|
|
Email = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Email = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SerializeBody(BinaryWriter bw)
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
bw.Write(Constructor);
|
2016-09-24 15:38:26 +02:00
|
|
|
ComputeFlags();
|
2017-11-09 11:35:15 +01:00
|
|
|
bw.Write(Flags);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
BytesUtil.Serialize(NewSalt, bw);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
BytesUtil.Serialize(NewPasswordHash, bw);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
StringUtil.Serialize(Hint, bw);
|
|
|
|
|
if ((Flags & 2) != 0)
|
|
|
|
|
StringUtil.Serialize(Email, bw);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|