TLSharp/TeleSharp.TL/TL/TLUpdateServiceNotification.cs

70 lines
1.6 KiB
C#
Raw Normal View History

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
{
2017-07-10 15:52:00 +02:00
[TLObject(-337352679)]
2016-09-24 15:38:26 +02:00
public class TLUpdateServiceNotification : TLAbsUpdate
{
public override int Constructor
{
get
{
2017-07-10 15:52:00 +02:00
return -337352679;
2016-09-24 15:38:26 +02:00
}
}
2017-07-10 15:52:00 +02:00
public int flags {get;set;}
public bool popup {get;set;}
public int? inbox_date {get;set;}
public string type {get;set;}
2016-09-24 15:38:26 +02:00
public string message {get;set;}
public TLAbsMessageMedia media {get;set;}
2017-07-10 15:52:00 +02:00
public TLVector<TLAbsMessageEntity> entities {get;set;}
2016-09-24 15:38:26 +02:00
public void ComputeFlags()
{
2017-07-10 15:52:00 +02:00
flags = 0;
flags = popup ? (flags | 1) : (flags & ~1);
flags = inbox_date != null ? (flags | 2) : (flags & ~2);
2016-09-24 15:38:26 +02:00
}
public override void DeserializeBody(BinaryReader br)
{
2017-07-10 15:52:00 +02:00
flags = br.ReadInt32();
popup = (flags & 1) != 0;
if ((flags & 2) != 0)
inbox_date = br.ReadInt32();
else
inbox_date = null;
type = StringUtil.Deserialize(br);
2016-09-24 15:38:26 +02:00
message = StringUtil.Deserialize(br);
media = (TLAbsMessageMedia)ObjectUtils.DeserializeObject(br);
2017-07-10 15:52:00 +02:00
entities = (TLVector<TLAbsMessageEntity>)ObjectUtils.DeserializeVector<TLAbsMessageEntity>(br);
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
2017-07-10 15:52:00 +02:00
ComputeFlags();
bw.Write(flags);
if ((flags & 2) != 0)
bw.Write(inbox_date.Value);
StringUtil.Serialize(type,bw);
2016-09-24 15:38:26 +02:00
StringUtil.Serialize(message,bw);
ObjectUtils.SerializeObject(media,bw);
2017-07-10 15:52:00 +02:00
ObjectUtils.SerializeObject(entities,bw);
2016-09-24 15:38:26 +02:00
}
}
}