From e32b5ecad587643d0dff6289ee869a3b60ec307f Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 16 Sep 2012 13:11:44 +0100 Subject: [PATCH] KICK command --- client_backbone/dev/model_application.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client_backbone/dev/model_application.js b/client_backbone/dev/model_application.js index 8a7a4c0..7031a4d 100644 --- a/client_backbone/dev/model_application.js +++ b/client_backbone/dev/model_application.js @@ -509,6 +509,9 @@ kiwi.model.Application = Backbone.Model.extend(new (function () { controlbox.on('command_quote', this.quoteCommand); + controlbox.on('command_k', this.kickCommand); + controlbox.on('command_kick', this.kickCommand); + controlbox.on('command_css', function (ev) { var queryString = '?reload=' + new Date().getTime(); @@ -640,6 +643,20 @@ kiwi.model.Application = Backbone.Model.extend(new (function () { kiwi.gateway.raw(raw); }; + this.kickCommand = function (ev) { + var nick, panel = kiwi.app.panels.active; + + if (!panel.isChannel()) return; + + // Make sure we have a nick + if (ev.params.length === 0) return; + + nick = ev.params[0]; + ev.params.shift(); + + kiwi.gateway.kick(panel.get('name'), nick, ev.params.join(' ')); + }; + this.settingsCommand = function (ev) { var panel = new kiwi.model.Applet(); panel.load(new kiwi.applets.Settings()); -- 2.25.1