Reject JOIN with invalid channel names

This prevents us from storing typo'ed channel names in the DB.
This commit is contained in:
Simon Ser 2021-05-26 11:21:37 +02:00
parent 4b6a529b69
commit 517be78868

View file

@ -1435,6 +1435,15 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
key = keys[i]
}
if !uc.isChannel(upstreamName) {
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.ERR_NOSUCHCHANNEL,
Params: []string{name, "Not a channel name"},
})
continue
}
params := []string{upstreamName}
if key != "" {
params = append(params, key)