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

Fix a possible crash in Clear History.

This commit is contained in:
John Preston
2021-02-19 17:53:11 +04:00
parent f9f52302bb
commit 47d2ecf629

View File

@@ -1391,12 +1391,15 @@ void HistoryMessage::applyEdition(const MTPDmessage &message) {
void HistoryMessage::applyEdition(const MTPDmessageService &message) { void HistoryMessage::applyEdition(const MTPDmessageService &message) {
if (message.vaction().type() == mtpc_messageActionHistoryClear) { if (message.vaction().type() == mtpc_messageActionHistoryClear) {
const auto wasGrouped = history()->owner().groups().isGrouped(this);
setReplyMarkup(nullptr); setReplyMarkup(nullptr);
refreshMedia(nullptr); refreshMedia(nullptr);
setEmptyText(); setEmptyText();
setViewsCount(-1); setViewsCount(-1);
setForwardsCount(-1); setForwardsCount(-1);
if (wasGrouped) {
history()->owner().groups().unregisterMessage(this);
}
finishEditionToEmpty(); finishEditionToEmpty();
} }
} }