Check top_thread_message_id during object parsing.

This commit is contained in:
levlam 2023-10-25 16:14:36 +03:00
parent 27b9ad4526
commit bd923a36eb
2 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,10 @@ MessageReplyHeader::MessageReplyHeader(Td *td, tl_object_ptr<telegram_api::Messa
if (!message_id.is_scheduled() && can_have_thread) {
if ((reply_header->flags_ & telegram_api::messageReplyHeader::REPLY_TO_TOP_ID_MASK) != 0) {
top_thread_message_id_ = MessageId(ServerMessageId(reply_header->reply_to_top_id_));
if (!top_thread_message_id_.is_valid()) {
LOG(ERROR) << "Receive " << to_string(reply_header);
top_thread_message_id_ = MessageId();
}
}
is_topic_message_ = reply_header->forum_topic_;
}

View File

@ -24554,10 +24554,7 @@ void MessagesManager::fix_server_reply_to_message_id(DialogId dialog_id, Message
}
return;
}
if (reply_to_message_id != MessageId()) {
LOG(ERROR) << "Receive reply to " << reply_to_message_id << " for " << message_id << " in " << dialog_id;
reply_to_message_id = MessageId();
}
CHECK(reply_to_message_id == MessageId());
return;
}