mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
@@ -152,6 +152,25 @@ 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,
|
||||
|
||||
@@ -120,7 +120,7 @@ struct PreparedGroup {
|
||||
|
||||
[[nodiscard]] bool sentWithCaption() const {
|
||||
return (list.files.size() == 1)
|
||||
|| (type == AlbumType::PhotoVideo);
|
||||
|| (type != AlbumType::None);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user