Fixed caption when sending single WEBP as file.

This commit is contained in:
23rd 2018-12-21 11:51:57 +03:00 committed by John Preston
parent ef1d38462f
commit d1a9f1feac

View File

@ -4302,7 +4302,14 @@ void ApiWrap::sendFiles(
TextWithTags &&caption,
std::shared_ptr<SendingAlbum> album,
const SendOptions &options) {
if (list.files.size() > 1 && !caption.text.isEmpty()) {
const auto isSticker = [&] {
if (list.files.empty() || type != SendMediaType::File) {
return false;
}
return list.files.front().mime == qstr("image/webp");
};
if ((list.files.size() > 1 || isSticker())
&& !caption.text.isEmpty()) {
auto message = MessageToSend(options.history);
message.textWithTags = std::move(caption);
message.replyTo = options.replyTo;