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.Messages
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
[TLObject(-923703407)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLRequestSendMedia : TLMethod
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return -923703407;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
public int Flags { get; set; }
|
|
|
|
|
public bool Silent { get; set; }
|
|
|
|
|
public bool Background { get; set; }
|
|
|
|
|
public bool ClearDraft { get; set; }
|
|
|
|
|
public TLAbsInputPeer Peer { get; set; }
|
|
|
|
|
public int? ReplyToMsgId { get; set; }
|
|
|
|
|
public TLAbsInputMedia Media { get; set; }
|
|
|
|
|
public long RandomId { get; set; }
|
|
|
|
|
public TLAbsReplyMarkup ReplyMarkup { get; set; }
|
2017-07-20 04:07:24 +02:00
|
|
|
public TLAbsUpdates Response { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = 0;
|
|
|
|
|
Flags = Silent ? (Flags | 32) : (Flags & ~32);
|
|
|
|
|
Flags = Background ? (Flags | 64) : (Flags & ~64);
|
|
|
|
|
Flags = ClearDraft ? (Flags | 128) : (Flags & ~128);
|
|
|
|
|
Flags = ReplyToMsgId != null ? (Flags | 1) : (Flags & ~1);
|
|
|
|
|
Flags = ReplyMarkup != null ? (Flags | 4) : (Flags & ~4);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
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 11:35:15 +01:00
|
|
|
Flags = br.ReadInt32();
|
|
|
|
|
Silent = (Flags & 32) != 0;
|
|
|
|
|
Background = (Flags & 64) != 0;
|
|
|
|
|
ClearDraft = (Flags & 128) != 0;
|
|
|
|
|
Peer = (TLAbsInputPeer)ObjectUtils.DeserializeObject(br);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
ReplyToMsgId = br.ReadInt32();
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
ReplyToMsgId = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
Media = (TLAbsInputMedia)ObjectUtils.DeserializeObject(br);
|
|
|
|
|
RandomId = br.ReadInt64();
|
|
|
|
|
if ((Flags & 4) != 0)
|
|
|
|
|
ReplyMarkup = (TLAbsReplyMarkup)ObjectUtils.DeserializeObject(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
ReplyMarkup = 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);
|
2016-09-24 15:38:26 +02:00
|
|
|
ComputeFlags();
|
2017-11-09 11:35:15 +01:00
|
|
|
bw.Write(Flags);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
ObjectUtils.SerializeObject(Peer, bw);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
bw.Write(ReplyToMsgId.Value);
|
|
|
|
|
ObjectUtils.SerializeObject(Media, bw);
|
|
|
|
|
bw.Write(RandomId);
|
|
|
|
|
if ((Flags & 4) != 0)
|
|
|
|
|
ObjectUtils.SerializeObject(ReplyMarkup, bw);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
}
|
2017-11-09 11:35:15 +01:00
|
|
|
public override void DeserializeResponse(BinaryReader br)
|
2017-07-20 04:07:24 +02:00
|
|
|
{
|
|
|
|
|
Response = (TLAbsUpdates)ObjectUtils.DeserializeObject(br);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
}
|
2016-09-24 15:38:26 +02:00
|
|
|
}
|
|
|
|
|
}
|