2016-09-24 15:38:26 +02:00
|
|
|
using System.IO;
|
|
|
|
|
namespace TeleSharp.TL
|
|
|
|
|
{
|
2017-11-09 10:21:33 +01:00
|
|
|
[TLObject(-2114308294)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLInputMediaPhoto : TLAbsInputMedia
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2017-11-09 10:21:33 +01:00
|
|
|
return -2114308294;
|
2016-09-24 15:38:26 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 10:21:33 +01:00
|
|
|
public int flags { get; set; }
|
2017-07-20 04:07:24 +02:00
|
|
|
public TLAbsInputPhoto id { get; set; }
|
|
|
|
|
public string caption { get; set; }
|
2017-11-09 10:21:33 +01:00
|
|
|
public int? ttl_seconds { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
2017-11-09 10:21:33 +01:00
|
|
|
flags = 0;
|
|
|
|
|
flags = ttl_seconds != null ? (flags | 1) : (flags & ~1);
|
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 10:21:33 +01:00
|
|
|
flags = br.ReadInt32();
|
2016-09-24 15:38:26 +02:00
|
|
|
id = (TLAbsInputPhoto)ObjectUtils.DeserializeObject(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
caption = StringUtil.Deserialize(br);
|
2017-11-09 10:21:33 +01:00
|
|
|
if ((flags & 1) != 0)
|
|
|
|
|
ttl_seconds = br.ReadInt32();
|
|
|
|
|
else
|
|
|
|
|
ttl_seconds = 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);
|
2017-11-09 10:21:33 +01:00
|
|
|
ComputeFlags();
|
|
|
|
|
bw.Write(flags);
|
2017-07-20 04:07:24 +02:00
|
|
|
ObjectUtils.SerializeObject(id, bw);
|
|
|
|
|
StringUtil.Serialize(caption, bw);
|
2017-11-09 10:21:33 +01:00
|
|
|
if ((flags & 1) != 0)
|
|
|
|
|
bw.Write(ttl_seconds.Value);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|