Commit 917fa33d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't duplicate username in call to addClient.

parent 208f023d
...@@ -203,13 +203,13 @@ type userid struct { ...@@ -203,13 +203,13 @@ type userid struct {
username string username string
} }
func addClient(name string, c client, user, pass string) (*group, error) { func addClient(name string, c client, pass string) (*group, error) {
g, err := addGroup(name, nil) g, err := addGroup(name, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} }
perms, err := getPermission(g.description, user, pass) perms, err := getPermission(g.description, c.Username(), pass)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -647,7 +647,7 @@ func startClient(conn *websocket.Conn) (err error) { ...@@ -647,7 +647,7 @@ func startClient(conn *websocket.Conn) (err error) {
c.writerDone = make(chan struct{}) c.writerDone = make(chan struct{})
go clientWriter(conn, c.writeCh, c.writerDone) go clientWriter(conn, c.writeCh, c.writerDone)
g, err := addClient(m.Group, c, m.Username, m.Password) g, err := addClient(m.Group, c, m.Password)
if err != nil { if err != nil {
return return
} }
...@@ -975,7 +975,7 @@ func handleClientMessage(c *webClient, m clientMessage) error { ...@@ -975,7 +975,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
group: c.group, group: c.group,
id: "recording", id: "recording",
} }
_, err := addClient(c.group.name, disk, "", "") _, err := addClient(c.group.name, disk, "")
if err != nil { if err != nil {
disk.Close() disk.Close()
return c.error(err) return c.error(err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment