List the missing channel modes in the 004 reply (closes #238)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The channel-modes parameter of RPL_MYINFO left out modes that each transport's MODE accepts. The IRC listener now sends Himnostv, adding H, i, o and v. The HTTP API now sends Hbiklmnostv, adding H, b and v. Each transport keeps its own list, because they accept different modes. The tests compare the whole parameter, so a missing or extra mode fails them. The README and the schema notes show the new HTTP API list. Model: opus-5-5
This commit was merged in pull request #240.
This commit is contained in:
@@ -412,7 +412,7 @@ func (hdlr *Handlers) deliverWelcome(
|
||||
// 004 RPL_MYINFO
|
||||
hdlr.enqueueNumeric(
|
||||
ctx, clientID, irc.RplMyInfo, nick,
|
||||
[]string{srvName, version, service.UserModes, "ikmnostl"},
|
||||
[]string{srvName, version, service.UserModes, "Hbiklmnostv"},
|
||||
"",
|
||||
)
|
||||
|
||||
|
||||
@@ -6797,9 +6797,10 @@ func TestISUPPORT(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestMyInfoListsUserModes verifies the 004 numeric lists
|
||||
// the user modes o and w as its third parameter.
|
||||
func TestMyInfoListsUserModes(t *testing.T) {
|
||||
// TestMyInfoListsModes verifies the 004 numeric lists the
|
||||
// user modes o and w as its third parameter, and the HTTP
|
||||
// API's channel modes Hbiklmnostv as its fourth.
|
||||
func TestMyInfoListsModes(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tserver := newTestServer(t)
|
||||
@@ -6813,9 +6814,10 @@ func TestMyInfoListsUserModes(t *testing.T) {
|
||||
}
|
||||
|
||||
params := getNumericParams(myInfo)
|
||||
if len(params) != 4 || params[2] != "ow" {
|
||||
if len(params) != 4 || params[2] != "ow" ||
|
||||
params[3] != "Hbiklmnostv" {
|
||||
t.Fatalf(
|
||||
"004 params %v, want four with user modes ow third",
|
||||
"004 params %v, want four ending ow Hbiklmnostv",
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ func (c *Conn) deliverWelcome() {
|
||||
)
|
||||
c.sendNumeric(
|
||||
irc.RplMyInfo,
|
||||
c.serverSfx, "neoirc", service.UserModes, "mnst",
|
||||
c.serverSfx, "neoirc", service.UserModes, "Himnostv",
|
||||
)
|
||||
c.sendNumeric(
|
||||
irc.RplIsupport,
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
@@ -486,20 +487,20 @@ func TestWelcomeContainsNick(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestMyInfoListsUserModes checks that RPL_MYINFO lists the
|
||||
// user modes o and w, with no empty parameter before the
|
||||
// channel modes.
|
||||
func TestMyInfoListsUserModes(t *testing.T) {
|
||||
// TestMyInfoListsModes checks that RPL_MYINFO lists the user
|
||||
// modes o and w, then the channel modes MODE accepts on the
|
||||
// IRC listener. It compares the whole line, so a missing or
|
||||
// extra mode fails it.
|
||||
func TestMyInfoListsModes(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
env := newTestEnv(t)
|
||||
lines := env.dial(t).register("carol")
|
||||
|
||||
assertContains(
|
||||
t, lines,
|
||||
":test.irc 004 carol test.irc neoirc ow mnst",
|
||||
"RPL_MYINFO with user modes",
|
||||
)
|
||||
want := ":test.irc 004 carol test.irc neoirc ow Himnostv"
|
||||
if !slices.Contains(lines, want) {
|
||||
t.Errorf("no line %q in %v", want, lines)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPingPong(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user