TLSharp/TeleSharp.TL/TL/Messages/TLRequestToggleDialogPin.cs

58 lines
1.3 KiB
C#
Raw Normal View History

2017-07-10 15:52:00 +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.Messages
{
2017-07-20 00:36:50 +02:00
[TLObject(847887978)]
2017-07-10 15:52:00 +02:00
public class TLRequestToggleDialogPin : TLMethod
{
public override int Constructor
{
get
{
return 847887978;
}
}
2017-07-20 00:36:50 +02:00
public int flags { get; set; }
public bool pinned { get; set; }
public TLAbsInputPeer peer { get; set; }
public bool Response { get; set; }
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
public void ComputeFlags()
{
flags = 0;
flags = pinned ? (flags | 1) : (flags & ~1);
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
}
2017-07-10 15:52:00 +02:00
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
2017-07-20 00:36:50 +02:00
pinned = (flags & 1) != 0;
peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br);
2017-07-10 15:52:00 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
2017-07-20 00:36:50 +02:00
bw.Write(Constructor);
2017-07-10 15:52:00 +02:00
ComputeFlags();
2017-07-20 00:36:50 +02:00
bw.Write(flags);
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
ObjectUtils.SerializeObject(peer, bw);
2017-07-10 15:52:00 +02:00
}
2017-07-20 00:36:50 +02:00
public override void deserializeResponse(BinaryReader br)
{
Response = BoolUtil.Deserialize(br);
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
}
2017-07-10 15:52:00 +02:00
}
}