Invalidate user_full_contact_require_premium_ when contact_require_premium changes.

This commit is contained in:
levlam 2024-01-25 20:51:52 +03:00
parent c95cb5d75c
commit 8c2375fdfe

View File

@ -9247,8 +9247,7 @@ void ContactsManager::on_get_user(tl_object_ptr<telegram_api::User> &&user_ptr,
can_join_groups != u->can_join_groups || can_read_all_group_messages != u->can_read_all_group_messages ||
is_scam != u->is_scam || is_fake != u->is_fake || is_inline_bot != u->is_inline_bot ||
inline_query_placeholder != u->inline_query_placeholder || need_location_bot != u->need_location_bot ||
can_be_added_to_attach_menu != u->can_be_added_to_attach_menu ||
contact_require_premium != u->contact_require_premium) {
can_be_added_to_attach_menu != u->can_be_added_to_attach_menu) {
if (is_bot != u->is_bot) {
LOG_IF(ERROR, !is_deleted && !u->is_deleted && u->is_received)
<< "User.is_bot has changed for " << user_id << "/" << u->usernames << " from " << source << " from "
@ -9266,11 +9265,15 @@ void ContactsManager::on_get_user(tl_object_ptr<telegram_api::User> &&user_ptr,
u->inline_query_placeholder = std::move(inline_query_placeholder);
u->need_location_bot = need_location_bot;
u->can_be_added_to_attach_menu = can_be_added_to_attach_menu;
u->contact_require_premium = contact_require_premium;
LOG(DEBUG) << "Info has changed for " << user_id;
u->is_changed = true;
}
if (u->contact_require_premium != contact_require_premium) {
u->contact_require_premium = contact_require_premium;
u->is_changed = true;
user_full_contact_require_premium_.erase(user_id);
}
if (is_received && attach_menu_enabled != u->attach_menu_enabled) {
u->attach_menu_enabled = attach_menu_enabled;
u->is_changed = true;