Fix adding thumbnails to file_ids list.
GitOrigin-RevId: 880d7b1720050685b502925aa281c6de4945e1fb
This commit is contained in:
parent
eddaa5252c
commit
8edd3b3811
@ -84,10 +84,14 @@ UserId Game::get_bot_user_id() const {
|
|||||||
return bot_user_id_;
|
return bot_user_id_;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<FileId> Game::get_file_ids() const {
|
vector<FileId> Game::get_file_ids(const Td *td) const {
|
||||||
auto result = photo_get_file_ids(photo_);
|
auto result = photo_get_file_ids(photo_);
|
||||||
if (animation_file_id_.is_valid()) {
|
if (animation_file_id_.is_valid()) {
|
||||||
result.push_back(animation_file_id_);
|
result.push_back(animation_file_id_);
|
||||||
|
auto thumbnail_file_id = td->animations_manager_->get_animation_thumbnail_file_id(animation_file_id_);
|
||||||
|
if (thumbnail_file_id.is_valid()) {
|
||||||
|
result.push_back(thumbnail_file_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ class Game {
|
|||||||
|
|
||||||
UserId get_bot_user_id() const;
|
UserId get_bot_user_id() const;
|
||||||
|
|
||||||
vector<FileId> get_file_ids() const;
|
vector<FileId> get_file_ids(const Td *td) const;
|
||||||
|
|
||||||
void set_text(FormattedText &&text);
|
void set_text(FormattedText &&text);
|
||||||
|
|
||||||
|
@ -4639,7 +4639,7 @@ vector<FileId> get_message_content_file_ids(const MessageContent *content, const
|
|||||||
case MessageContentType::Sticker:
|
case MessageContentType::Sticker:
|
||||||
return td->stickers_manager_->get_sticker_file_ids(static_cast<const MessageSticker *>(content)->file_id);
|
return td->stickers_manager_->get_sticker_file_ids(static_cast<const MessageSticker *>(content)->file_id);
|
||||||
case MessageContentType::Game:
|
case MessageContentType::Game:
|
||||||
return static_cast<const MessageGame *>(content)->game.get_file_ids();
|
return static_cast<const MessageGame *>(content)->game.get_file_ids(td);
|
||||||
case MessageContentType::Invoice:
|
case MessageContentType::Invoice:
|
||||||
return photo_get_file_ids(static_cast<const MessageInvoice *>(content)->photo);
|
return photo_get_file_ids(static_cast<const MessageInvoice *>(content)->photo);
|
||||||
case MessageContentType::ChatChangePhoto:
|
case MessageContentType::ChatChangePhoto:
|
||||||
|
@ -3821,7 +3821,7 @@ void WebPagesManager::append_page_block_caption_file_ids(const PageBlockCaption
|
|||||||
append_rich_text_file_ids(caption.credit, file_ids);
|
append_rich_text_file_ids(caption.credit, file_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<FileId> WebPagesManager::get_web_page_file_ids(const WebPage *web_page) {
|
vector<FileId> WebPagesManager::get_web_page_file_ids(const WebPage *web_page) const {
|
||||||
if (web_page == nullptr) {
|
if (web_page == nullptr) {
|
||||||
return vector<FileId>();
|
return vector<FileId>();
|
||||||
}
|
}
|
||||||
@ -3829,6 +3829,30 @@ vector<FileId> WebPagesManager::get_web_page_file_ids(const WebPage *web_page) {
|
|||||||
vector<FileId> result = photo_get_file_ids(web_page->photo);
|
vector<FileId> result = photo_get_file_ids(web_page->photo);
|
||||||
if (web_page->document_file_id.is_valid()) {
|
if (web_page->document_file_id.is_valid()) {
|
||||||
result.push_back(web_page->document_file_id);
|
result.push_back(web_page->document_file_id);
|
||||||
|
FileId thumbnail_file_id;
|
||||||
|
switch (web_page->document_type) {
|
||||||
|
case DocumentsManager::DocumentType::Animation:
|
||||||
|
thumbnail_file_id = td_->animations_manager_->get_animation_thumbnail_file_id(web_page->document_file_id);
|
||||||
|
break;
|
||||||
|
case DocumentsManager::DocumentType::Audio:
|
||||||
|
thumbnail_file_id = td_->audios_manager_->get_audio_thumbnail_file_id(web_page->document_file_id);
|
||||||
|
break;
|
||||||
|
case DocumentsManager::DocumentType::General:
|
||||||
|
thumbnail_file_id = td_->documents_manager_->get_document_thumbnail_file_id(web_page->document_file_id);
|
||||||
|
break;
|
||||||
|
case DocumentsManager::DocumentType::Sticker:
|
||||||
|
thumbnail_file_id = td_->stickers_manager_->get_sticker_thumbnail_file_id(web_page->document_file_id);
|
||||||
|
break;
|
||||||
|
case DocumentsManager::DocumentType::Video:
|
||||||
|
thumbnail_file_id = td_->videos_manager_->get_video_thumbnail_file_id(web_page->document_file_id);
|
||||||
|
break;
|
||||||
|
case DocumentsManager::DocumentType::VideoNote:
|
||||||
|
thumbnail_file_id = td_->video_notes_manager_->get_video_note_thumbnail_file_id(web_page->document_file_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (thumbnail_file_id.is_valid()) {
|
||||||
|
result.push_back(thumbnail_file_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!web_page->instant_view.is_empty) {
|
if (!web_page->instant_view.is_empty) {
|
||||||
for (auto &page_block : web_page->instant_view.page_blocks) {
|
for (auto &page_block : web_page->instant_view.page_blocks) {
|
||||||
|
@ -246,7 +246,7 @@ class WebPagesManager : public Actor {
|
|||||||
|
|
||||||
static void append_page_block_caption_file_ids(const PageBlockCaption &caption, vector<FileId> &file_ids);
|
static void append_page_block_caption_file_ids(const PageBlockCaption &caption, vector<FileId> &file_ids);
|
||||||
|
|
||||||
static vector<FileId> get_web_page_file_ids(const WebPage *web_page);
|
vector<FileId> get_web_page_file_ids(const WebPage *web_page) const;
|
||||||
|
|
||||||
Td *td_;
|
Td *td_;
|
||||||
ActorShared<> parent_;
|
ActorShared<> parent_;
|
||||||
|
Loading…
Reference in New Issue
Block a user