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); }
public override void ToStream(Stream output) { try { output.Write(TLUtils.SignatureToBytes(Signature)); output.Write(Flags.ToBytes()); output.Write(Id.ToBytes()); output.Write(AccessHash.ToBytes()); output.Write(Title.ToBytes()); if (IsSet(Flags, (int)ChannelFlags.Public)) { UserName.ToStream(output); } Photo.ToStream(output); Date.ToStream(output); Version.ToStream(output); CustomFlags.NullableToStream(output); ParticipantIds.NullableToStream(output); About.NullableToStream(output); ParticipantsCount.NullableToStream(output); AdminsCount.NullableToStream(output); KickedCount.NullableToStream(output); ReadInboxMaxId.NullableToStream(output); Pts.NullableToStream(output); Participants.NullableToStream(output); NotifySettings.NullableToStream(output); if (IsSet(CustomFlags, (int)ChannelCustomFlags.MigratedFromChatId)) { _migratedFromChatId.ToStream(output); } if (IsSet(CustomFlags, (int)ChannelCustomFlags.MigratedFromMaxId)) { _migratedFromMaxId.ToStream(output); } } catch (Exception ex) { } }
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); } }