Convert any non-commands sent into non channel/query panels into a command
authorDarren <darren@darrenwhitlen.com>
Mon, 14 Jul 2014 20:38:56 +0000 (21:38 +0100)
committerDarren <darren@darrenwhitlen.com>
Mon, 14 Jul 2014 20:38:56 +0000 (21:38 +0100)
client/src/views/controlbox.js

index dbe30ac3e30c28000f113c264a75729b75b8f91f..6a71bde4f125d9f6ca4a10738d8a465cf2dd74fb 100644 (file)
@@ -240,6 +240,12 @@ _kiwi.view.ControlBox = Backbone.View.extend({
         var command, params,
             pre_processed;
 
+        // If sending a message when not in a channel or query window, automatically
+        // convert it into a command
+        if (command_raw[0] !== '/' && !_kiwi.app.panels().active.isChannel() && !_kiwi.app.panels().active.isQuery()) {
+            command_raw = '/' + command_raw;
+        }
+
         // The default command
         if (command_raw[0] !== '/' || command_raw.substr(0, 2) === '//') {
             // Remove any slash escaping at the start (ie. //)