Fix dup_story_content.

This commit is contained in:
levlam 2023-07-05 15:40:08 +03:00
parent e3625824f9
commit aed9823659
2 changed files with 9 additions and 1 deletions

View File

@ -5172,6 +5172,9 @@ unique_ptr<MessageContent> 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';

View File

@ -446,7 +446,12 @@ unique_ptr<StoryContent> 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<StoryContentPhoto>();
auto result = make_unique<StoryContentPhoto>(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);
}