mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Disable reschedule/edit-media for processing.
This commit is contained in:
parent
472a2fe802
commit
e38998214f
6 changed files with 18 additions and 8 deletions
|
@ -1521,17 +1521,17 @@ sendGifBox: Box(defaultBox) {
|
|||
}
|
||||
|
||||
processingVideoTipMaxWidth: 364px;
|
||||
processingVideoTipShift: 10px;
|
||||
processingVideoTipShift: 8px;
|
||||
processingVideoToast: Toast(defaultToast) {
|
||||
minWidth: 32px;
|
||||
maxWidth: 380px;
|
||||
padding: margins(19px, 17px, 19px, 16px);
|
||||
padding: margins(19px, 17px, 19px, 17px);
|
||||
}
|
||||
processingVideoPreviewSkip: 0px;
|
||||
processingVideoPreviewSkip: 8px;
|
||||
processingVideoView: RoundButton(defaultActiveButton) {
|
||||
width: -24px;
|
||||
height: 68px;
|
||||
textTop: 26px;
|
||||
height: 52px;
|
||||
textTop: 17px;
|
||||
textFg: mediaviewTextLinkFg;
|
||||
textFgOver: mediaviewTextLinkFg;
|
||||
textBg: transparent;
|
||||
|
|
|
@ -2212,6 +2212,10 @@ bool HistoryItem::allowsSendNow() const {
|
|||
&& !isEditingMedia();
|
||||
}
|
||||
|
||||
bool HistoryItem::allowsReschedule() const {
|
||||
return allowsSendNow() && !awaitingVideoProcessing();
|
||||
}
|
||||
|
||||
bool HistoryItem::allowsForward() const {
|
||||
return !isService()
|
||||
&& isRegular()
|
||||
|
@ -2236,7 +2240,8 @@ bool HistoryItem::allowsEdit(TimeId now) const {
|
|||
}
|
||||
|
||||
bool HistoryItem::allowsEditMedia() const {
|
||||
return !_media || _media->allowsEditMedia();
|
||||
return !awaitingVideoProcessing()
|
||||
&& (!_media || _media->allowsEditMedia());
|
||||
}
|
||||
|
||||
bool HistoryItem::canBeEdited() const {
|
||||
|
|
|
@ -429,6 +429,7 @@ public:
|
|||
[[nodiscard]] bool forbidsForward() const;
|
||||
[[nodiscard]] bool forbidsSaving() const;
|
||||
[[nodiscard]] bool allowsSendNow() const;
|
||||
[[nodiscard]] bool allowsReschedule() const;
|
||||
[[nodiscard]] bool allowsForward() const;
|
||||
[[nodiscard]] bool allowsEdit(TimeId now) const;
|
||||
[[nodiscard]] bool allowsEditMedia() const;
|
||||
|
|
|
@ -522,7 +522,7 @@ bool AddRescheduleAction(
|
|||
const auto owner = &request.navigation->session().data();
|
||||
|
||||
const auto goodSingle = HasEditMessageAction(request, list)
|
||||
&& request.item->isScheduled();
|
||||
&& request.item->allowsReschedule();
|
||||
const auto goodMany = [&] {
|
||||
if (goodSingle) {
|
||||
return false;
|
||||
|
@ -534,7 +534,7 @@ bool AddRescheduleAction(
|
|||
if (items.size() > kRescheduleLimit) {
|
||||
return false;
|
||||
}
|
||||
return ranges::all_of(items, &SelectedItem::canSendNow);
|
||||
return ranges::all_of(items, &SelectedItem::canReschedule);
|
||||
}();
|
||||
if (!goodSingle && !goodMany) {
|
||||
return false;
|
||||
|
|
|
@ -1183,6 +1183,7 @@ auto ListWidget::collectSelectedItems() const -> SelectedItems {
|
|||
result.canDelete = selection.canDelete;
|
||||
result.canForward = selection.canForward;
|
||||
result.canSendNow = selection.canSendNow;
|
||||
result.canReschedule = selection.canReschedule;
|
||||
return result;
|
||||
};
|
||||
auto items = SelectedItems();
|
||||
|
@ -1317,6 +1318,7 @@ bool ListWidget::addToSelection(
|
|||
iterator->second.canDelete = item->canDelete();
|
||||
iterator->second.canForward = item->allowsForward();
|
||||
iterator->second.canSendNow = item->allowsSendNow();
|
||||
iterator->second.canReschedule = item->allowsReschedule();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ struct SelectedItem {
|
|||
bool canDelete = false;
|
||||
bool canForward = false;
|
||||
bool canSendNow = false;
|
||||
bool canReschedule = false;
|
||||
};
|
||||
|
||||
struct MessagesBar {
|
||||
|
@ -232,6 +233,7 @@ struct SelectionData {
|
|||
bool canDelete = false;
|
||||
bool canForward = false;
|
||||
bool canSendNow = false;
|
||||
bool canReschedule = false;
|
||||
};
|
||||
|
||||
using SelectedMap = base::flat_map<
|
||||
|
|
Loading…
Add table
Reference in a new issue