From aed982365958e069946a672367c0ec127b2c9464 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 5 Jul 2023 15:40:08 +0300 Subject: [PATCH] Fix dup_story_content. --- td/telegram/MessageContent.cpp | 3 +++ td/telegram/StoryContent.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 09165bb71..68a343bc4 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -5172,6 +5172,9 @@ unique_ptr dup_message_content(Td *td, DialogId dialog_id, const } result->photo.photos.clear(); + result->photo.animations.clear(); + result->photo.sticker_photo_size = nullptr; + bool has_thumbnail = thumbnail.type != 0; if (has_thumbnail) { thumbnail.type = 't'; diff --git a/td/telegram/StoryContent.cpp b/td/telegram/StoryContent.cpp index 5efbf5a3b..6da05a353 100644 --- a/td/telegram/StoryContent.cpp +++ b/td/telegram/StoryContent.cpp @@ -446,7 +446,12 @@ unique_ptr dup_story_content(Td *td, const StoryContent *content) photo_size.type = 'i'; photo_size.file_id = fix_file_id(photo_size.file_id); - auto result = make_unique(); + auto result = make_unique(Photo(old_content->photo_)); + + result->photo_.photos.clear(); + result->photo_.animations.clear(); + result->photo_.sticker_photo_size = nullptr; + result->photo_.photos.push_back(std::move(photo_size)); return std::move(result); }