2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +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

@@ -513,9 +513,19 @@ void ShareBox::keyPressEvent(QKeyEvent *e) {
SendMenu::Details ShareBox::sendMenuDetails() const {
const auto selected = _inner->selected();
const auto type = ranges::all_of(
selected | ranges::views::transform(&Data::Thread::peer),
HistoryView::CanScheduleUntilOnline)
const auto hasPaid = [&] {
for (const auto &thread : selected) {
if (thread->peer()->starsPerMessageChecked()) {
return true;
}
}
return false;
}();
const auto type = hasPaid
? SendMenu::Type::SilentOnly
: ranges::all_of(
selected | ranges::views::transform(&Data::Thread::peer),
HistoryView::CanScheduleUntilOnline)
? SendMenu::Type::ScheduledToUser
: (selected.size() == 1 && selected.front()->peer()->isSelf())
? SendMenu::Type::Reminder