2017-07-20 04:07:24 +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
|
|
|
|
|
{
|
|
|
|
|
[TLObject(1355435489)]
|
|
|
|
|
public class TLPhoneCallDiscarded : TLAbsPhoneCall
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return 1355435489;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
public int Flags { get; set; }
|
|
|
|
|
public bool NeedRating { get; set; }
|
|
|
|
|
public bool NeedDebug { get; set; }
|
|
|
|
|
public long Id { get; set; }
|
|
|
|
|
public TLAbsPhoneCallDiscardReason Reason { get; set; }
|
|
|
|
|
public int? Duration { get; set; }
|
2017-07-20 04:07:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = 0;
|
|
|
|
|
Flags = NeedRating ? (Flags | 4) : (Flags & ~4);
|
|
|
|
|
Flags = NeedDebug ? (Flags | 8) : (Flags & ~8);
|
|
|
|
|
Flags = Reason != null ? (Flags | 1) : (Flags & ~1);
|
|
|
|
|
Flags = Duration != null ? (Flags | 2) : (Flags & ~2);
|
2017-07-20 04:07:24 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DeserializeBody(BinaryReader br)
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = br.ReadInt32();
|
|
|
|
|
NeedRating = (Flags & 4) != 0;
|
|
|
|
|
NeedDebug = (Flags & 8) != 0;
|
|
|
|
|
Id = br.ReadInt64();
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
Reason = (TLAbsPhoneCallDiscardReason)ObjectUtils.DeserializeObject(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Reason = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 2) != 0)
|
|
|
|
|
Duration = br.ReadInt32();
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Duration = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SerializeBody(BinaryWriter bw)
|
|
|
|
|
{
|
|
|
|
|
bw.Write(Constructor);
|
|
|
|
|
ComputeFlags();
|
2017-11-09 11:35:15 +01:00
|
|
|
bw.Write(Flags);
|
2017-07-20 04:07:24 +02:00
|
|
|
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
bw.Write(Id);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
ObjectUtils.SerializeObject(Reason, bw);
|
|
|
|
|
if ((Flags & 2) != 0)
|
|
|
|
|
bw.Write(Duration.Value);
|
2017-07-20 04:07:24 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|