2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Don't cancel admin log files download on item destroy.

This commit is contained in:
John Preston
2023-08-21 12:06:20 +02:00
parent 4e3db5b693
commit 56555c330b
2 changed files with 13 additions and 8 deletions

View File

@@ -495,8 +495,10 @@ void History::destroyMessage(not_null<HistoryItem*> item) {
session().api().cancelLocalItem(item);
}
const auto document = [&] {
const auto media = item->media();
const auto documentToCancel = [&] {
const auto media = item->isAdminLogEntry()
? nullptr
: item->media();
return media ? media->document() : nullptr;
}();
@@ -510,8 +512,8 @@ void History::destroyMessage(not_null<HistoryItem*> item) {
Assert(i != end(_messages));
_messages.erase(i);
if (document) {
session().data().documentMessageRemoved(document);
if (documentToCancel) {
session().data().documentMessageRemoved(documentToCancel);
}
}