Make ContactsManager::get_user_has_unread_stories static.
This commit is contained in:
parent
917c9dc013
commit
515c585a13
@ -13653,7 +13653,7 @@ void ContactsManager::on_update_user_story_ids_impl(User *u, UserId user_id, Sto
|
||||
return;
|
||||
}
|
||||
|
||||
auto has_unread_stories = get_has_unread_stories(u, user_id);
|
||||
auto has_unread_stories = get_user_has_unread_stories(u);
|
||||
if (u->max_active_story_id != max_active_story_id) {
|
||||
LOG(DEBUG) << "Change last active story of " << user_id << " from " << u->max_active_story_id << " to "
|
||||
<< max_active_story_id;
|
||||
@ -13682,7 +13682,7 @@ void ContactsManager::on_update_user_story_ids_impl(User *u, UserId user_id, Sto
|
||||
u->max_read_story_id = max_read_story_id;
|
||||
u->need_save_to_database = true;
|
||||
}
|
||||
if (has_unread_stories != get_has_unread_stories(u, user_id)) {
|
||||
if (has_unread_stories != get_user_has_unread_stories(u)) {
|
||||
LOG(DEBUG) << "Change has_unread_stories of " << user_id;
|
||||
u->is_changed = true;
|
||||
}
|
||||
@ -13703,14 +13703,14 @@ void ContactsManager::on_update_user_max_read_story_id(User *u, UserId user_id,
|
||||
return;
|
||||
}
|
||||
|
||||
auto has_unread_stories = get_has_unread_stories(u, user_id);
|
||||
auto has_unread_stories = get_user_has_unread_stories(u);
|
||||
if (max_read_story_id.get() > u->max_read_story_id.get()) {
|
||||
LOG(DEBUG) << "Change last read story of " << user_id << " from " << u->max_read_story_id << " to "
|
||||
<< max_read_story_id;
|
||||
u->max_read_story_id = max_read_story_id;
|
||||
u->need_save_to_database = true;
|
||||
}
|
||||
if (has_unread_stories != get_has_unread_stories(u, user_id)) {
|
||||
if (has_unread_stories != get_user_has_unread_stories(u)) {
|
||||
LOG(DEBUG) << "Change has_unread_stories of " << user_id;
|
||||
u->is_changed = true;
|
||||
}
|
||||
@ -19178,7 +19178,7 @@ td_api::object_ptr<td_api::UserStatus> ContactsManager::get_user_status_object(U
|
||||
}
|
||||
}
|
||||
|
||||
bool ContactsManager::get_has_unread_stories(const User *u, UserId user_id) const {
|
||||
bool ContactsManager::get_user_has_unread_stories(const User *u) {
|
||||
return u->max_active_story_id.get() > u->max_read_story_id.get();
|
||||
}
|
||||
|
||||
@ -19233,8 +19233,8 @@ tl_object_ptr<td_api::user> ContactsManager::get_user_object(UserId user_id, con
|
||||
get_user_status_object(user_id, u), get_profile_photo_object(td_->file_manager_.get(), u->photo),
|
||||
std::move(emoji_status), u->is_contact, u->is_mutual_contact, u->is_close_friend, u->is_verified, u->is_premium,
|
||||
u->is_support, get_restriction_reason_description(u->restriction_reasons), u->is_scam, u->is_fake,
|
||||
u->max_active_story_id.is_valid(), get_has_unread_stories(u, user_id), have_access, std::move(type),
|
||||
u->language_code, u->attach_menu_enabled);
|
||||
u->max_active_story_id.is_valid(), get_user_has_unread_stories(u), have_access, std::move(type), u->language_code,
|
||||
u->attach_menu_enabled);
|
||||
}
|
||||
|
||||
vector<int64> ContactsManager::get_user_ids_object(const vector<UserId> &user_ids, const char *source) const {
|
||||
|
@ -1758,7 +1758,7 @@ class ContactsManager final : public Actor {
|
||||
|
||||
bool need_poll_active_stories(const User *u, UserId user_id) const;
|
||||
|
||||
bool get_has_unread_stories(const User *u, UserId user_id) const;
|
||||
static bool get_user_has_unread_stories(const User *u);
|
||||
|
||||
td_api::object_ptr<td_api::updateUser> get_update_user_object(UserId user_id, const User *u) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user