Improve PhotoSizeSource::parse.

This commit is contained in:
levlam 2023-08-28 20:55:52 +03:00
parent 0c0f0af52d
commit 43db9e4882

View File

@ -186,6 +186,17 @@ void PhotoSizeSource::store(StorerT &storer) const {
template <class ParserT>
void PhotoSizeSource::parse(ParserT &parser) {
td::parse(variant_, parser);
if (parser.get_error() == nullptr && parser.version() >= static_cast<int32>(Version::RemovePhotoVolumeAndLocalId)) {
switch (get_type("PhotoSizeSource::parse")) {
case Type::Legacy:
case Type::FullLegacy:
parser.set_error("Invalid photo size source stored");
break;
default:
// ok
break;
}
}
}
} // namespace td