mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-11-23 04:26:51 +01:00
Add Client::init_message.
This commit is contained in:
parent
a3f62fcdf7
commit
a731cb0083
@ -12915,7 +12915,14 @@ Client::FullMessageId Client::add_message(object_ptr<td_api::message> &&message,
|
||||
message_info = td::make_unique<MessageInfo>();
|
||||
}
|
||||
|
||||
message_info->id = message_id;
|
||||
init_message(message_info.get(), std::move(message), force_update_content);
|
||||
|
||||
return {chat_id, message_id};
|
||||
}
|
||||
|
||||
void Client::init_message(MessageInfo *message_info, object_ptr<td_api::message> &&message, bool force_update_content) {
|
||||
int64 chat_id = message->chat_id_;
|
||||
message_info->id = message->id_;
|
||||
message_info->chat_id = chat_id;
|
||||
message_info->message_thread_id = message->message_thread_id_;
|
||||
message_info->date = message->date_;
|
||||
@ -12997,11 +13004,9 @@ Client::FullMessageId Client::add_message(object_ptr<td_api::message> &&message,
|
||||
} else if (message->content_->get_id() == td_api::messagePoll::ID) {
|
||||
message_info->content = std::move(message->content_);
|
||||
}
|
||||
set_message_reply_markup(message_info.get(), std::move(message->reply_markup_));
|
||||
set_message_reply_markup(message_info, std::move(message->reply_markup_));
|
||||
|
||||
message = nullptr;
|
||||
|
||||
return {chat_id, message_id};
|
||||
}
|
||||
|
||||
void Client::update_message_content(int64 chat_id, int64 message_id, object_ptr<td_api::MessageContent> &&content) {
|
||||
|
@ -924,7 +924,7 @@ class Client final : public WebhookActor::Callback {
|
||||
static bool are_equal_inline_keyboards(const td_api::replyMarkupInlineKeyboard *lhs,
|
||||
const td_api::replyMarkupInlineKeyboard *rhs);
|
||||
|
||||
void set_message_reply_markup(MessageInfo *message_info, object_ptr<td_api::ReplyMarkup> &&reply_markup);
|
||||
static void set_message_reply_markup(MessageInfo *message_info, object_ptr<td_api::ReplyMarkup> &&reply_markup);
|
||||
|
||||
static int64 get_sticker_set_id(const object_ptr<td_api::MessageContent> &content);
|
||||
|
||||
@ -975,6 +975,7 @@ class Client final : public WebhookActor::Callback {
|
||||
};
|
||||
|
||||
FullMessageId add_message(object_ptr<td_api::message> &&message, bool force_update_content = false);
|
||||
void init_message(MessageInfo *message_info, object_ptr<td_api::message> &&message, bool force_update_content);
|
||||
const MessageInfo *get_message(int64 chat_id, int64 message_id, bool force_cache) const;
|
||||
MessageInfo *get_message_editable(int64 chat_id, int64 message_id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user