Fix IRC listener relay of bodies and modes, and JOIN names (closes #127)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The IRC listener relayed only the first line of a PRIVMSG or NOTICE body; it now sends one line per body line. A MODE change reached IRC listener members without its key, limit or mask, and "+o bob" went out as one trailing parameter; each value is now its own parameter, in the relay and in the echo to the IRC listener user who made the change. Every line written to an IRC listener connection now has CR, LF and NUL removed, so a stored body line, key or mask cannot start a line of its own. The channel name check moved from the HTTP handler into service.JoinChannel, so the IRC listener's JOIN refuses the same names with 403. Model: opus-5-5
This commit is contained in:
@@ -29,10 +29,6 @@ var validNickRe = regexp.MustCompile(
|
||||
`^[a-zA-Z_][a-zA-Z0-9_\-\[\]\\^{}|` + "`" + `]{0,31}$`,
|
||||
)
|
||||
|
||||
var validChannelRe = regexp.MustCompile(
|
||||
`^#[a-zA-Z0-9_\-]{1,63}$`,
|
||||
)
|
||||
|
||||
var validUsernameRe = regexp.MustCompile(
|
||||
`^[a-zA-Z0-9_\-\[\]\\^{}|` + "`" + `]{1,32}$`,
|
||||
)
|
||||
@@ -1489,16 +1485,6 @@ func (hdlr *Handlers) handleJoin(
|
||||
channel = "#" + channel
|
||||
}
|
||||
|
||||
if !validChannelRe.MatchString(channel) {
|
||||
hdlr.respondIRCError(
|
||||
writer, request, clientID, sessionID,
|
||||
irc.ErrNoSuchChannel, nick, []string{channel},
|
||||
"No such channel",
|
||||
)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Extract key from body lines (JOIN #channel key).
|
||||
var suppliedKey string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user