Allow revoking any messages in private chats.

This commit is contained in:
John Preston 2019-05-08 12:14:42 +03:00
parent 64dd5139da
commit aec6e17b5d
3 changed files with 6 additions and 9 deletions

View File

@ -975,10 +975,6 @@ bool MediaCall::allowsForward() const {
return false; return false;
} }
bool MediaCall::allowsRevoke() const {
return false;
}
bool MediaCall::updateInlineResultMedia(const MTPMessageMedia &media) { bool MediaCall::updateInlineResultMedia(const MTPMessageMedia &media) {
return false; return false;
} }

View File

@ -267,7 +267,6 @@ public:
QString pinnedTextSubstring() const override; QString pinnedTextSubstring() const override;
TextForMimeData clipboardText() const override; TextForMimeData clipboardText() const override;
bool allowsForward() const override; bool allowsForward() const override;
bool allowsRevoke() const override;
bool updateInlineResultMedia(const MTPMessageMedia &media) override; bool updateInlineResultMedia(const MTPMessageMedia &media) override;
bool updateSentMedia(const MTPMessageMedia &media) override; bool updateSentMedia(const MTPMessageMedia &media) override;

View File

@ -494,11 +494,13 @@ bool HistoryItem::canDeleteForEveryone(TimeId now) const {
return false; return false;
} }
} }
if (!toHistoryMessage()) { if (!peer->isUser()) {
return false; if (!toHistoryMessage()) {
} else if (const auto media = this->media()) {
if (!media->allowsRevoke()) {
return false; return false;
} else if (const auto media = this->media()) {
if (!media->allowsRevoke()) {
return false;
}
} }
} }
if (!out()) { if (!out()) {