Allow video notes without sound and prevent their creation.

This commit is contained in:
levlam 2021-08-01 07:40:57 +03:00
parent a4e1839089
commit 9e3ad28d09
2 changed files with 8 additions and 3 deletions

View File

@ -118,9 +118,14 @@ Document DocumentsManager::on_get_document(RemoteDocument remote_document, Dialo
}
if (animated != nullptr) {
// video animation
type_attributes--;
video = nullptr;
if ((video->flags_ & telegram_api::documentAttributeVideo::ROUND_MESSAGE_MASK) != 0) {
// video note without sound
animated = nullptr;
} else {
// video animation
video = nullptr;
}
}
}
if (animated != nullptr && audio != nullptr) {

View File

@ -219,7 +219,7 @@ tl_object_ptr<telegram_api::InputMedia> VideoNotesManager::get_input_media(
telegram_api::documentAttributeVideo::ROUND_MESSAGE_MASK, false /*ignored*/, false /*ignored*/,
video_note->duration, video_note->dimensions.width ? video_note->dimensions.width : 240,
video_note->dimensions.height ? video_note->dimensions.height : 240));
int32 flags = 0;
int32 flags = telegram_api::inputMediaUploadedDocument::NOSOUND_VIDEO_MASK;
if (input_thumbnail != nullptr) {
flags |= telegram_api::inputMediaUploadedDocument::THUMB_MASK;
}