Various fixes.

This commit is contained in:
levlam 2024-06-30 09:29:53 +03:00
parent 0ba8247033
commit eb8f3419bb
7 changed files with 13 additions and 5 deletions

View File

@ -9,6 +9,7 @@
#include "td/telegram/BackgroundId.h" #include "td/telegram/BackgroundId.h"
#include "td/telegram/ChannelId.h" #include "td/telegram/ChannelId.h"
#include "td/telegram/ChatId.h" #include "td/telegram/ChatId.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/files/FileId.h" #include "td/telegram/files/FileId.h"
#include "td/telegram/files/FileSourceId.h" #include "td/telegram/files/FileSourceId.h"
#include "td/telegram/MessageFullId.h" #include "td/telegram/MessageFullId.h"

View File

@ -8041,7 +8041,7 @@ FileId get_message_content_thumbnail_file_id(const MessageContent *content, cons
vector<FileId> get_message_content_thumbnail_file_ids(const MessageContent *content, const Td *td) { vector<FileId> get_message_content_thumbnail_file_ids(const MessageContent *content, const Td *td) {
if (content->get_type() == MessageContentType::PaidMedia) { if (content->get_type() == MessageContentType::PaidMedia) {
return transform(static_cast<const MessagePaidMedia *>(content)->media, return transform(static_cast<const MessagePaidMedia *>(content)->media,
[td](const MessageExtendedMedia &media) { return media.get_thumbnail_file_id(td); }); [&](const MessageExtendedMedia &media) { return media.get_thumbnail_file_id(td); });
} }
auto file_id = get_message_content_thumbnail_file_id(content, td); auto file_id = get_message_content_thumbnail_file_id(content, td);
if (file_id.is_valid()) { if (file_id.is_valid()) {

View File

@ -11,8 +11,7 @@
#include "td/telegram/Document.h" #include "td/telegram/Document.h"
#include "td/telegram/DocumentsManager.h" #include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileManager.h"
#include "td/telegram/MessageContent.h" #include "td/telegram/files/FileType.h"
#include "td/telegram/MessageContentType.h"
#include "td/telegram/Photo.h" #include "td/telegram/Photo.h"
#include "td/telegram/PhotoSize.h" #include "td/telegram/PhotoSize.h"
#include "td/telegram/StickersManager.h" #include "td/telegram/StickersManager.h"
@ -401,7 +400,7 @@ void MessageExtendedMedia::merge_files(Td *td, MessageExtendedMedia &other, Dial
return; return;
} }
if (type_ != other.type_) { if (type_ != other.type_) {
LOG(ERROR) << "Type of a paid media has changed"; LOG(ERROR) << "Type of paid media has changed";
return; return;
} }
switch (type_) { switch (type_) {

View File

@ -12,13 +12,16 @@
#include "td/telegram/DialogId.h" #include "td/telegram/DialogId.h"
#include "td/telegram/DialogManager.h" #include "td/telegram/DialogManager.h"
#include "td/telegram/FileReferenceManager.h" #include "td/telegram/FileReferenceManager.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h" #include "td/telegram/Global.h"
#include "td/telegram/InputInvoice.h" #include "td/telegram/InputInvoice.h"
#include "td/telegram/MessageExtendedMedia.h" #include "td/telegram/MessageExtendedMedia.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/MessageSender.h" #include "td/telegram/MessageSender.h"
#include "td/telegram/PasswordManager.h" #include "td/telegram/PasswordManager.h"
#include "td/telegram/Photo.h" #include "td/telegram/Photo.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StatisticsManager.h" #include "td/telegram/StatisticsManager.h"
#include "td/telegram/Td.h" #include "td/telegram/Td.h"
#include "td/telegram/telegram_api.h" #include "td/telegram/telegram_api.h"

View File

@ -15,6 +15,7 @@
#include "td/actor/actor.h" #include "td/actor/actor.h"
#include "td/utils/common.h" #include "td/utils/common.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/Promise.h" #include "td/utils/Promise.h"
#include "td/utils/Status.h" #include "td/utils/Status.h"

View File

@ -3631,7 +3631,7 @@ bool FileManager::extract_was_thumbnail_uploaded(
return false; return false;
} }
switch (input_media->get_id()) { switch (input_media->get_id()) {
case telegram_api::inputMediaDocument::ID: case telegram_api::inputMediaUploadedDocument::ID:
return static_cast<const telegram_api::inputMediaUploadedDocument *>(input_media.get())->thumb_ != nullptr; return static_cast<const telegram_api::inputMediaUploadedDocument *>(input_media.get())->thumb_ != nullptr;
case telegram_api::inputMediaPaidMedia::ID: { case telegram_api::inputMediaPaidMedia::ID: {
auto &extended_media = static_cast<const telegram_api::inputMediaPaidMedia *>(input_media.get())->extended_media_; auto &extended_media = static_cast<const telegram_api::inputMediaPaidMedia *>(input_media.get())->extended_media_;

View File

@ -14,11 +14,15 @@
#include "td/utils/base64.h" #include "td/utils/base64.h"
#include "td/utils/common.h" #include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/Slice.h" #include "td/utils/Slice.h"
#include "td/utils/Status.h" #include "td/utils/Status.h"
#include "td/utils/Storer.h" #include "td/utils/Storer.h"
#include "td/utils/utf8.h" #include "td/utils/utf8.h"
#include <tuple>
namespace td { namespace td {
void NetQueryVerifier::verify(NetQueryPtr query, string nonce) { void NetQueryVerifier::verify(NetQueryPtr query, string nonce) {