The nick rule moves from internal/handlers to internal/service as ValidNick, next to validChannelRe. The HTTP API calls it for session creation and NICK, as before. The IRC listener now calls it too, for NICK before registration (handlePreRegistration) and after it (handleNick), in place of the 32-byte cut; maxNickLen is gone.
On the IRC listener a refused nick gets ERR_ERRONEUSNICKNAME (432) and changes nothing. Before registration the earlier nick stays and the refused NICK does not start registration. After registration the refused nick never reaches the service, so no NICK is broadcast.
TestNickRefused in internal/ircserver sends each case from the issue (spaces, empty, 33 characters, !, @, #) before and after registration. It checks that each 432 still names the earlier nick, that USER then registers with it, and that a second member of the channel sees no NICK and gets the sender's next message under its old nick.
Judgement call: the 432 reply echoes the refused nick, as RFC 2812 has it, so a refused nick with spaces splits that reply, which only its sender receives, into extra parameters.
Judgement call: the IRC listener does not trim spaces around a nick as the HTTP API does, so NICK :bob (trailing space) is refused.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/neoirc/issues/142
The nick rule moves from `internal/handlers` to `internal/service` as `ValidNick`, next to `validChannelRe`. The HTTP API calls it for session creation and `NICK`, as before. The IRC listener now calls it too, for `NICK` before registration (`handlePreRegistration`) and after it (`handleNick`), in place of the 32-byte cut; `maxNickLen` is gone.
On the IRC listener a refused nick gets ERR_ERRONEUSNICKNAME (432) and changes nothing. Before registration the earlier nick stays and the refused `NICK` does not start registration. After registration the refused nick never reaches the service, so no `NICK` is broadcast.
`TestNickRefused` in `internal/ircserver` sends each case from the issue (spaces, empty, 33 characters, `!`, `@`, `#`) before and after registration. It checks that each 432 still names the earlier nick, that `USER` then registers with it, and that a second member of the channel sees no `NICK` and gets the sender's next message under its old nick.
Judgement call: the 432 reply echoes the refused nick, as RFC 2812 has it, so a refused nick with spaces splits that reply, which only its sender receives, into extra parameters.
Judgement call: the IRC listener does not trim spaces around a nick as the HTTP API does, so `NICK :bob ` (trailing space) is refused.
Model: opus-5-5
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #142
The nick rule moves from
internal/handlerstointernal/serviceasValidNick, next tovalidChannelRe. The HTTP API calls it for session creation andNICK, as before. The IRC listener now calls it too, forNICKbefore registration (handlePreRegistration) and after it (handleNick), in place of the 32-byte cut;maxNickLenis gone.On the IRC listener a refused nick gets ERR_ERRONEUSNICKNAME (432) and changes nothing. Before registration the earlier nick stays and the refused
NICKdoes not start registration. After registration the refused nick never reaches the service, so noNICKis broadcast.TestNickRefusedininternal/ircserversends each case from the issue (spaces, empty, 33 characters,!,@,#) before and after registration. It checks that each 432 still names the earlier nick, thatUSERthen registers with it, and that a second member of the channel sees noNICKand gets the sender's next message under its old nick.Judgement call: the 432 reply echoes the refused nick, as RFC 2812 has it, so a refused nick with spaces splits that reply, which only its sender receives, into extra parameters.
Judgement call: the IRC listener does not trim spaces around a nick as the HTTP API does, so
NICK :bob(trailing space) is refused.Model: opus-5-5
PASS
Model: opus-5-5