Inline is_same_chat_reply.

This commit is contained in:
levlam 2023-10-28 21:11:24 +03:00
parent 8a17168315
commit ac7e48351e
4 changed files with 2 additions and 13 deletions

View File

@ -131,7 +131,7 @@ td_api::object_ptr<td_api::InputMessageReplyTo> MessageInputReplyTo::get_input_m
}
MessageId MessageInputReplyTo::get_same_chat_reply_to_message_id() const {
return is_same_chat_reply() ? message_id_ : MessageId();
return message_id_.is_valid() || message_id_.is_valid_scheduled() ? message_id_ : MessageId();
}
MessageFullId MessageInputReplyTo::get_reply_message_full_id(DialogId owner_dialog_id) const {

View File

@ -57,10 +57,6 @@ class MessageInputReplyTo {
return !is_empty();
}
bool is_same_chat_reply() const {
return message_id_.is_valid() || message_id_.is_valid_scheduled();
}
StoryFullId get_story_full_id() const {
return story_full_id_;
}

View File

@ -75,9 +75,6 @@ RepliedMessageInfo::RepliedMessageInfo(Td *td, tl_object_ptr<telegram_api::messa
message_id_ = MessageId();
dialog_id_ = DialogId();
}
if (dialog_id_ == dialog_id) {
dialog_id_ = DialogId(); // just in case
}
}
if (!message_id_.is_valid()) {
LOG(ERROR) << "Receive " << to_string(reply_header) << " in " << MessageFullId{dialog_id, message_id};
@ -300,7 +297,7 @@ MessageInputReplyTo RepliedMessageInfo::get_input_reply_to() const {
}
MessageId RepliedMessageInfo::get_same_chat_reply_to_message_id() const {
return is_same_chat_reply() ? message_id_ : MessageId();
return dialog_id_ == DialogId() && origin_date_ == 0 ? message_id_ : MessageId();
}
MessageFullId RepliedMessageInfo::get_reply_message_full_id(DialogId owner_dialog_id) const {

View File

@ -61,10 +61,6 @@ class RepliedMessageInfo {
RepliedMessageInfo(Td *td, const MessageInputReplyTo &input_reply_to);
bool is_same_chat_reply() const {
return dialog_id_ == DialogId() && origin_date_ == 0;
}
bool is_empty() const {
return message_id_ == MessageId() && dialog_id_ == DialogId() && origin_date_ == 0 && origin_.is_empty() &&
quote_.text.empty() && content_ == nullptr;