mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-27 07:52:57 +02:00
parent
a21b6d7416
commit
f2867df340
1 changed files with 7 additions and 9 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue