From 5c4b68d632340407420a22c3dfa55b837af74563 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 5 Nov 2021 08:27:33 +0300 Subject: [PATCH] Fixed possible crash on sponsored messages. --- Telegram/SourceFiles/history/history_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 40a82f879f..1c129a0389 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -634,7 +634,9 @@ bool HistoryItem::canStopPoll() const { } bool HistoryItem::canDelete() const { - if (!IsServerMsgId(id) && serviceMsg()) { + if (isSponsored()) { + return false; + } else if (!IsServerMsgId(id) && serviceMsg()) { return false; } else if (!isHistoryEntry() && !isScheduled()) { return false;