From 2e972fb6784111b7f6496a15b032e16a1dc1e770 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 30 Nov 2017 15:06:30 +0400 Subject: [PATCH] Hide "Delete for {user}" in chats with bots. Fixes #3818. --- Telegram/SourceFiles/history/history_item.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 1a7a469cfa..98f67329d0 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -949,6 +949,12 @@ bool HistoryItem::canDeleteForEveryone(const QDateTime &cur) const { } if (history()->peer->isChannel()) { return false; + } else if (auto user = history()->peer->asUser()) { + // Bots receive all messages and there is no sense in revoking them. + // See https://github.com/telegramdesktop/tdesktop/issues/3818 + if (user->botInfo) { + return false; + } } if (!toHistoryMessage()) { return false;