Improve logging.

This commit is contained in:
levlam 2024-01-18 14:59:53 +03:00
parent e5f9e4c400
commit 021c0bd02d
3 changed files with 12 additions and 2 deletions

View File

@ -199,4 +199,11 @@ StringBuilder &operator<<(StringBuilder &string_builder, const MessageInputReply
return string_builder << "nothing";
}
StringBuilder &operator<<(StringBuilder &string_builder, const MessageInputReplyTo *input_reply_to_ptr) {
if (input_reply_to_ptr == nullptr) {
return string_builder << "nothing";
}
return string_builder << *input_reply_to_ptr;
}
} // namespace td

View File

@ -108,4 +108,6 @@ bool operator!=(const MessageInputReplyTo &lhs, const MessageInputReplyTo &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const MessageInputReplyTo &input_reply_to);
StringBuilder &operator<<(StringBuilder &string_builder, const MessageInputReplyTo *input_reply_to_ptr);
} // namespace td

View File

@ -33242,8 +33242,9 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr
old_message->top_thread_message_id, message_id.is_yet_unsent() && !is_message_in_dialog,
is_reply_to_deleted_message)) {
LOG(ERROR) << message_id << " in " << dialog_id << " has changed replied message from "
<< old_message->replied_message_info << " to " << new_message->replied_message_info
<< ", message content type is " << old_content_type << '/' << new_content_type;
<< old_message->replied_message_info << '/' << get_message_input_reply_to(old_message) << " to "
<< new_message->replied_message_info << ", message content type is " << old_content_type << '/'
<< new_content_type;
}
}
if (is_top_thread_message_id_changed) {