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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryItem::canStopPoll() const {
|
bool HistoryItem::canBeEdited() const {
|
||||||
if (!isRegular()
|
if ((!isRegular() && !isScheduled())
|
||||||
|| Has<HistoryMessageVia>()
|
|| Has<HistoryMessageVia>()
|
||||||
|| Has<HistoryMessageForwarded>()) {
|
|| Has<HistoryMessageForwarded>()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -641,6 +641,10 @@ bool HistoryItem::canStopPoll() const {
|
||||||
return out();
|
return out();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HistoryItem::canStopPoll() const {
|
||||||
|
return canBeEdited() && isRegular();
|
||||||
|
}
|
||||||
|
|
||||||
bool HistoryItem::canDelete() const {
|
bool HistoryItem::canDelete() const {
|
||||||
if (isSponsored()) {
|
if (isSponsored()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -373,6 +373,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool canPin() const;
|
[[nodiscard]] bool canPin() const;
|
||||||
|
[[nodiscard]] bool canBeEdited() const;
|
||||||
[[nodiscard]] bool canStopPoll() const;
|
[[nodiscard]] bool canStopPoll() const;
|
||||||
[[nodiscard]] virtual bool allowsSendNow() const;
|
[[nodiscard]] virtual bool allowsSendNow() const;
|
||||||
[[nodiscard]] virtual bool allowsForward() const;
|
[[nodiscard]] virtual bool allowsForward() const;
|
||||||
|
|
|
@ -1048,7 +1048,7 @@ bool HistoryMessage::isTooOldForEdit(TimeId now) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryMessage::allowsEdit(TimeId now) const {
|
bool HistoryMessage::allowsEdit(TimeId now) const {
|
||||||
return canStopPoll()
|
return canBeEdited()
|
||||||
&& !isTooOldForEdit(now)
|
&& !isTooOldForEdit(now)
|
||||||
&& (!_media || _media->allowsEdit())
|
&& (!_media || _media->allowsEdit())
|
||||||
&& !isLegacyMessage()
|
&& !isLegacyMessage()
|
||||||
|
|
Loading…
Reference in New Issue