Add source to StoryManager::on_dialog_active_stories_order_updated.

This commit is contained in:
levlam 2023-07-07 15:52:55 +03:00
parent 1737fde5a5
commit 7a3604d5b6
3 changed files with 7 additions and 6 deletions

View File

@ -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()) {

View File

@ -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);

View File

@ -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;