mirror of
https://github.com/jech/galene.git
synced 2024-11-10 02:35:58 +01:00
Move check for incorrect username earlier.
This commit is contained in:
parent
50ad751e7d
commit
e28a390ab9
1 changed files with 5 additions and 5 deletions
10
webclient.go
10
webclient.go
|
@ -211,6 +211,11 @@ func startClient(conn *websocket.Conn) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.ContainsRune(m.Username, ' ') {
|
||||||
|
err = userError("don't put spaces in your username")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
c := &webClient{
|
c := &webClient{
|
||||||
id: m.Id,
|
id: m.Id,
|
||||||
username: m.Username,
|
username: m.Username,
|
||||||
|
@ -244,11 +249,6 @@ 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)
|
||||||
|
|
||||||
if strings.ContainsRune(m.Username, ' ') {
|
|
||||||
err = userError("don't put spaces in your username")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
g, users, err := addClient(m.Group, c, m.Username, m.Password)
|
g, users, err := addClient(m.Group, c, m.Username, m.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue