예제 #1
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(RandomId.ToBytes());
            output.Write(TTL.ToBytes());
            //output.Write(RandomBytes.ToBytes());
            output.Write(Message.ToBytes());
            Media.ToStream(output);

            ChatId.NullableToStream(output);
            InputFile.NullableToStream(output);
            FromId.NullableToStream(output);
            Out.NullableToStream(output);
            Unread.NullableToStream(output);
            Date.NullableToStream(output);
            DeleteDate.NullableToStream(output);
            Qts.NullableToStream(output);

            var status = new TLInt((int)Status);

            output.Write(status.ToBytes());

            InSeqNo.NullableToStream(output);
            OutSeqNo.NullableToStream(output);
            CustomFlags.NullableToStream(output);
        }
예제 #2
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(Flags.ToBytes());
            output.Write(RandomId.ToBytes());
            output.Write(TTL.ToBytes());
            output.Write(Message.ToBytes());
            ToStream(output, Media, Flags, (int)MessageFlags.Media);
            ToStream(output, Entities, Flags, (int)MessageFlags.Entities);
            ToStream(output, ViaBotName, Flags, (int)MessageFlags.ViaBotId);
            ToStream(output, ReplyToRandomMsgId, Flags, (int)MessageFlags.ReplyToMsgId);

            ChatId.NullableToStream(output);
            InputFile.NullableToStream(output);
            FromId.NullableToStream(output);
            Out.NullableToStream(output);
            Unread.NullableToStream(output);
            Date.NullableToStream(output);
            DeleteDate.NullableToStream(output);
            Qts.NullableToStream(output);

            var status = new TLInt((int)Status);

            output.Write(status.ToBytes());

            InSeqNo.NullableToStream(output);
            OutSeqNo.NullableToStream(output);
            CustomFlags.NullableToStream(output);

            if (IsSet(CustomFlags, (int)MessageCustomFlags.BotInlineResult))
            {
                _inlineBotResult.ToStream(output);
            }
        }
예제 #3
0
 public override byte[] ToBytes()
 {
     return(TLUtils.Combine(
                TLUtils.SignatureToBytes(Signature),
                RandomId.ToBytes(),
                TTL.ToBytes(),
                Message.ToBytes(),
                Media.ToBytes()));
 }
예제 #4
0
        public override byte[] ToBytes()
        {
            System.Diagnostics.Debug.WriteLine("  <<TLDecryptedMessage17.ToBytes random_id={0} ttl={1} message={2} media=[{3}]", RandomId, TTL, Message, Media);

            return(TLUtils.Combine(
                       TLUtils.SignatureToBytes(Signature),
                       RandomId.ToBytes(),
                       TTL.ToBytes(),
                       Message.ToBytes(),
                       Media.ToBytes()));
        }
예제 #5
0
        public override byte[] ToBytes()
        {
            System.Diagnostics.Debug.WriteLine("  <<TLDecryptedMessage45.ToBytes random_id={0} ttl={1} message={2} media=[{3}]", RandomId, TTL, Message, Media);

            return(TLUtils.Combine(
                       TLUtils.SignatureToBytes(Signature),
                       Flags.ToBytes(),
                       RandomId.ToBytes(),
                       TTL.ToBytes(),
                       Message.ToBytes(),
                       ToBytes(Media, Flags, (int)MessageFlags.Media),
                       ToBytes(Entities, Flags, (int)MessageFlags.Entities),
                       ToBytes(ViaBotName, Flags, (int)MessageFlags.ViaBotId),
                       ToBytes(ReplyToRandomMsgId, Flags, (int)MessageFlags.ReplyToMsgId)));
        }