2019-08-12 12:11:34 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2019-09-13 06:06:02 +00:00
|
|
|
class History;
|
|
|
|
|
2022-11-01 04:46:31 +00:00
|
|
|
namespace Data {
|
|
|
|
class Thread;
|
|
|
|
} // namespace Data
|
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
namespace Api {
|
|
|
|
|
2023-04-22 18:26:09 +00:00
|
|
|
inline constexpr auto kScheduledUntilOnlineTimestamp = TimeId(0x7FFFFFFE);
|
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
struct SendOptions {
|
2021-11-09 15:24:13 +00:00
|
|
|
PeerData *sendAs = nullptr;
|
2019-08-12 12:11:34 +00:00
|
|
|
TimeId scheduled = 0;
|
|
|
|
bool silent = false;
|
|
|
|
bool handleSupportSwitch = false;
|
|
|
|
bool removeWebPageId = false;
|
2022-03-07 07:08:52 +00:00
|
|
|
bool hideViaBot = false;
|
2019-08-12 12:11:34 +00:00
|
|
|
};
|
2023-04-22 18:26:09 +00:00
|
|
|
[[nodiscard]] SendOptions DefaultSendWhenOnlineOptions();
|
2019-08-12 12:11:34 +00:00
|
|
|
|
2019-08-20 13:21:10 +00:00
|
|
|
enum class SendType {
|
|
|
|
Normal,
|
|
|
|
Scheduled,
|
2020-01-15 02:31:28 +00:00
|
|
|
ScheduledToUser, // For "Send when online".
|
2019-08-20 13:21:10 +00:00
|
|
|
};
|
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
struct SendAction {
|
2021-11-09 15:24:13 +00:00
|
|
|
explicit SendAction(
|
2022-11-01 04:46:31 +00:00
|
|
|
not_null<Data::Thread*> thread,
|
|
|
|
SendOptions options = SendOptions());
|
2019-08-12 12:11:34 +00:00
|
|
|
|
|
|
|
not_null<History*> history;
|
|
|
|
SendOptions options;
|
2023-05-25 09:32:13 +00:00
|
|
|
FullReplyTo replyTo;
|
2019-08-30 10:17:18 +00:00
|
|
|
bool clearDraft = true;
|
2019-08-12 12:11:34 +00:00
|
|
|
bool generateLocal = true;
|
2021-03-09 09:11:40 +00:00
|
|
|
MsgId replaceMediaOf = 0;
|
2023-05-25 09:32:13 +00:00
|
|
|
|
|
|
|
[[nodiscard]] MTPInputReplyTo mtpReplyTo() const;
|
2019-08-12 12:11:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MessageToSend {
|
2021-11-09 15:24:13 +00:00
|
|
|
explicit MessageToSend(SendAction action) : action(action) {
|
2019-08-12 12:11:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SendAction action;
|
|
|
|
TextWithTags textWithTags;
|
|
|
|
WebPageId webPageId = 0;
|
|
|
|
};
|
|
|
|
|
2021-11-16 12:38:31 +00:00
|
|
|
struct RemoteFileInfo {
|
|
|
|
MTPInputFile file;
|
|
|
|
std::optional<MTPInputFile> thumb;
|
|
|
|
std::vector<MTPInputDocument> attachedStickers;
|
|
|
|
};
|
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
} // namespace Api
|