From 5db5955b560df5933f3656a089c1e8b50b727611 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Thu, 20 Oct 2011 10:49:04 +0100 Subject: [PATCH] Restore .kiwi() --- client/js/gateway.js | 12 ++++++++++++ server/app.js | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/client/js/gateway.js b/client/js/gateway.js index decb6c0..1be71c3 100644 --- a/client/js/gateway.js +++ b/client/js/gateway.js @@ -251,4 +251,16 @@ kiwi.gateway = { kiwi.gateway.sendData(data, callback); }, + + kiwi: function (target, data, callback) { + var data = { + method: 'kiwi', + args: { + target: target, + data: data + } + }; + + kiwi.gateway.sendData(data, callback); + }, }; diff --git a/server/app.js b/server/app.js index 5e3f502..2b6d030 100644 --- a/server/app.js +++ b/server/app.js @@ -951,6 +951,11 @@ this.websocketMessage = function (websocket, msg, callback) { } break; + case 'kiwi': + if ((args.target) && (args.data)) { + websocket.sendServerLine('PRIVMSG ' + args.target + ': ' + String.fromCharCode(1) + 'KIWI ' + args.data + String.fromCharCode(1)); + } + break; default: } if ((callback) && (typeof (callback) === 'function')) { -- 2.25.1