Revert "Fixed adding caption to grouped files."

This reverts commit 5277080115.

When sending an album of files each one of them can have its own
caption that will be shown below the file.

A caption for the whole album (in case of media albums) is added
to the first album item. In case of media albums this caption is
displayed under the whole album mosaic. But in case of an album
of files this caption will be displayed under the first file,
between the first and the second file of the album. This is not
what user can expect when he adds a caption for an album.

So we will send it as a separate comment, like it was done before.
This commit is contained in:
John Preston 2021-01-26 12:15:54 +04:00
parent b22c65a8db
commit 0d0a79b0b5
2 changed files with 1 additions and 20 deletions

View File

@ -152,25 +152,6 @@ bool PreparedList::canAddCaption(bool sendingAlbum) const {
} else if (!sendingAlbum) {
return false;
}
// All music.
{
auto pred = [](const PreparedFile &file) {
return file.type == PreparedFile::Type::Music;
};
if (ranges::all_of(files, std::move(pred))) {
return true;
}
}
// All files.
{
auto pred = [](const PreparedFile &file) {
return file.type == PreparedFile::Type::File;
};
if (ranges::all_of(files, std::move(pred))) {
return true;
}
}
const auto hasFiles = ranges::contains(
files,
PreparedFile::Type::File,

View File

@ -120,7 +120,7 @@ struct PreparedGroup {
[[nodiscard]] bool sentWithCaption() const {
return (list.files.size() == 1)
|| (type != AlbumType::None);
|| (type == AlbumType::PhotoVideo);
}
};