Add logging in set_topic_last_message_id.

This commit is contained in:
levlam 2024-02-05 10:30:04 +03:00
parent 741b0fc6af
commit 00984e1ebd
2 changed files with 3 additions and 0 deletions

View File

@ -324,6 +324,7 @@ SavedMessagesManager::SavedMessagesTopic *SavedMessagesManager::add_topic(
auto &result = saved_messages_topics_[saved_messages_topic_id];
if (result == nullptr) {
result = make_unique<SavedMessagesTopic>();
result->saved_messages_topic_id_ = saved_messages_topic_id;
}
return result.get();
}
@ -341,6 +342,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;
topic->last_message_id_ = last_message_id;
topic->is_changed_ = true;
}

View File

@ -59,6 +59,7 @@ class SavedMessagesManager final : public Actor {
static constexpr int32 MAX_GET_HISTORY = 100; // server side limit
struct SavedMessagesTopic {
SavedMessagesTopicId saved_messages_topic_id_;
MessageId last_message_id_;
bool is_changed_ = true;
};