2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +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

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_common.h"
#include "base/qt/qt_key_modifiers.h"
#include "data/data_thread.h"
namespace Api {
@@ -20,4 +21,11 @@ SendAction::SendAction(
, topicRootId(replyTo) {
}
SendOptions DefaultSendWhenOnlineOptions() {
return {
.scheduled = kScheduledUntilOnlineTimestamp,
.silent = base::IsCtrlPressed(),
};
}
} // namespace Api

View File

@@ -15,6 +15,8 @@ class Thread;
namespace Api {
inline constexpr auto kScheduledUntilOnlineTimestamp = TimeId(0x7FFFFFFE);
struct SendOptions {
PeerData *sendAs = nullptr;
TimeId scheduled = 0;
@@ -23,6 +25,7 @@ struct SendOptions {
bool removeWebPageId = false;
bool hideViaBot = false;
};
[[nodiscard]] SendOptions DefaultSendWhenOnlineOptions();
enum class SendType {
Normal,