List returns the actual name instead of the lowercase

This commit is contained in:
Murilo Santana 2014-12-16 23:19:41 -02:00
parent 1bf8f73eb2
commit 4938e4afe3
1 changed files with 2 additions and 2 deletions

View File

@ -236,11 +236,11 @@ func (s *Server) Rename(client *Client, newName string) {
func (s *Server) List(prefix *string) []string {
r := []string{}
for name := range s.clients {
for name, client := range s.clients {
if prefix != nil && !strings.HasPrefix(name, strings.ToLower(*prefix)) {
continue
}
r = append(r, name)
r = append(r, client.Name)
}
return r