Allow sending inline result preview in scheduled messages
This commit is contained in:
parent
9e640c3f5c
commit
4b7a6b82c0
3 changed files with 15 additions and 10 deletions
|
|
@ -49,6 +49,7 @@ FillMenuResult FillSendMenu(
|
|||
}
|
||||
const auto now = type;
|
||||
if (now == Type::Disabled
|
||||
|| now == Type::PreviewOnly
|
||||
|| (!silent && now == Type::SilentOnly)) {
|
||||
return FillMenuResult::None;
|
||||
}
|
||||
|
|
@ -83,15 +84,17 @@ FillMenuResult FillSendPreviewMenu(
|
|||
if (defaultSend) {
|
||||
menu->addAction(ktr("ktg_send_preview"), defaultSend);
|
||||
}
|
||||
if (silent && now != Type::Reminder) {
|
||||
menu->addAction(ktr("ktg_send_silent_preview"), silent);
|
||||
}
|
||||
if (schedule && now != Type::SilentOnly) {
|
||||
menu->addAction(
|
||||
(now == Type::Reminder
|
||||
? ktr("ktg_reminder_preview")
|
||||
: ktr("ktg_schedule_preview")),
|
||||
schedule);
|
||||
if (type != Type::PreviewOnly) {
|
||||
if (silent && now != Type::Reminder) {
|
||||
menu->addAction(ktr("ktg_send_silent_preview"), silent);
|
||||
}
|
||||
if (schedule && now != Type::SilentOnly) {
|
||||
menu->addAction(
|
||||
(now == Type::Reminder
|
||||
? ktr("ktg_reminder_preview")
|
||||
: ktr("ktg_schedule_preview")),
|
||||
schedule);
|
||||
}
|
||||
}
|
||||
return FillMenuResult::Success;
|
||||
}
|
||||
|
|
@ -127,6 +130,7 @@ void SetupMenuAndShortcuts(
|
|||
|
||||
const auto now = type();
|
||||
if (now == Type::Disabled
|
||||
|| now == Type::PreviewOnly
|
||||
|| (!silent && now == Type::SilentOnly)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ enum class Type {
|
|||
Scheduled,
|
||||
ScheduledToUser, // For "Send when online".
|
||||
Reminder,
|
||||
PreviewOnly,
|
||||
};
|
||||
|
||||
enum class FillMenuResult {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ ScheduledWidget::ScheduledWidget(
|
|||
this,
|
||||
controller,
|
||||
ComposeControls::Mode::Scheduled,
|
||||
SendMenu::Type::Disabled))
|
||||
SendMenu::Type::PreviewOnly))
|
||||
, _scrollDown(_scroll, st::historyToDown) {
|
||||
const auto state = Dialogs::EntryState{
|
||||
.key = _history,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue