Count services in the global user count.

This behaviour was always kinda broken so lets just drop it.
This commit is contained in:
Sadie Powell 2024-10-10 15:08:31 +01:00
parent b9b3c03ccd
commit b21ec4e9a9
2 changed files with 4 additions and 7 deletions

View File

@ -174,7 +174,7 @@ public:
/** Return a count of fully connected connections on the network.
* @return The number of fully connected users on the network.
*/
size_t GlobalUserCount() const { return this->clientlist.size() - this->UnknownUserCount() - this->ServiceCount(); }
size_t GlobalUserCount() const { return this->clientlist.size() - this->UnknownUserCount(); }
/** Get a hash map containing all users, keyed by their nickname
* @return A hash map mapping nicknames to User pointers

View File

@ -50,7 +50,7 @@ struct LusersCounters final
{
for (const auto& [_, u] : ServerInstance->Users.GetUsers())
{
if (!u->server->IsService() && u->IsModeSet(invisiblemode))
if (u->IsModeSet(invisiblemode))
invisible++;
}
}
@ -135,9 +135,6 @@ public:
if (!dest->IsFullyConnected())
return;
if (dest->server->IsService())
return;
if (change.adding)
invisible++;
else
@ -166,13 +163,13 @@ public:
void OnPostConnect(User* user) override
{
counters.UpdateMaxUsers();
if (!user->server->IsService() && user->IsModeSet(invisiblemode))
if (user->IsModeSet(invisiblemode))
counters.invisible++;
}
void OnUserQuit(User* user, const std::string& message, const std::string& oper_message) override
{
if (!user->server->IsService() && user->IsModeSet(invisiblemode))
if (user->IsModeSet(invisiblemode))
counters.invisible--;
}
};