Check nicks on the IRC listener with the HTTP API's rule (closes #142)
check / check (push) Waiting to run

The nick rule moves from internal/handlers to internal/service as
ValidNick, and the HTTP API and both IRC listener NICK paths call it.
The IRC listener used to cut a nick to 32 bytes and accept anything
else, so a nick with spaces such as "bob PRIVMSG #inj :hi" made the
lines built from it read as another user's PRIVMSG. It now answers a
nick the rule refuses with ERR_ERRONEUSNICKNAME (432), before and
after registration, and keeps the nick as it was.

Model: opus-5-5
This commit is contained in:
2026-10-20 15:10:40 +00:00
parent eceb5f2b2c
commit 75daebb72f
6 changed files with 96 additions and 15 deletions
+5 -3
View File
@@ -249,9 +249,11 @@ what channel bans (`+b` mode) match against.
hold the same nick simultaneously.
- Nicks are **case-sensitive** (unlike traditional IRC). `Alice` and `alice` are
different nicks.
- Nick length: 1–32 characters. Over the HTTP API a nick starts with a letter or
`_`, followed by letters, digits and `` _-[]\^{}|` ``. The IRC listener cuts a
longer nick to 32 bytes and checks nothing else.
- Nick length: 1–32 characters. A nick starts with a letter or `_`, followed by
letters, digits and `` _-[]\^{}|` ``. The HTTP API and the IRC listener both
apply this rule. On the IRC listener, a `NICK` with any other nick, before or
after registration, gets ERR_ERRONEUSNICKNAME (432) and leaves the nick as it
was.
- Nicks are **released when a session is destroyed** (via `QUIT` command or
session expiry). There is no nick registration or reservation system.
- Nick changes are broadcast to all users sharing a channel with the changer, as