Fix AnimationSize parsing.

GitOrigin-RevId: 20806eb8cf947ffaaf9b0100ec7d9a8e03353535
This commit is contained in:
levlam 2020-07-27 17:52:21 +03:00
parent 9f18424e22
commit 41cac3edba
2 changed files with 11 additions and 7 deletions

View File

@ -95,7 +95,11 @@ void store(const AnimationSize &animation_size, StorerT &storer) {
template <class ParserT>
void parse(AnimationSize &animation_size, ParserT &parser) {
parse(static_cast<PhotoSize &>(animation_size), parser);
parse(animation_size.main_frame_timestamp, parser);
if (parser.version() >= static_cast<int32>(Version::AddDialogPhotoHasAnimation)) {
parse(animation_size.main_frame_timestamp, parser);
} else {
animation_size.main_frame_timestamp = 0;
}
}
template <class StorerT>

View File

@ -11,32 +11,32 @@ namespace td {
constexpr int32 MTPROTO_LAYER = 116;
enum class Version : int32 {
Initial,
Initial, // 0
StoreFileId,
AddKeyHashToSecretChat,
AddDurationToAnimation,
FixStoreGameWithoutAnimation,
AddAccessHashToSecretChat,
AddAccessHashToSecretChat, // 5
StoreFileOwnerId,
StoreFileEncryptionKey,
NetStatsCountDuration,
FixWebPageInstantViewDatabase,
FixMinUsers,
FixMinUsers, // 10
FixPageBlockAudioEmptyFile,
AddMessageInvoiceProviderData,
AddCaptionEntities,
AddVenueType,
AddTermsOfService,
AddTermsOfService, // 15
AddContactVcard,
AddMessageUnsupportedVersion,
SupportInstantView2_0,
AddNotificationGroupInfoMaxRemovedMessageId,
SupportMinithumbnails,
SupportMinithumbnails, // 20
AddVideoCallsSupport,
AddPhotoSizeSource,
AddFolders,
SupportPolls2_0,
AddDiceEmoji,
AddDiceEmoji, // 25
AddAnimationStickers,
AddDialogPhotoHasAnimation,
Next