Support RepliedMessageInfo logging.

This commit is contained in:
levlam 2023-10-26 01:11:36 +03:00
parent d839e5b68c
commit e791c98757
2 changed files with 15 additions and 0 deletions

View File

@ -199,4 +199,15 @@ bool operator!=(const RepliedMessageInfo &lhs, const RepliedMessageInfo &rhs) {
return !(lhs == rhs);
}
StringBuilder &operator<<(StringBuilder &string_builder, const RepliedMessageInfo &info) {
string_builder << "reply to " << info.message_id_;
if (info.dialog_id_ != DialogId()) {
string_builder << " in " << info.dialog_id_;
}
if (info.origin_date_ != 0) {
string_builder << " sent at " << info.origin_date_ << " by " << info.origin_;
}
return string_builder;
}
} // namespace td

View File

@ -31,6 +31,8 @@ class RepliedMessageInfo {
friend bool operator==(const RepliedMessageInfo &lhs, const RepliedMessageInfo &rhs);
friend StringBuilder &operator<<(StringBuilder &string_builder, const RepliedMessageInfo &info);
public:
RepliedMessageInfo() = default;
@ -82,4 +84,6 @@ bool operator==(const RepliedMessageInfo &lhs, const RepliedMessageInfo &rhs);
bool operator!=(const RepliedMessageInfo &lhs, const RepliedMessageInfo &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const RepliedMessageInfo &info);
} // namespace td