Work better with 'unlimited' config time limits.

This commit is contained in:
John Preston 2018-03-25 23:47:49 +04:00
parent aa5781b550
commit 63098d3c7d
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}