diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-04-25 19:23:46 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-04-25 19:23:46 +0200 |
commit | 1158d4534befb29f7049981381d1acdbe933a00e (patch) | |
tree | 7947e80d0ef3f6323276a8cdd6e0f6c553ed8827 /chatserver.html | |
parent | 705363b98b841f0f2e0f0bf5f1b270bdfcea6915 (diff) |
Better nickname management
Diffstat (limited to 'chatserver.html')
-rw-r--r-- | chatserver.html | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chatserver.html b/chatserver.html index 02c0b1a..2b46d5c 100644 --- a/chatserver.html +++ b/chatserver.html @@ -108,10 +108,8 @@ ws.addEventListener("message",function(msg){ else if(cmd[0]=="#yournick")nick=cmd[1]; else if(cmd[0]=="#lobbylist")updateLobbyList(cmd.slice(1)); else if(cmd[0]=="#nicklist")updateNickList(cmd.slice(1)); - else if(cmd[0]=="#nick"){ - addMessageLine("--","<"+cmd[1]+"> is now known as <"+cmd[2]+">"); - if(cmd[1]==nick)nick=cmd[2]; - } else if(cmd[0]=="#join")addMessageLine("--","<"+cmd[1]+"> joined the lobby"); + else if(cmd[0]=="#nick")addMessageLine("--","<"+cmd[1]+"> is now known as <"+cmd[2]+">"); + else if(cmd[0]=="#join")addMessageLine("--","<"+cmd[1]+"> joined the lobby"); else if(cmd[0]=="#part")addMessageLine("--","<"+cmd[1]+"> left the lobby"); else if(cmd[0]=="#lobby")highlightLobby(cmd[1]); else if(cmd[0]=="#historystart")clearMessageHistory(); |