Expect empty input media for a file too big to be sent to a secret chat.

This commit is contained in:
levlam 2022-05-20 16:31:41 +03:00
parent 0bc767f943
commit 4e8e95c81c

View File

@ -25793,10 +25793,17 @@ void MessagesManager::on_secret_message_media_uploaded(DialogId dialog_id, const
FileId thumbnail_file_id) { FileId thumbnail_file_id) {
CHECK(m != nullptr); CHECK(m != nullptr);
CHECK(m->message_id.is_valid()); CHECK(m->message_id.is_valid());
CHECK(!secret_input_media.empty());
if (G()->close_flag()) { if (G()->close_flag()) {
return; return;
} }
if (secret_input_media.empty()) {
// the media can't be sent to the chat
LOG(INFO) << "Can't send a media message to " << dialog_id;
fail_send_message({dialog_id, m->message_id}, Status::Error(400, "The file can't be sent to the secret chat"));
return;
}
/* /*
if (m->media_album_id != 0) { if (m->media_album_id != 0) {
switch (secret_input_media->input_file_->get_id()) { switch (secret_input_media->input_file_->get_id()) {