TLSharp/TeleSharp.TL/TL/TLUpdateDialogPinned.cs

52 lines
1.1 KiB
C#
Raw Permalink Normal View History

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(-686710068)]
public class TLUpdateDialogPinned : TLAbsUpdate
{
public override int Constructor
{
get
{
return -686710068;
}
}
public int Flags { get; set; }
public bool Pinned { get; set; }
public TLAbsPeer Peer { get; set; }
public void ComputeFlags()
{
Flags = 0;
Flags = Pinned ? (Flags | 1) : (Flags & ~1);
}
public override void DeserializeBody(BinaryReader br)
{
Flags = br.ReadInt32();
Pinned = (Flags & 1) != 0;
Peer = (TLAbsPeer)ObjectUtils.DeserializeObject(br);
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
ComputeFlags();
bw.Write(Flags);
ObjectUtils.SerializeObject(Peer, bw);
}
}
}