2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix sending many files with a comment.

This commit is contained in:
John Preston
2020-10-17 12:51:55 +03:00
parent 85d08c8f52
commit bb4fdde616
15 changed files with 246 additions and 295 deletions

View File

@@ -4212,14 +4212,12 @@ void ApiWrap::sendFiles(
std::shared_ptr<SendingAlbum> album,
const SendAction &action) {
const auto haveCaption = !caption.text.isEmpty();
const auto isAlbum = (album != nullptr);
if (haveCaption && !list.canAddCaption(isAlbum)) {
if (haveCaption && !list.canAddCaption(album != nullptr)) {
auto message = MessageToSend(action.history);
message.textWithTags = std::move(caption);
message.textWithTags = base::take(caption);
message.action = action;
message.action.clearDraft = false;
sendMessage(std::move(message));
caption = TextWithTags();
}
const auto to = fileLoadTaskOptions(action);
@@ -4240,7 +4238,7 @@ void ApiWrap::sendFiles(
case Ui::PreparedFile::AlbumType::File:
type = SendMediaType::File;
break;
default: Unexpected("AlbumType in uploadFilesAfterConfirmation");
default: Unexpected("AlbumType in ApiWrap::sendFiles.");
}
}
tasks.push_back(std::make_unique<FileLoadTask>(