diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 884ad6b6d..f69e9c18c 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -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 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 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 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, diff --git a/Telegram/SourceFiles/storage/localimageloader.h b/Telegram/SourceFiles/storage/localimageloader.h index ed0dc1c47..e0cef82c2 100644 --- a/Telegram/SourceFiles/storage/localimageloader.h +++ b/Telegram/SourceFiles/storage/localimageloader.h @@ -128,6 +128,7 @@ struct SendingAlbum { uint64 groupId = 0; std::vector items; Api::SendOptions options; + bool sent = false; };