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> template <class ParserT>
void parse(AnimationSize &animation_size, ParserT &parser) { void parse(AnimationSize &animation_size, ParserT &parser) {
parse(static_cast<PhotoSize &>(animation_size), parser); parse(static_cast<PhotoSize &>(animation_size), parser);
if (parser.version() >= static_cast<int32>(Version::AddDialogPhotoHasAnimation)) {
parse(animation_size.main_frame_timestamp, parser); parse(animation_size.main_frame_timestamp, parser);
} else {
animation_size.main_frame_timestamp = 0;
}
} }
template <class StorerT> template <class StorerT>

View File

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