2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add "Send when online" to the send button context menu.

This commit is contained in:
John Preston
2023-04-22 22:26:09 +04:00
parent 4201a0193c
commit e285b22398
24 changed files with 80 additions and 31 deletions

View File

@@ -502,7 +502,8 @@ void ShareBox::showMenu(not_null<Ui::RpWidget*> parent) {
_menu.get(),
sendMenuType(),
[=] { submitSilent(); },
[=] { submitScheduled(); });
[=] { submitScheduled(); },
[=] { submitWhenOnline(); });
const auto success = (result == SendMenu::FillMenuResult::Success);
if (_descriptor.forwardOptions.show || success) {
_menu->setForcedVerticalOrigin(Ui::PopupMenu::VerticalOrigin::Bottom);
@@ -599,6 +600,10 @@ void ShareBox::submitScheduled() {
Ui::LayerOption::KeepOther);
}
void ShareBox::submitWhenOnline() {
submit(Api::DefaultSendWhenOnlineOptions());
}
void ShareBox::copyLink() {
if (const auto onstack = _descriptor.copyCallback) {
onstack();