Dont allow channel names not beginning with '#'
This commit is contained in:
parent
ace62fe367
commit
5f47deeb94
|
@ -71,6 +71,10 @@ func handleCmdJoin(sv *Server, msg *irc.Message) {
|
||||||
first := false
|
first := false
|
||||||
clid := strings.ToLower(msg.Pre)
|
clid := strings.ToLower(msg.Pre)
|
||||||
chid := strings.ToLower(msg.Args[0])
|
chid := strings.ToLower(msg.Args[0])
|
||||||
|
if !strings.HasPrefix(chid, "#") {
|
||||||
|
sv.sendReply(msg.Pre, ERR_NOSUCHCHANNEL, msg.Args[0], "No such channel")
|
||||||
|
return
|
||||||
|
}
|
||||||
if _, exists := sv.chUsers[chid]; !exists {
|
if _, exists := sv.chUsers[chid]; !exists {
|
||||||
sv.chUsers[chid] = make(map[string]string)
|
sv.chUsers[chid] = make(map[string]string)
|
||||||
sv.chTopics[chid] = ""
|
sv.chTopics[chid] = ""
|
||||||
|
|
Loading…
Reference in New Issue