2018-09-28 22:57:34 +02:00
|
|
|
//
|
2022-01-01 01:35:39 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
2018-09-28 22:57:34 +02:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "td/telegram/DialogId.h"
|
|
|
|
#include "td/telegram/MessageEntity.h"
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
|
|
|
|
#include "td/utils/Status.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
2022-07-22 17:11:55 +02:00
|
|
|
class Td;
|
2018-09-28 22:57:34 +02:00
|
|
|
|
|
|
|
class InputMessageText {
|
|
|
|
public:
|
|
|
|
FormattedText text;
|
|
|
|
bool disable_web_page_preview = false;
|
|
|
|
bool clear_draft = false;
|
|
|
|
InputMessageText() = default;
|
|
|
|
InputMessageText(FormattedText text, bool disable_web_page_preview, bool clear_draft)
|
|
|
|
: text(std::move(text)), disable_web_page_preview(disable_web_page_preview), clear_draft(clear_draft) {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
bool operator==(const InputMessageText &lhs, const InputMessageText &rhs);
|
|
|
|
bool operator!=(const InputMessageText &lhs, const InputMessageText &rhs);
|
|
|
|
|
2022-07-22 17:11:55 +02:00
|
|
|
Result<InputMessageText> process_input_message_text(const Td *td, DialogId dialog_id,
|
2018-09-28 22:57:34 +02:00
|
|
|
tl_object_ptr<td_api::InputMessageContent> &&input_message_content,
|
|
|
|
bool is_bot, bool for_draft = false) TD_WARN_UNUSED_RESULT;
|
|
|
|
|
|
|
|
td_api::object_ptr<td_api::inputMessageText> get_input_message_text_object(const InputMessageText &input_message_text);
|
|
|
|
|
|
|
|
} // namespace td
|