diff --git a/internal/ircserver/commands.go b/internal/ircserver/commands.go index 2a8b75a..c2b4e16 100644 --- a/internal/ircserver/commands.go +++ b/internal/ircserver/commands.go @@ -1227,9 +1227,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 7c397f7..bff359c 100644 --- a/internal/ircserver/server_test.go +++ b/internal/ircserver/server_test.go @@ -1250,6 +1250,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() @@ -1262,7 +1265,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", ) }