예제 #1
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            Peer.ToStream(output);

            TopMessageId = TopMessageId ?? new TLInt(0);
            TopMessageId.ToStream(output);

            ReadInboxMaxId = ReadInboxMaxId ?? new TLInt(0);
            ReadInboxMaxId.ToStream(output);

            output.Write(UnreadCount.ToBytes());

            NotifySettings.NullableToStream(output);

            TopMessageRandomId = TopMessageRandomId ?? new TLLong(0);
            TopMessageRandomId.ToStream(output);

            With.NullableToStream(output);
            if (Messages != null)
            {
                var messages = new TLVector <TLMessageBase> {
                    Items = Messages
                };
                messages.ToStream(output);
            }
            else
            {
                var messages = new TLVector <TLMessageBase>();
                messages.ToStream(output);
            }
        }
예제 #2
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            Peer.ToStream(output);

            TopDecryptedMessageRandomId = TopDecryptedMessageRandomId ?? new TLLong(0);
            TopDecryptedMessageRandomId.ToStream(output);

            output.Write(UnreadCount.ToBytes());

            With.NullableToStream(output);

            if (Messages != null)
            {
                var messages = new TLVector <TLDecryptedMessageBase> {
                    Items = Messages
                };
                messages.ToStream(output);
            }
            else
            {
                var messages = new TLVector <TLDecryptedMessageBase>();
                messages.ToStream(output);
            }
        }