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

Correctly check media when editing files.

This commit is contained in:
John Preston
2020-10-20 11:19:48 +03:00
parent c4af731b19
commit a614ccad97
16 changed files with 155 additions and 187 deletions

View File

@@ -4228,18 +4228,11 @@ void ApiWrap::sendFiles(
tasks.reserve(list.files.size());
for (auto &file : list.files) {
if (album) {
switch (file.type) {
case Ui::PreparedFile::AlbumType::Photo:
type = (type == SendMediaType::File)
? type
: SendMediaType::Photo;
break;
case Ui::PreparedFile::AlbumType::Music:
case Ui::PreparedFile::AlbumType::Video:
case Ui::PreparedFile::AlbumType::File:
if (file.type == Ui::PreparedFile::Type::Photo
&& type != SendMediaType::File) {
type = SendMediaType::Photo;
} else {
type = SendMediaType::File;
break;
default: Unexpected("AlbumType in ApiWrap::sendFiles.");
}
}
tasks.push_back(std::make_unique<FileLoadTask>(