mirror of https://github.com/procxx/kepka.git
Allow edit messages older than 2 days in sgroups
This feature is cherry-picked from
75d8d01b17 (diff-c0b32cc8ed01e3b1cdbfd5427184a41dL874)
This commit is contained in:
parent
9c4a0ee2dc
commit
04882ed746
|
@ -856,7 +856,15 @@ bool HistoryItem::canForward() const {
|
|||
|
||||
bool HistoryItem::canEdit(const QDateTime &cur) const {
|
||||
auto messageToMyself = _history->peer->isSelf();
|
||||
auto messageTooOld = messageToMyself ? false : (date.secsTo(cur) >= Global::EditTimeLimit());
|
||||
auto canPinInMegagroup = [&] {
|
||||
if (auto megagroup = _history->peer->asMegagroup()) {
|
||||
return megagroup->canPinMessages();
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
auto messageTooOld = (messageToMyself || canPinInMegagroup) ? false : (date.secsTo(cur) >= Global::EditTimeLimit());
|
||||
|
||||
if (id < 0 || messageTooOld) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue