2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Fix cancel / crash in sending album to scheduled messages.

Fixes #8788
This commit is contained in:
John Preston
2020-10-22 16:08:01 +03:00
parent b788ae0ae4
commit 1cabfaa6a4
2 changed files with 4 additions and 3 deletions

View File

@@ -416,11 +416,12 @@ void History::destroyMessage(not_null<HistoryItem*> item) {
types,
item->id));
}
} else {
session().api().cancelLocalItem(item);
}
itemRemoved(item);
}
if (item->isSending()) {
session().api().cancelLocalItem(item);
}
owner().unregisterMessage(item);
Core::App().notifications().clearFromItem(item);

View File

@@ -69,7 +69,7 @@ constexpr auto kExportLocalTimeout = crl::time(1000);
//}
MsgId ItemIdAcrossData(not_null<HistoryItem*> item) {
if (!item->isScheduled()) {
if (!item->isScheduled() || item->isSending() || item->hasFailed()) {
return item->id;
}
const auto session = &item->history()->session();