mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Added ability to edit album items with remoteContent.
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user