Allow messageMediaEmpty before authorizartion.

This commit is contained in:
levlam 2021-12-04 21:57:44 +03:00
parent d475b0fc89
commit fe4efa3e5b

View File

@ -4111,7 +4111,8 @@ unique_ptr<MessageContent> get_message_content(Td *td, FormattedText message,
tl_object_ptr<telegram_api::MessageMedia> &&media,
DialogId owner_dialog_id, bool is_content_read, UserId via_bot_user_id,
int32 *ttl, bool *disable_web_page_preview) {
if (!td->auth_manager_->was_authorized() && !G()->close_flag() && media != nullptr) {
if (!td->auth_manager_->was_authorized() && !G()->close_flag() && media != nullptr &&
media->get_id() != telegram_api::messageMediaEmpty::ID) {
LOG(ERROR) << "Receive without authorization " << to_string(media);
media = nullptr;
}