Make the '#' optional in join command
authorCory Chaplin <cory.chaplin@laposte.net>
Sun, 23 Feb 2014 21:50:20 +0000 (22:50 +0100)
committerCory Chaplin <cory.chaplin@laposte.net>
Sun, 23 Feb 2014 21:50:20 +0000 (22:50 +0100)
client/src/models/application.js

index bc60a95be33d6a0023fbe4773fe91e1d23e12cbe..df79770e2a507030c8cb4d6acc3ad0f1dddef6de 100644 (file)
     function joinCommand (ev) {\r
         var panels, channel_names;\r
 \r
+        // Add a # in front of the first channel if missing\r
+        if (ev.params[0].substring(0,1) != '#') {\r
+            ev.params[0] = '#' + ev.params[0];\r
+        }\r
+        \r
         channel_names = ev.params.join(' ').split(',');\r
         panels = this.connections.active_connection.createAndJoinChannels(channel_names);\r
 \r