Don't allow names that are the access pin
If a user tries to enter the pin as their name return an error instead of accepting the name.
This commit is contained in:
parent
8fc3f86135
commit
7feb277a33
|
@ -59,6 +59,11 @@ func (cr *ChatRoom) Join(conn *chatConnection, data common.JoinData) (*Client, e
|
|||
}
|
||||
}
|
||||
|
||||
if settings.RoomAccess == AccessPin && data.Name == settings.RoomAccessPin {
|
||||
sendHiddenMessage(common.CdNotify, "That's the access pin! Please enter a name.")
|
||||
return nil, UserFormatError{Name: data.Name}
|
||||
}
|
||||
|
||||
if !common.IsValidName(data.Name) {
|
||||
sendHiddenMessage(common.CdNotify, common.InvalidNameError)
|
||||
return nil, UserFormatError{Name: data.Name}
|
||||
|
|
Loading…
Reference in New Issue