From 63098d3c7d92379f8a50e07f45ae5d87fef1a3eb Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 25 Mar 2018 23:47:49 +0400 Subject: [PATCH] Work better with 'unlimited' config time limits. --- Telegram/SourceFiles/history/history_item.cpp | 4 ++-- Telegram/SourceFiles/history/history_message.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index dc9b72499e..1e2751d059 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -372,8 +372,8 @@ bool HistoryItem::canDeleteForEveryone(TimeId now) const { const auto messageTooOld = messageToMyself ? false : peer->isUser() - ? (now >= date() + Global::RevokePrivateTimeLimit()) - : (now >= date() + Global::RevokeTimeLimit()); + ? (now - date() >= Global::RevokePrivateTimeLimit()) + : (now - date() >= Global::RevokeTimeLimit()); if (id < 0 || messageToMyself || messageTooOld || isPost()) { return false; } diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 5e33a79019..489f8abffc 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -590,7 +590,7 @@ bool HistoryMessage::allowsEdit(TimeId now) const { }(); const auto messageTooOld = (messageToMyself || canPinInMegagroup) ? false - : (now >= date() + Global::EditTimeLimit()); + : (now - date() >= Global::EditTimeLimit()); if (id < 0 || messageTooOld) { return false; }