예제 #1
0
 public override void ToStream(Stream output)
 {
     output.Write(TLUtils.SignatureToBytes(Signature));
     Flags.ToStream(output);
     Pts.ToStream(output);
     ToStream(output, Timeout, Flags, (int)ChannelDifferenceFlags.Timeout);
     TopMessage.ToStream(output);
     ReadInboxMaxId.ToStream(output);
     ReadOutboxMaxId.ToStream(output);
     UnreadCount.ToStream(output);
     Messages.ToStream(output);
     Chats.ToStream(output);
     Users.ToStream(output);
 }
예제 #2
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            Peer.ToStream(output);

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

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

            output.Write(UnreadCount.ToBytes());
            output.Write(UnreadImportantCount.ToBytes());

            NotifySettings.NullableToStream(output);

            output.Write(Pts.ToBytes());

            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);
            }
        }