mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-06-07 19:03:17 +03:00
List returns the actual name instead of the lowercase
This commit is contained in:
parent
1bf8f73eb2
commit
4938e4afe3
@ -236,11 +236,11 @@ func (s *Server) Rename(client *Client, newName string) {
|
|||||||
func (s *Server) List(prefix *string) []string {
|
func (s *Server) List(prefix *string) []string {
|
||||||
r := []string{}
|
r := []string{}
|
||||||
|
|
||||||
for name := range s.clients {
|
for name, client := range s.clients {
|
||||||
if prefix != nil && !strings.HasPrefix(name, strings.ToLower(*prefix)) {
|
if prefix != nil && !strings.HasPrefix(name, strings.ToLower(*prefix)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
r = append(r, name)
|
r = append(r, client.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
Loading…
x
Reference in New Issue
Block a user