Add the # to RPL_ENDOFWHO for an unknown channel over HTTP (closes #249)
check / check (push) Waiting to run
check / check (push) Waiting to run
WHO over the HTTP API adds a missing # to the channel name, but the unknown-channel path sent RPL_ENDOFWHO with the name as sent. A client keyed on the channel name saw two spellings. Both paths now send the name with the #. Model: opus-5-5
This commit is contained in:
@@ -3238,7 +3238,7 @@ func (hdlr *Handlers) handleWho(
|
||||
// 315 RPL_ENDOFWHO (empty result)
|
||||
hdlr.enqueueNumeric(
|
||||
ctx, clientID, irc.RplEndOfWho, nick,
|
||||
[]string{target},
|
||||
[]string{channel},
|
||||
"End of /WHO list",
|
||||
)
|
||||
hdlr.broker.Notify(sessionID)
|
||||
|
||||
@@ -4039,6 +4039,31 @@ func assertWhoReplyUsername(
|
||||
)
|
||||
}
|
||||
|
||||
func TestWhoUnknownChannelEndReplyAddsHash(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tserver := newTestServer(t)
|
||||
|
||||
token := tserver.createSession("whoasker")
|
||||
|
||||
_, lastID := tserver.pollMessages(token, 0)
|
||||
|
||||
msgs, _ := sendAndPoll(tserver, token, lastID, map[string]any{
|
||||
commandKey: irc.CmdWho,
|
||||
toKey: "nosuch",
|
||||
})
|
||||
|
||||
endOfWho := findNumericWithParams(msgs, "315")
|
||||
if endOfWho == nil {
|
||||
t.Fatalf("expected RPL_ENDOFWHO (315), got %v", msgs)
|
||||
}
|
||||
|
||||
params := getNumericParams(endOfWho)
|
||||
if !slices.Equal(params, []string{"#nosuch"}) {
|
||||
t.Fatalf("expected params [#nosuch], got %v", params)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSessionUsernameDefault(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user