MessageMediaPhoto.deserialize constructor
MessageMediaPhoto.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory MessageMediaPhoto.deserialize(BinaryReader reader) {
// Read [MessageMediaPhoto] fields.
final flags = reader.readInt32();
final spoiler = (flags & 8) != 0;
final hasPhotoField = (flags & 1) != 0;
final photo = hasPhotoField ? reader.readObject() as PhotoBase : null;
final hasTtlSecondsField = (flags & 4) != 0;
final ttlSeconds = hasTtlSecondsField ? reader.readInt32() : null;
// Construct [MessageMediaPhoto] object.
final returnValue = MessageMediaPhoto(
spoiler: spoiler,
photo: photo,
ttlSeconds: ttlSeconds,
);
// Now return the deserialized [MessageMediaPhoto].
return returnValue;
}