From: Darren Date: Mon, 14 Jul 2014 20:38:56 +0000 (+0100) Subject: Convert any non-commands sent into non channel/query panels into a command X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=039146eac41d97d323557d1cff36074f2ef40f85;p=KiwiIRC.git Convert any non-commands sent into non channel/query panels into a command --- diff --git a/client/src/views/controlbox.js b/client/src/views/controlbox.js index dbe30ac..6a71bde 100644 --- a/client/src/views/controlbox.js +++ b/client/src/views/controlbox.js @@ -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. //)