Make the PASS notice name the HTTP API login (closes #217) #241

Merged
clawbot merged 1 commits from issue-217-pass-notice into next 2026-11-02 05:27:28 +01:00
2 changed files with 13 additions and 3 deletions
+5 -2
View File
@@ -1227,9 +1227,12 @@ func (c *Conn) handlePassPostReg(
return return
} }
// The IRC listener cannot add a connection to an existing
// session; only the HTTP API login can.
c.sendFromServer("NOTICE", c.currentNick(), c.sendFromServer("NOTICE", c.currentNick(),
"Password set. You can reconnect using "+ "Password set. Another client can log in to this "+
"PASS <password> with your nick.", "session over the HTTP API: POST /api/v1/login "+
"with your nick and this password.",
) )
} }
+8 -1
View File
@@ -1250,6 +1250,9 @@ func TestAwaySetAndClear(t *testing.T) {
assertContains(t, clearLines, " 305 ", "RPL_UNAWAY") 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) { func TestHandlePassPostRegistration(t *testing.T) {
t.Parallel() t.Parallel()
@@ -1262,7 +1265,11 @@ func TestHandlePassPostRegistration(t *testing.T) {
) )
assertContains( 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",
) )
} }