Improve MessageReplyInfo logging and updating.

This commit is contained in:
levlam 2023-07-24 15:56:03 +03:00
parent 62677720fc
commit 5110a188b2
2 changed files with 8 additions and 2 deletions

View File

@ -101,6 +101,10 @@ bool MessageReplyInfo::need_update_to(const MessageReplyInfo &other) const {
// ignore updates to empty reply info, because we will hide the info ourselves
// return true;
}
if (other.is_comment_ != is_comment_ && !other.was_dropped()) {
LOG(ERROR) << "Reply info has changed from " << *this << " to " << other;
return true;
}
if (other.pts_ < pts_ && !other.was_dropped()) {
return false;
}
@ -222,10 +226,11 @@ StringBuilder &operator<<(StringBuilder &string_builder, const MessageReplyInfo
if (reply_info.is_comment_) {
return string_builder << reply_info.reply_count_ << " comments in " << reply_info.channel_id_ << " by "
<< reply_info.recent_replier_dialog_ids_ << " read up to "
<< reply_info.last_read_inbox_message_id_ << "/" << reply_info.last_read_outbox_message_id_;
<< reply_info.last_read_inbox_message_id_ << '/' << reply_info.last_read_outbox_message_id_
<< " with PTS " << reply_info.pts_;
} else {
return string_builder << reply_info.reply_count_ << " replies read up to " << reply_info.last_read_inbox_message_id_
<< "/" << reply_info.last_read_outbox_message_id_;
<< "/" << reply_info.last_read_outbox_message_id_ << " with PTS " << reply_info.pts_;
}
}

View File

@ -7188,6 +7188,7 @@ bool MessagesManager::update_message_interaction_info(Dialog *d, Message *m, int
LOG(DEBUG) << "Update interaction info of " << full_message_id << " from " << m->view_count << '/'
<< m->forward_count << '/' << m->reply_info << '/' << m->reactions << " to " << view_count << '/'
<< forward_count << '/' << reply_info << '/' << reactions
<< ", need_update_reply_info = " << need_update_reply_info
<< ", need_update_reactions = " << need_update_reactions
<< ", need_update_unread_reactions = " << need_update_unread_reactions
<< ", need_update_chosen_reaction_order = " << need_update_chosen_reaction_order;