1
0
Fork 0
forked from External/ergo

names command

This commit is contained in:
Jeremy Latt 2014-02-17 21:02:03 -08:00
parent 046723a709
commit b17e62d0b0
4 changed files with 41 additions and 3 deletions

View file

@ -629,3 +629,22 @@ func (msg *ClientIdle) HandleServer(server *Server) {
client := msg.Client()
client.Reply(RplPing(server, client))
}
func (msg *NamesCommand) HandleServer(server *Server) {
client := msg.Client()
if len(server.channels) == 0 {
for _, channel := range server.channels {
channel.Names(client)
}
return
}
for _, chname := range msg.channels {
channel := server.channels[chname]
if channel == nil {
client.Reply(ErrNoSuchChannel(server, chname))
continue
}
channel.Names(client)
}
}