mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added ability to edit album items with remoteContent.
This commit is contained in:
parent
1da9bfc643
commit
2cb69f0c2b
1 changed files with 15 additions and 4 deletions
|
@ -411,10 +411,6 @@ void EditCaptionBox::createEditMediaButton() {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!result.remoteContent.isEmpty()) {
|
if (!result.remoteContent.isEmpty()) {
|
||||||
// Don't use remoteContent to edit album item.
|
|
||||||
if (_isAlbum) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto list = Storage::PrepareMediaFromImage(
|
auto list = Storage::PrepareMediaFromImage(
|
||||||
QImage(),
|
QImage(),
|
||||||
|
@ -425,6 +421,21 @@ void EditCaptionBox::createEditMediaButton() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_isAlbum) {
|
||||||
|
const auto albumMimes = {
|
||||||
|
"image/jpeg",
|
||||||
|
"image/png",
|
||||||
|
"video/mp4",
|
||||||
|
};
|
||||||
|
if ((ranges::find(albumMimes, list.files.front().mime)
|
||||||
|
== end(albumMimes))) {
|
||||||
|
Ui::show(
|
||||||
|
Box<InformBox>(lang(lng_edit_media_album_error)),
|
||||||
|
LayerOption::KeepOther);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_preparedList = std::move(list);
|
_preparedList = std::move(list);
|
||||||
} else if (!result.paths.isEmpty()) {
|
} else if (!result.paths.isEmpty()) {
|
||||||
auto list = Storage::PrepareMediaList(
|
auto list = Storage::PrepareMediaList(
|
||||||
|
|
Loading…
Add table
Reference in a new issue