diff --git a/group/group.go b/group/group.go index 74e4fda..32653e5 100644 --- a/group/group.go +++ b/group/group.go @@ -485,15 +485,14 @@ func AddClient(group string, c Client) (*Group, error) { g.clients[c.Id()] = c g.timestamp = time.Now() - go func(clients []Client) { - u := c.Username() - c.PushClient(c.Id(), u, true) + u := c.Username() + c.PushClient(c.Id(), u, true) + for _, c := range clients { for _, cc := range clients { - uu := cc.Username() - c.PushClient(cc.Id(), uu, true) + c.PushClient(cc.Id(), cc.Username(), true) cc.PushClient(c.Id(), u, true) } - }(clients) + } return g, nil }