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,6 +494,7 @@ bool HistoryItem::canDeleteForEveryone(TimeId now) const {
return false; return false;
} }
} }
if (!peer->isUser()) {
if (!toHistoryMessage()) { if (!toHistoryMessage()) {
return false; return false;
} else if (const auto media = this->media()) { } else if (const auto media = this->media()) {
@ -501,6 +502,7 @@ bool HistoryItem::canDeleteForEveryone(TimeId now) const {
return false; return false;
} }
} }
}
if (!out()) { if (!out()) {
if (const auto chat = peer->asChat()) { if (const auto chat = peer->asChat()) {
if (!chat->amCreator() if (!chat->amCreator()