From: Darren Date: Mon, 4 Mar 2013 21:56:22 +0000 (+0000) Subject: /ctcp command implimented into the client #177 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b1042f3d0c90a9ec3e46f3f5d9419d01e8eed9a2;p=KiwiIRC.git /ctcp command implimented into the client #177 --- diff --git a/client/assets/dev/model_application.js b/client/assets/dev/model_application.js index 50a3b15..2c4b2d3 100644 --- a/client/assets/dev/model_application.js +++ b/client/assets/dev/model_application.js @@ -457,6 +457,11 @@ _kiwi.model.Application = function () { }); + gw.on('onctcp_response', function (event) { + that.panels.server.addMsg('[' + event.nick + ']', 'CTCP ' + event.msg); + }); + + gw.on('onnotice', function (event) { var panel; @@ -833,6 +838,8 @@ _kiwi.model.Application = function () { controlbox.on('command_clear', clearCommand); + controlbox.on('command_ctcp', ctcpCommand); + controlbox.on('command_css', function (ev) { var queryString = '?reload=' + new Date().getTime(); @@ -1044,6 +1051,21 @@ _kiwi.model.Application = function () { } } + function ctcpCommand(ev) { + var target, type; + + // Make sure we have a target and a ctcp type (eg. version, time) + if (ev.params.length < 2) return; + + target = ev.params[0]; + ev.params.shift(); + + type = ev.params[0]; + ev.params.shift(); + + _kiwi.gateway.ctcp(true, type, target, ev.params.join(' ')); + } + function settingsCommand (ev) { var settings = _kiwi.model.Applet.loadOnce('kiwi_settings'); settings.view.show();