1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 23:35:46 +01:00

Don't duplicate username in call to addClient.

This commit is contained in:
Juliusz Chroboczek 2020-06-08 22:31:12 +02:00
parent 208f023d9e
commit 917fa33d38
2 changed files with 4 additions and 4 deletions

View file

@ -203,13 +203,13 @@ type userid struct {
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)
if err != nil {
return nil, err
}
perms, err := getPermission(g.description, user, pass)
perms, err := getPermission(g.description, c.Username(), pass)
if err != nil {
return nil, err
}

View file

@ -647,7 +647,7 @@ func startClient(conn *websocket.Conn) (err error) {
c.writerDone = make(chan struct{})
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 {
return
}
@ -975,7 +975,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
group: c.group,
id: "recording",
}
_, err := addClient(c.group.name, disk, "", "")
_, err := addClient(c.group.name, disk, "")
if err != nil {
disk.Close()
return c.error(err)