mirror of https://github.com/procxx/kepka.git
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ValidPhotoForAlbum(const FileMediaInformation::Image &image) {
|
bool ValidPhotoForAlbum(
|
||||||
if (image.animated) {
|
const FileMediaInformation::Image &image,
|
||||||
|
const QString &mime) {
|
||||||
|
if (image.animated
|
||||||
|
|| mime == qstr("image/webp")
|
||||||
|
|| mime == qstr("application/x-tgsticker")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const auto width = image.data.width();
|
const auto width = image.data.width();
|
||||||
|
@ -79,7 +83,7 @@ bool PrepareAlbumMediaIsWaiting(
|
||||||
using Video = FileMediaInformation::Video;
|
using Video = FileMediaInformation::Video;
|
||||||
if (const auto image = base::get_if<Image>(
|
if (const auto image = base::get_if<Image>(
|
||||||
&file.information->media)) {
|
&file.information->media)) {
|
||||||
if (ValidPhotoForAlbum(*image)) {
|
if (ValidPhotoForAlbum(*image, file.mime)) {
|
||||||
file.shownDimensions = PrepareShownDimensions(image->data);
|
file.shownDimensions = PrepareShownDimensions(image->data);
|
||||||
file.preview = Images::prepareOpaque(image->data.scaledToWidth(
|
file.preview = Images::prepareOpaque(image->data.scaledToWidth(
|
||||||
std::min(previewWidth, ConvertScale(image->data.width()))
|
std::min(previewWidth, ConvertScale(image->data.width()))
|
||||||
|
@ -313,7 +317,7 @@ void PreparedList::mergeToEnd(PreparedList &&other) {
|
||||||
|
|
||||||
bool PreparedList::canAddCaption(bool isAlbum, bool compressImages) const {
|
bool PreparedList::canAddCaption(bool isAlbum, bool compressImages) const {
|
||||||
const auto isSticker = [&] {
|
const auto isSticker = [&] {
|
||||||
if (files.empty() || compressImages) {
|
if (files.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return (files.front().mime == qstr("image/webp"))
|
return (files.front().mime == qstr("image/webp"))
|
||||||
|
|
Loading…
Reference in New Issue