code: Send userlist before adding new registered user to avoid duplicate.

master
ALI Hamza 2019-09-25 08:06:11 +07:00
parent 93caeaf45a
commit 9f8799bfff
No known key found for this signature in database
GPG Key ID: BCA8A46C87798C4C
1 changed files with 1 additions and 2 deletions

@ -78,10 +78,9 @@ func handleIncomingMessage(sender *websocket.Conn, msg string) {
sender.WriteJSON(newError("You have an illegal nickname"))
return
}
sendUserList(sender)
usernames[sender] = username
sendUserList(sender)
m := newMessage("server", username+" has joined the chat")
m.dispatch()
return