From 6d68de2c0cb7dce54d1fd79cd80fb2ff5f84a457 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 11 Aug 2023 16:45:49 +0300 Subject: [PATCH] Fix server_total_count after loading all chats from database. --- td/telegram/StoryManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index 305183a1a..5f7ada551 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -1788,6 +1788,9 @@ void StoryManager::update_story_list_sent_total_count(StoryListId story_list_id, auto new_total_count = static_cast(story_list.ordered_stories_.size()); if (story_list.list_last_story_date_ != MAX_DIALOG_DATE) { new_total_count = max(new_total_count, story_list.server_total_count_); + } else if (story_list.server_total_count_ != new_total_count) { + story_list.server_total_count_ = new_total_count; + save_story_list(story_list_id, story_list.state_, story_list.server_total_count_, story_list.server_has_more_); } if (story_list.sent_total_count_ != new_total_count) { story_list.sent_total_count_ = new_total_count;