xD/xS: NICK without USER would block nicks forever

This commit is contained in:
2026-07-21 17:32:32 +02:00
parent 49e76b49de
commit 5295733629
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -887,7 +887,14 @@ static void
client_unregister (struct client *c, const char *reason)
{
if (!c->registered)
{
if (c->nickname)
{
str_map_set (&c->ctx->users, c->nickname, NULL);
cstr_set (&c->nickname, NULL);
}
return;
}
char *message = xstrdup_printf (":%s!%s@%s QUIT :%s",
c->nickname, c->username, c->hostname, reason);
+4
View File
@@ -910,6 +910,10 @@ func (c *client) nicknameOrStar() string {
func (c *client) unregister(reason string) {
if !c.registered {
if c.nickname != "" {
delete(users, ircToCanon(c.nickname))
c.nickname = ""
}
return
}