aboutsummaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-08 16:12:43 +0000
committerGravatar Sadie Powell2023-01-08 16:28:40 +0000
commit8831595e1a5306f4204fedc6ecbc4a3c9299fb35 (patch)
treef9f27322d35d199240dfeca82415ec94724f2ff9 /src/usermanager.cpp
parentSwitch sqloper to use a local user lookup instead of IS_LOCAL. (diff)
Rework how users are assigned to connect classes.
- Move core connect class checks and <performance:clonesonconnect> to the core_user module. - Add pre-change and post-change events for when a connect class changes. - Split explicit class changing out into its own method. - Remove the need to almost always call CheckClass after SetClass. - Add use counting to the connect class instead of relying on the shared_ptr use count.
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index bcb6e58d3..25fd9317e 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -173,12 +173,8 @@ void UserManager::AddUser(int socket, ListenSocket* via, const irc::sockets::soc
return;
}
- // First class check. We do this again in LocalUser::FullConnect() after DNS is done, and NICK/USER is received.
- New->SetClass();
- // If the user doesn't have an acceptable connect class CheckClass() quits them
- New->CheckClass(ServerInstance->Config->CCOnConnect);
- if (New->quitting)
- return;
+ if (!New->FindConnectClass())
+ return; // User does not match any connect classes.
/*
* even with bancache, we still have to keep User::exempt current.
@@ -296,6 +292,8 @@ void UserManager::QuitUser(User* user, const std::string& quitmessage, const std
user->GetIPString().c_str(), operquitmsg.c_str());
}
local_users.erase(lu);
+ if (lu->GetClass())
+ lu->GetClass()->use_count--;
}
if (!clientlist.erase(user->nick))