Added ability to edit album items with remoteContent.

This commit is contained in:
23rd 2019-04-04 11:01:10 +03:00
parent 1da9bfc643
commit 2cb69f0c2b
1 changed files with 15 additions and 4 deletions

View File

@ -411,10 +411,6 @@ void EditCaptionBox::createEditMediaButton() {
};
if (!result.remoteContent.isEmpty()) {
// Don't use remoteContent to edit album item.
if (_isAlbum) {
return;
}
auto list = Storage::PrepareMediaFromImage(
QImage(),
@ -425,6 +421,21 @@ void EditCaptionBox::createEditMediaButton() {
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);
} else if (!result.paths.isEmpty()) {
auto list = Storage::PrepareMediaList(