]> git.scottworley.com Git - reliable-chat/commitdiff
/nick currentnick should do nothing
authorScott Worley <sworley@chkno.net>
Sun, 19 Aug 2012 14:30:46 +0000 (07:30 -0700)
committerScott Worley <sworley@chkno.net>
Sun, 19 Aug 2012 14:30:46 +0000 (07:30 -0700)
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 {