KICK command
authorDarren <darren@darrenwhitlen.com>
Sun, 16 Sep 2012 12:11:44 +0000 (13:11 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 16 Sep 2012 12:11:44 +0000 (13:11 +0100)
client_backbone/dev/model_application.js

index 8a7a4c0111d333e5545b000c87163b41fb38d6f6..7031a4d8c2fae1b3a5ec8c1cdf220def005dcf7e 100644 (file)
@@ -509,6 +509,9 @@ kiwi.model.Application = Backbone.Model.extend(new (function () {
 \r
         controlbox.on('command_quote', this.quoteCommand);\r
 \r
+        controlbox.on('command_k', this.kickCommand);\r
+        controlbox.on('command_kick', this.kickCommand);\r
+\r
 \r
         controlbox.on('command_css', function (ev) {\r
             var queryString = '?reload=' + new Date().getTime();\r
@@ -640,6 +643,20 @@ kiwi.model.Application = Backbone.Model.extend(new (function () {
         kiwi.gateway.raw(raw);\r
     };\r
 \r
+    this.kickCommand = function (ev) {\r
+        var nick, panel = kiwi.app.panels.active;\r
+\r
+        if (!panel.isChannel()) return;\r
+\r
+        // Make sure we have a nick\r
+        if (ev.params.length === 0) return;\r
+\r
+        nick = ev.params[0];\r
+        ev.params.shift();\r
+\r
+        kiwi.gateway.kick(panel.get('name'), nick, ev.params.join(' '));\r
+    };\r
+\r
     this.settingsCommand = function (ev) {\r
         var panel = new kiwi.model.Applet();\r
         panel.load(new kiwi.applets.Settings());\r