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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user