From acb952794479c17110b3de2e9b83f0546c989cd1 Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Mon, 2 Nov 2026 05:27:27 +0100 Subject: [PATCH] Make the PASS notice name the HTTP API login (closes #217) After PASS on the IRC listener, the confirming NOTICE told the user to reconnect with PASS and their nick. The IRC listener cannot add a connection to an existing session, so that step does not work. The notice now says the password is set and that another client can log in to the session over the HTTP API with POST /api/v1/login, as the README describes. The test now checks the whole notice text. Model: opus-5-5 --- internal/ircserver/commands.go | 7 +++++-- internal/ircserver/server_test.go | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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", ) }