diff options
Diffstat (limited to 'go-src/windows.go')
| -rw-r--r-- | go-src/windows.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/go-src/windows.go b/go-src/windows.go index 183849e..3bc621c 100644 --- a/go-src/windows.go +++ b/go-src/windows.go @@ -54,6 +54,10 @@ func registerWindow(values ...string) { if len(inputs) == 0 { return } + if usernameExists(inputs[0]) { + defer showError(valueAlreadyTaken("Username"), registerWindow, values...) + return + } createUser(inputs) logInUser(inputs[0], inputs[1]) @@ -92,6 +96,10 @@ func createChatWindow(values ...string) { if len(inputs) == 0 { return } + if chatNameExists(inputs[0]) { + defer showError(valueAlreadyTaken("Chat name"), createChatWindow, values...) + return + } createChat(inputs[0], inputs[1], loggedInUser.Username) defer chatWindow(inputs[0]) |
