]> git.scottworley.com Git - reliable-chat/commitdiff
/me support
authorJason Hibbs <skitch@gmail.com>
Fri, 3 Aug 2012 01:05:32 +0000 (18:05 -0700)
committerJason Hibbs <skitch@gmail.com>
Fri, 3 Aug 2012 01:15:25 +0000 (18:15 -0700)
webclient/rc.html

index 3417745d75be14f6f683072f2abbc4c1b4aeec11..4c0555896e0e95df17f125cf026faba1fce64997 100644 (file)
                                message = "<" + rcnick() + "> " + input;
                        }
 
+                       // /me support
+                       var message;
+                       var re = /^\/me (.*)/;
+                       var match = re.exec(input);
+                       var inputme = input.substring(4);
+                       if (match) {
+                               message = "* " + rcnick() + "  " + inputme;
+                       } else {
+                               message = "<" + rcnick() + "> " + input;
+                       }
+
                        // Remind people to set their nick
                        if (rcnick() == 'anonymous') {
                                rcaddmessagetohistory("-!- Set your nick with /nick");