mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed rescheduling of selected and grouped scheduled messages.
This commit is contained in:
parent
5e1f0e9f7f
commit
de1f222bac
1 changed files with 7 additions and 0 deletions
|
@ -553,11 +553,18 @@ bool AddRescheduleAction(
|
||||||
}
|
}
|
||||||
const auto callback = [=](Api::SendOptions options) {
|
const auto callback = [=](Api::SendOptions options) {
|
||||||
list->cancelSelection();
|
list->cancelSelection();
|
||||||
|
auto groupedIds = std::vector<MessageGroupId>();
|
||||||
for (const auto &id : ids) {
|
for (const auto &id : ids) {
|
||||||
const auto item = owner->message(id);
|
const auto item = owner->message(id);
|
||||||
if (!item || !item->isScheduled()) {
|
if (!item || !item->isScheduled()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (const auto groupId = item->groupId()) {
|
||||||
|
if (ranges::contains(groupedIds, groupId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
groupedIds.push_back(groupId);
|
||||||
|
}
|
||||||
Api::RescheduleMessage(item, options);
|
Api::RescheduleMessage(item, options);
|
||||||
// Increase the scheduled date by 1s to keep the order.
|
// Increase the scheduled date by 1s to keep the order.
|
||||||
options.scheduled += 1;
|
options.scheduled += 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue