X-Git-Url: http://git.scottworley.com/reliable-chat/blobdiff_plain/112df9d11e5a30edba4bdcb065d68e182ef1d694..219b6a2b2ef21772217935e79398305a086000d7:/webclient/rc.html

diff --git a/webclient/rc.html b/webclient/rc.html
index d06f515..2e05a86 100644
--- a/webclient/rc.html
+++ b/webclient/rc.html
@@ -443,7 +443,7 @@
 
 	function rcinput(input) {
 		var message;
-		var re = /^\/(\S+)(\s(.*))?/
+		var re = /^\/(\S+)(\s(.*))?/;
 		var match = re.exec(input);
 		if (match) {
 			var command = match[1];
@@ -451,6 +451,10 @@
 			if (command == 'me') {
 				message = "* " + rcnick() + "  " + rest;
 			} else if (command == 'nick') {
+				if (rcnick() == rest) {
+					rcaddmessagetoUI({'Text': '-!- Your nick is already ' + rcnick(), 'ServerTimes': {}});
+					return;
+				}
 				message = "*** " + rcnick() + " is now known as " + rest;
 				rcsetnick(rest);
 			} else {