Send PDFs only as files.

Fixes #10294.
This commit is contained in:
John Preston 2021-02-05 13:17:26 +04:00
parent e8affa85b0
commit ce1b94eb16
2 changed files with 3 additions and 2 deletions

View File

@ -875,7 +875,8 @@ void FileLoadTask::process(Args &&args) {
}
} else if (isAnimation) {
attributes.push_back(MTP_documentAttributeAnimated());
} else if (_type != SendMediaType::File) {
} else if (filemime.startsWith(u"image/"_q)
&& _type != SendMediaType::File) {
auto medium = (w > 320 || h > 320) ? fullimage.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation) : fullimage;
auto full = (w > 1280 || h > 1280) ? fullimage.scaled(1280, 1280, Qt::KeepAspectRatio, Qt::SmoothTransformation) : fullimage;
{

View File

@ -40,7 +40,7 @@ bool ValidPhotoForAlbum(
const QString &mime) {
if (image.animated
|| Core::IsMimeSticker(mime)
|| (mime == u"application/pdf"_q)) {
|| !mime.startsWith(u"image/")) {
return false;
}
const auto width = image.data.width();