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>>(); auto tasks = std::vector<std::unique_ptr<Task>>();
tasks.reserve(list.files.size()); tasks.reserve(list.files.size());
for (auto &file : list.files) { for (auto &file : list.files) {
if (album) { const auto uploadWithType = !album
if (file.type == Ui::PreparedFile::Type::Photo ? type
&& type != SendMediaType::File) { : (file.type == Ui::PreparedFile::Type::Photo
type = SendMediaType::Photo; && type != SendMediaType::File)
} else { ? SendMediaType::Photo
type = SendMediaType::File; : SendMediaType::File;
}
}
tasks.push_back(std::make_unique<FileLoadTask>( tasks.push_back(std::make_unique<FileLoadTask>(
&session(), &session(),
file.path, file.path,
file.content, file.content,
std::move(file.information), std::move(file.information),
type, uploadWithType,
to, to,
caption, caption,
album)); album));