UpdateChatParticipant.deserialize constructor
UpdateChatParticipant.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory UpdateChatParticipant.deserialize(BinaryReader reader) {
// Read [UpdateChatParticipant] fields.
final flags = reader.readInt32();
final chatId = reader.readInt64();
final date = reader.readDateTime();
final actorId = reader.readInt64();
final userId = reader.readInt64();
final hasPrevParticipantField = (flags & 1) != 0;
final prevParticipant = hasPrevParticipantField
? reader.readObject() as ChatParticipantBase
: null;
final hasNewParticipantField = (flags & 2) != 0;
final newParticipant = hasNewParticipantField
? reader.readObject() as ChatParticipantBase
: null;
final hasInviteField = (flags & 4) != 0;
final invite =
hasInviteField ? reader.readObject() as ExportedChatInviteBase : null;
final qts = reader.readInt32();
// Construct [UpdateChatParticipant] object.
final returnValue = UpdateChatParticipant(
chatId: chatId,
date: date,
actorId: actorId,
userId: userId,
prevParticipant: prevParticipant,
newParticipant: newParticipant,
invite: invite,
qts: qts,
);
// Now return the deserialized [UpdateChatParticipant].
return returnValue;
}