2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Refactored ApiWrap::editMedia.

- Slightly refactored checkEntitiesAndViewsUpdate.
 - Slightly refactored HistoryMessage.
This commit is contained in:
23rd
2019-03-30 11:13:16 +03:00
committed by John Preston
parent 0e4d85a5e5
commit be2b2cbf7e
5 changed files with 18 additions and 24 deletions

View File

@@ -4472,22 +4472,19 @@ void ApiWrap::editMedia(
SendMediaType type,
TextWithTags &&caption,
const SendOptions &options) {
LOG(("EDIT MEDIA WITH TEXT %1").arg(caption.text));
if (list.files.empty()) return;
auto &file = list.files.front();
const auto to = fileLoadTaskOptions(options);
auto tasks = std::vector<std::unique_ptr<Task>>();
tasks.reserve(list.files.size());
for (auto &file : list.files) {
tasks.push_back(std::make_unique<FileLoadTask>(
file.path,
file.content,
std::move(file.information),
type,
to,
caption,
nullptr,
true));
}
_fileLoader->addTasks(std::move(tasks));
_fileLoader->addTask(std::make_unique<FileLoadTask>(
file.path,
file.content,
std::move(file.information),
type,
to,
caption,
nullptr,
true));
}
void ApiWrap::sendFiles(