2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

Update API scheme, disable scheduled paid.

This commit is contained in:
John Preston
2025-02-25 11:36:51 +04:00
parent 7b7e18e752
commit ee9d0cfd99
14 changed files with 78 additions and 16 deletions

View File

@@ -1175,7 +1175,8 @@ void Filler::addCreatePoll() {
: Api::SendType::Normal;
const auto sendMenuType = (_request.section == Section::Scheduled)
? SendMenu::Type::Disabled
: (_request.section == Section::Replies)
: (_request.section == Section::Replies
|| _peer->starsPerMessageChecked())
? SendMenu::Type::SilentOnly
: SendMenu::Type::Scheduled;
const auto flag = PollData::Flags();
@@ -2420,7 +2421,17 @@ QPointer<Ui::BoxContent> ShowForwardMessagesBox(
const auto sendMenuType = [=] {
const auto selected = state->box->collectSelectedRows();
return ranges::all_of(selected, HistoryView::CanScheduleUntilOnline)
const auto hasPaid = [&] {
for (const auto peer : selected) {
if (peer->starsPerMessageChecked()) {
return true;
}
}
return false;
}();
return hasPaid
? SendMenu::Type::SilentOnly
: ranges::all_of(selected, HistoryView::CanScheduleUntilOnline)
? SendMenu::Type::ScheduledToUser
: ((selected.size() == 1) && selected.front()->isSelf())
? SendMenu::Type::Reminder