Add and use MessageInputReplyTo::add_dependencies.

This commit is contained in:
levlam 2023-10-29 11:26:21 +03:00
parent 456d2342bf
commit 23c42e937a
3 changed files with 12 additions and 0 deletions

View File

@ -162,6 +162,7 @@ bool DraftMessage::need_update_to(const DraftMessage &other, bool from_update) c
}
void DraftMessage::add_dependencies(Dependencies &dependencies) const {
message_input_reply_to_.add_dependencies(dependencies);
input_message_text_.add_dependencies(dependencies);
}

View File

@ -7,6 +7,7 @@
#include "td/telegram/MessageInputReplyTo.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/InputDialogId.h"
#include "td/telegram/MessagesManager.h"
@ -77,6 +78,12 @@ MessageInputReplyTo::MessageInputReplyTo(Td *td,
}
}
void MessageInputReplyTo::add_dependencies(Dependencies &dependencies) const {
dependencies.add_dialog_and_dependencies(dialog_id_);
add_formatted_text_dependencies(dependencies, &quote_); // just in case
dependencies.add_dialog_and_dependencies(story_full_id_.get_dialog_id()); // just in case
}
telegram_api::object_ptr<telegram_api::InputReplyTo> MessageInputReplyTo::get_input_reply_to(
Td *td, MessageId top_thread_message_id) const {
if (story_full_id_.is_valid()) {

View File

@ -19,6 +19,8 @@
namespace td {
class Dependencies;
class Td;
class MessageInputReplyTo {
@ -64,6 +66,8 @@ class MessageInputReplyTo {
return story_full_id_;
}
void add_dependencies(Dependencies &dependencies) const;
telegram_api::object_ptr<telegram_api::InputReplyTo> get_input_reply_to(Td *td,
MessageId top_thread_message_id) const;