Fixed edit of scheduled messages.
This commit is contained in:
parent
936d4004ff
commit
2f48fe920e
|
@ -619,8 +619,8 @@ bool HistoryItem::allowsEdit(TimeId now) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool HistoryItem::canStopPoll() const {
|
||||
if (!isRegular()
|
||||
bool HistoryItem::canBeEdited() const {
|
||||
if ((!isRegular() && !isScheduled())
|
||||
|| Has<HistoryMessageVia>()
|
||||
|| Has<HistoryMessageForwarded>()) {
|
||||
return false;
|
||||
|
@ -641,6 +641,10 @@ bool HistoryItem::canStopPoll() const {
|
|||
return out();
|
||||
}
|
||||
|
||||
bool HistoryItem::canStopPoll() const {
|
||||
return canBeEdited() && isRegular();
|
||||
}
|
||||
|
||||
bool HistoryItem::canDelete() const {
|
||||
if (isSponsored()) {
|
||||
return false;
|
||||
|
|
|
@ -373,6 +373,7 @@ public:
|
|||
}
|
||||
|
||||
[[nodiscard]] bool canPin() const;
|
||||
[[nodiscard]] bool canBeEdited() const;
|
||||
[[nodiscard]] bool canStopPoll() const;
|
||||
[[nodiscard]] virtual bool allowsSendNow() const;
|
||||
[[nodiscard]] virtual bool allowsForward() const;
|
||||
|
|
|
@ -1048,7 +1048,7 @@ bool HistoryMessage::isTooOldForEdit(TimeId now) const {
|
|||
}
|
||||
|
||||
bool HistoryMessage::allowsEdit(TimeId now) const {
|
||||
return canStopPoll()
|
||||
return canBeEdited()
|
||||
&& !isTooOldForEdit(now)
|
||||
&& (!_media || _media->allowsEdit())
|
||||
&& !isLegacyMessage()
|
||||
|
|
Loading…
Reference in New Issue