mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-25 04:38:23 +00:00
Fix sticker sending from clipboard.
This commit is contained in:
parent
8477956117
commit
f2b3d9714f
@ -27,8 +27,12 @@ bool HasExtensionFrom(const QString &file, const QStringList &extensions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ValidPhotoForAlbum(const FileMediaInformation::Image &image) {
|
||||
if (image.animated) {
|
||||
bool ValidPhotoForAlbum(
|
||||
const FileMediaInformation::Image &image,
|
||||
const QString &mime) {
|
||||
if (image.animated
|
||||
|| mime == qstr("image/webp")
|
||||
|| mime == qstr("application/x-tgsticker")) {
|
||||
return false;
|
||||
}
|
||||
const auto width = image.data.width();
|
||||
@ -79,7 +83,7 @@ bool PrepareAlbumMediaIsWaiting(
|
||||
using Video = FileMediaInformation::Video;
|
||||
if (const auto image = base::get_if<Image>(
|
||||
&file.information->media)) {
|
||||
if (ValidPhotoForAlbum(*image)) {
|
||||
if (ValidPhotoForAlbum(*image, file.mime)) {
|
||||
file.shownDimensions = PrepareShownDimensions(image->data);
|
||||
file.preview = Images::prepareOpaque(image->data.scaledToWidth(
|
||||
std::min(previewWidth, ConvertScale(image->data.width()))
|
||||
@ -313,7 +317,7 @@ void PreparedList::mergeToEnd(PreparedList &&other) {
|
||||
|
||||
bool PreparedList::canAddCaption(bool isAlbum, bool compressImages) const {
|
||||
const auto isSticker = [&] {
|
||||
if (files.empty() || compressImages) {
|
||||
if (files.empty()) {
|
||||
return false;
|
||||
}
|
||||
return (files.front().mime == qstr("image/webp"))
|
||||
|
Loading…
Reference in New Issue
Block a user