Pass default DialogId to get_reply_message_full_id.

This commit is contained in:
levlam 2023-10-24 18:54:32 +03:00
parent 2d7b2b4545
commit 4425eadc3c
4 changed files with 8 additions and 5 deletions

View File

@ -5846,7 +5846,7 @@ unique_ptr<MessageContent> get_action_message_content(Td *td, tl_object_ptr<tele
break;
}
auto action = move_tl_object_as<telegram_api::messageActionPaymentSent>(action_ptr);
auto message_full_id = replied_message_info.get_reply_message_full_id();
auto message_full_id = replied_message_info.get_reply_message_full_id(DialogId());
if (!message_full_id.get_message_id().is_valid()) {
if (message_full_id.get_message_id() != MessageId()) {
LOG(ERROR) << "Receive successful payment message with " << message_full_id << " in " << owner_dialog_id;

View File

@ -14427,7 +14427,7 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
date = 1;
}
auto reply_message_full_id = message_info.reply_header.replied_message_info_.get_reply_message_full_id();
auto reply_message_full_id = message_info.reply_header.replied_message_info_.get_reply_message_full_id(DialogId());
MessageId reply_to_message_id = reply_message_full_id.get_message_id();
DialogId reply_in_dialog_id = reply_message_full_id.get_dialog_id();
MessageId top_thread_message_id = message_info.reply_header.top_thread_message_id_;

View File

@ -80,8 +80,11 @@ MessageId RepliedMessageInfo::get_same_chat_reply_to_message_id() const {
return is_same_chat_reply() ? message_id_ : MessageId();
}
MessageFullId RepliedMessageInfo::get_reply_message_full_id() const {
return {dialog_id_, message_id_};
MessageFullId RepliedMessageInfo::get_reply_message_full_id(DialogId owner_dialog_id) const {
if (!message_id_.is_valid() && !message_id_.is_valid_scheduled()) {
return {};
}
return {dialog_id_.is_valid() ? dialog_id_ : owner_dialog_id, message_id_};
}
bool operator==(const RepliedMessageInfo &lhs, const RepliedMessageInfo &rhs) {

View File

@ -44,7 +44,7 @@ class RepliedMessageInfo {
MessageId get_same_chat_reply_to_message_id() const;
MessageFullId get_reply_message_full_id() const;
MessageFullId get_reply_message_full_id(DialogId owner_dialog_id) const;
template <class StorerT>
void store(StorerT &storer) const;