Fix error logging.
This commit is contained in:
parent
0ef9365e02
commit
9610b06abc
@ -69,11 +69,13 @@ unique_ptr<StoryContent> get_story_content(Td *td, tl_object_ptr<telegram_api::M
|
|||||||
auto media = move_tl_object_as<telegram_api::messageMediaPhoto>(media_ptr);
|
auto media = move_tl_object_as<telegram_api::messageMediaPhoto>(media_ptr);
|
||||||
if (media->photo_ == nullptr || (media->flags_ & telegram_api::messageMediaPhoto::TTL_SECONDS_MASK) != 0 ||
|
if (media->photo_ == nullptr || (media->flags_ & telegram_api::messageMediaPhoto::TTL_SECONDS_MASK) != 0 ||
|
||||||
media->spoiler_) {
|
media->spoiler_) {
|
||||||
|
LOG(ERROR) << "Receive a story with content " << to_string(media);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto photo = get_photo(td, std::move(media->photo_), owner_dialog_id);
|
auto photo = get_photo(td, std::move(media->photo_), owner_dialog_id);
|
||||||
if (photo.is_empty()) {
|
if (photo.is_empty()) {
|
||||||
|
LOG(ERROR) << "Receive a story with empty photo";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return make_unique<StoryContentPhoto>(std::move(photo));
|
return make_unique<StoryContentPhoto>(std::move(photo));
|
||||||
@ -82,18 +84,21 @@ unique_ptr<StoryContent> get_story_content(Td *td, tl_object_ptr<telegram_api::M
|
|||||||
auto media = move_tl_object_as<telegram_api::messageMediaDocument>(media_ptr);
|
auto media = move_tl_object_as<telegram_api::messageMediaDocument>(media_ptr);
|
||||||
if (media->document_ == nullptr || (media->flags_ & telegram_api::messageMediaDocument::TTL_SECONDS_MASK) != 0 ||
|
if (media->document_ == nullptr || (media->flags_ & telegram_api::messageMediaDocument::TTL_SECONDS_MASK) != 0 ||
|
||||||
media->spoiler_) {
|
media->spoiler_) {
|
||||||
|
LOG(ERROR) << "Receive a story with content " << to_string(media);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto document_ptr = std::move(media->document_);
|
auto document_ptr = std::move(media->document_);
|
||||||
int32 document_id = document_ptr->get_id();
|
int32 document_id = document_ptr->get_id();
|
||||||
if (document_id == telegram_api::documentEmpty::ID) {
|
if (document_id == telegram_api::documentEmpty::ID) {
|
||||||
|
LOG(ERROR) << "Receive a story with empty document";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CHECK(document_id == telegram_api::document::ID);
|
CHECK(document_id == telegram_api::document::ID);
|
||||||
auto parsed_document = td->documents_manager_->on_get_document(
|
auto parsed_document = td->documents_manager_->on_get_document(
|
||||||
move_tl_object_as<telegram_api::document>(document_ptr), owner_dialog_id, nullptr);
|
move_tl_object_as<telegram_api::document>(document_ptr), owner_dialog_id, nullptr);
|
||||||
if (parsed_document.empty() || parsed_document.type != Document::Type::Video) {
|
if (parsed_document.empty() || parsed_document.type != Document::Type::Video) {
|
||||||
|
LOG(ERROR) << "Receive a story with " << parsed_document;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CHECK(parsed_document.file_id.is_valid());
|
CHECK(parsed_document.file_id.is_valid());
|
||||||
@ -123,7 +128,6 @@ unique_ptr<StoryContent> get_story_content(Td *td, tl_object_ptr<telegram_api::M
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
LOG(ERROR) << "Receive a story with content " << to_string(media_ptr);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user