mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
parent
1ccfcc824c
commit
5277080115
2 changed files with 20 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue