2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Added ability to schedule messages to be sent when user comes online.

Pro tip: Hold Ctrl key to send a silent scheduled message!
This commit is contained in:
23rd
2020-01-15 05:31:28 +03:00
committed by John Preston
parent 8ebbeb5274
commit c08b2ae3df
10 changed files with 68 additions and 13 deletions

View File

@@ -1937,7 +1937,9 @@ void SendFilesBox::setInnerFocus() {
void SendFilesBox::send(
Api::SendOptions options,
bool ctrlShiftEnter) {
if (_sendType == Api::SendType::Scheduled && !options.scheduled) {
if ((_sendType == Api::SendType::Scheduled
|| _sendType == Api::SendType::ScheduledToUser)
&& !options.scheduled) {
return sendScheduled();
}
@@ -1982,9 +1984,12 @@ void SendFilesBox::sendSilent() {
}
void SendFilesBox::sendScheduled() {
const auto type = (_sendType == Api::SendType::ScheduledToUser)
? SendMenuType::ScheduledToUser
: _sendMenuType;
const auto callback = [=](Api::SendOptions options) { send(options); };
Ui::show(
HistoryView::PrepareScheduleBox(this, _sendMenuType, callback),
HistoryView::PrepareScheduleBox(this, type, callback),
Ui::LayerOption::KeepOther);
}