diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 0f9a04f7f..5ec98b39f 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -11889,7 +11889,7 @@ void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, boo } if (u->is_is_contact_changed) { td_->messages_manager_->on_dialog_user_is_contact_updated(DialogId(user_id), u->is_contact); - td_->story_manager_->on_dialog_active_stories_order_updated(DialogId(user_id)); + td_->story_manager_->on_dialog_active_stories_order_updated(DialogId(user_id), "is_contact"); if (is_user_contact(u, user_id, false)) { auto user_full = get_user_full(user_id); if (user_full != nullptr && user_full->need_phone_number_privacy_exception) { @@ -11911,7 +11911,7 @@ void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, boo u->is_is_deleted_changed = false; } if (u->is_is_premium_changed) { - td_->story_manager_->on_dialog_active_stories_order_updated(DialogId(user_id)); + td_->story_manager_->on_dialog_active_stories_order_updated(DialogId(user_id), "is_premium"); u->is_is_premium_changed = false; } if (u->is_name_changed) { @@ -11948,7 +11948,7 @@ void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, boo } } if (u->is_stories_hidden_changed) { - td_->story_manager_->on_dialog_active_stories_order_updated(DialogId(user_id)); + td_->story_manager_->on_dialog_active_stories_order_updated(DialogId(user_id), "stories_hidden"); u->is_stories_hidden_changed = false; } if (!td_->auth_manager_->is_bot()) { diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index 77fb4c6cf..0e6bfbba9 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -1085,7 +1085,7 @@ void StoryManager::on_load_active_stories( if (story_list.list_last_story_date_ < max_story_date) { story_list.list_last_story_date_ = max_story_date; for (auto owner_dialog_id : owner_dialog_ids) { - on_dialog_active_stories_order_updated(owner_dialog_id); + on_dialog_active_stories_order_updated(owner_dialog_id, "on_load_active_stories"); } } else if (is_next) { LOG(ERROR) << "Last story date didn't increase"; @@ -2483,7 +2483,8 @@ bool StoryManager::are_dialog_stories_hidden(DialogId owner_dialog_id) const { } } -void StoryManager::on_dialog_active_stories_order_updated(DialogId owner_dialog_id) { +void StoryManager::on_dialog_active_stories_order_updated(DialogId owner_dialog_id, const char *source) { + LOG(INFO) << "Update order of active stories in " << owner_dialog_id << " from " << source; auto active_stories = get_active_stories_editable(owner_dialog_id); if (active_stories != nullptr && update_active_stories_order(owner_dialog_id, active_stories)) { send_update_active_stories(owner_dialog_id); diff --git a/td/telegram/StoryManager.h b/td/telegram/StoryManager.h index 823070b4d..370064271 100644 --- a/td/telegram/StoryManager.h +++ b/td/telegram/StoryManager.h @@ -193,7 +193,7 @@ class StoryManager final : public Actor { bool on_update_read_stories(DialogId owner_dialog_id, StoryId max_read_story_id); - void on_dialog_active_stories_order_updated(DialogId owner_dialog_id); + void on_dialog_active_stories_order_updated(DialogId owner_dialog_id, const char *source); Status can_get_story_viewers(StoryFullId story_full_id, const Story *story) const;