diff --git a/internal/ircserver/commands.go b/internal/ircserver/commands.go index 43e00e5..0eef420 100644 --- a/internal/ircserver/commands.go +++ b/internal/ircserver/commands.go @@ -1226,9 +1226,12 @@ func (c *Conn) handlePassPostReg( return } + // The IRC listener cannot add a connection to an existing + // session; only the HTTP API login can. c.sendFromServer("NOTICE", c.currentNick(), - "Password set. You can reconnect using "+ - "PASS with your nick.", + "Password set. Another client can log in to this "+ + "session over the HTTP API: POST /api/v1/login "+ + "with your nick and this password.", ) } diff --git a/internal/ircserver/server_test.go b/internal/ircserver/server_test.go index 17a142d..523e613 100644 --- a/internal/ircserver/server_test.go +++ b/internal/ircserver/server_test.go @@ -1142,6 +1142,9 @@ func TestAwaySetAndClear(t *testing.T) { assertContains(t, clearLines, " 305 ", "RPL_UNAWAY") } +// TestHandlePassPostRegistration checks the NOTICE that +// confirms PASS after registration. It points to the HTTP API +// login, the only way to add a client to an existing session. func TestHandlePassPostRegistration(t *testing.T) { t.Parallel() @@ -1154,7 +1157,11 @@ func TestHandlePassPostRegistration(t *testing.T) { ) assertContains( - t, lines, "Password set", "password confirmation", + t, lines, + " NOTICE passuser :Password set. Another client can log "+ + "in to this session over the HTTP API: "+ + "POST /api/v1/login with your nick and this password.", + "password confirmation", ) }