Fix album sending with video processing.

This commit is contained in:
John Preston 2024-11-01 17:52:05 +04:00
parent 267a51e800
commit f091f2b344
2 changed files with 7 additions and 0 deletions

View file

@ -4231,6 +4231,7 @@ void ApiWrap::sendMultiPaidMedia(
auto &histories = history->owner().histories();
const auto peer = history->peer;
const auto itemId = item->fullId();
album->sent = true;
histories.sendPreparedMessage(
history,
replyTo,
@ -4302,6 +4303,9 @@ void ApiWrap::sendAlbumWithCancelled(
}
void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
if (album->sent) {
return;
}
const auto groupId = album->groupId;
if (album->items.empty()) {
_sendingAlbums.remove(groupId);
@ -4326,6 +4330,7 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
return;
} else if (medias.size() < 2) {
const auto &single = medias.front().data();
album->sent = true;
sendMediaWithRandomId(
sample,
single.vmedia(),
@ -4352,6 +4357,7 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
| (album->options.invertCaption ? Flag::f_invert_media : Flag(0));
auto &histories = history->owner().histories();
const auto peer = history->peer;
album->sent = true;
histories.sendPreparedMessage(
history,
replyTo,

View file

@ -128,6 +128,7 @@ struct SendingAlbum {
uint64 groupId = 0;
std::vector<Item> items;
Api::SendOptions options;
bool sent = false;
};