Fix sending of album with videos.

Fixes #8960.
This commit is contained in:
John Preston 2020-11-02 11:50:14 +03:00
parent a21b6d7416
commit f2867df340

View file

@ -4230,20 +4230,18 @@ void ApiWrap::sendFiles(
auto tasks = std::vector<std::unique_ptr<Task>>();
tasks.reserve(list.files.size());
for (auto &file : list.files) {
if (album) {
if (file.type == Ui::PreparedFile::Type::Photo
&& type != SendMediaType::File) {
type = SendMediaType::Photo;
} else {
type = SendMediaType::File;
}
}
const auto uploadWithType = !album
? type
: (file.type == Ui::PreparedFile::Type::Photo
&& type != SendMediaType::File)
? SendMediaType::Photo
: SendMediaType::File;
tasks.push_back(std::make_unique<FileLoadTask>(
&session(),
file.path,
file.content,
std::move(file.information),
type,
uploadWithType,
to,
caption,
album));