]> git.scottworley.com Git - reliable-chat/blobdiff - webclient/rc.html
/nick currentnick should do nothing
[reliable-chat] / webclient / rc.html
index d06f515e4328a307b910747c863bf196710e063e..2e05a86312a4868ac7088e61ab081b8422b22e4d 100644 (file)
 
        function rcinput(input) {
                var message;
 
        function rcinput(input) {
                var message;
-               var re = /^\/(\S+)(\s(.*))?/
+               var re = /^\/(\S+)(\s(.*))?/;
                var match = re.exec(input);
                if (match) {
                        var command = match[1];
                var match = re.exec(input);
                if (match) {
                        var command = match[1];
                        if (command == 'me') {
                                message = "* " + rcnick() + "  " + rest;
                        } else if (command == 'nick') {
                        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 {
                                message = "*** " + rcnick() + " is now known as " + rest;
                                rcsetnick(rest);
                        } else {