Improve logging and fix on_topic_changed.

This commit is contained in:
levlam 2024-02-07 16:51:08 +03:00
parent e7d6a982fa
commit 2ca4672a98
2 changed files with 6 additions and 4 deletions

View File

@ -13328,8 +13328,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
}
} else {
if (message->saved_messages_topic_id.is_valid()) {
LOG(ERROR) << "Receive Saved Messages topic " << message_info.saved_messages_topic_id << " for " << message_id
<< " in " << dialog_id;
LOG(ERROR) << "Receive Saved Messages " << message_info.saved_messages_topic_id << " for " << message_id << " in "
<< dialog_id;
message->saved_messages_topic_id = SavedMessagesTopicId();
}
}

View File

@ -381,7 +381,7 @@ void SavedMessagesManager::do_set_topic_last_message_id(SavedMessagesTopic *topi
}
CHECK(last_message_id == MessageId() || last_message_id.is_valid());
LOG(INFO) << "Set last message in topic " << topic->saved_messages_topic_id_ << " to " << last_message_id;
LOG(INFO) << "Set last message in " << topic->saved_messages_topic_id_ << " to " << last_message_id;
topic->last_message_id_ = last_message_id;
topic->last_message_date_ = last_message_date;
topic->is_changed_ = true;
@ -415,10 +415,11 @@ void SavedMessagesManager::on_topic_draft_message_updated(SavedMessagesTopicId s
int32 draft_message_date) {
auto *topic = get_topic(saved_messages_topic_id);
if (topic == nullptr) {
LOG(INFO) << "Updated draft in unknown " << saved_messages_topic_id;
return;
}
LOG(INFO) << "Set draft message date in topic " << topic->saved_messages_topic_id_ << " to " << draft_message_date;
LOG(INFO) << "Set draft message date in " << topic->saved_messages_topic_id_ << " to " << draft_message_date;
topic->draft_message_date_ = draft_message_date;
topic->is_changed_ = true;
@ -442,6 +443,7 @@ void SavedMessagesManager::on_topic_changed(SavedMessagesTopic *topic, const cha
if (!topic->is_changed_) {
return;
}
topic->is_changed_ = false;
if (topic->private_order_ != 0) {
bool is_deleted = topic_list_.ordered_topics_.erase({topic->private_order_, topic->saved_messages_topic_id_}) > 0;