1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 09:03:12 +02:00

Fix counting clients twice. Reported by Le_Coyote.

This commit is contained in:
Bram Matthys
2020-11-22 16:03:42 +01:00
parent bde91bcc5c
commit f808e56ffb
+16
View File
@@ -866,6 +866,12 @@ int _register_user(Client *client, char *nick, char *username, char *umode, char
/* Check G/Z lines before shuns -- kill before quite -- codemastr */
if (find_tkline_match(client, 0))
{
if (!IsDead(client) && client->local->class)
{
/* Fix client count bug, in case that it was a hold such as via authprompt */
client->local->class->clients--;
client->local->class = NULL;
}
ircstats.is_ref++;
return 0;
}
@@ -892,7 +898,17 @@ int _register_user(Client *client, char *nick, char *username, char *umode, char
{
i = (*(h->func.intfunc))(client);
if (i == HOOK_DENY)
{
if (!IsDead(client) && client->local->class)
{
/* Fix client count bug, in case that
* the HOOK_DENY was only meant temporarily.
*/
client->local->class->clients--;
client->local->class = NULL;
}
return 0;
}
if (i == HOOK_ALLOW)
break;
}