From d07c843505005b0add55074eeaf4577d7900c51a Mon Sep 17 00:00:00 2001 From: Darren Date: Sat, 10 May 2014 21:01:43 +0100 Subject: [PATCH] CTCP request renamed to is_request --- client/src/models/gateway.js | 11 +++++++++-- server/clientcommands.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/models/gateway.js b/client/src/models/gateway.js index 7f9d641..023a08f 100644 --- a/client/src/models/gateway.js +++ b/client/src/models/gateway.js @@ -277,9 +277,9 @@ _kiwi.model.Gateway = function () { * @param {String} params Additional paramaters * @param {Function} callback A callback function */ - this.ctcp = function (connection_id, request, type, target, params, callback) { + this.ctcp = function (connection_id, is_request, type, target, params, callback) { var args = { - request: request, + is_request: is_request, type: type, target: target, params: params @@ -288,6 +288,13 @@ _kiwi.model.Gateway = function () { this.rpcCall('irc.ctcp', connection_id, args, callback); }; + this.ctcpRequest = function (connection_id, type, target, params, callback) { + this.ctcp(connection_id, true, type, target, params, callback); + }; + this.ctcpResponse = function (connection_id, type, target, params, callback) { + this.ctcp(connection_id, false, type, target, params, callback); + }; + /** * @param {String} target The target of the message (e.g. a channel or nick) * @param {String} msg The message to send diff --git a/server/clientcommands.js b/server/clientcommands.js index e7936ae..1eea2ee 100644 --- a/server/clientcommands.js +++ b/server/clientcommands.js @@ -122,7 +122,7 @@ var listeners = { ctcp: function (irc_connection, callback, args) { if ((args.target) && (args.type)) { - if (args.request) { + if (args.is_request) { irc_connection.write('PRIVMSG ' + args.target + ' :' + String.fromCharCode(1) + args.type.toUpperCase() + ' ' + args.params + String.fromCharCode(1), callback); } else { irc_connection.write('NOTICE ' + args.target + ' :' + String.fromCharCode(1) + args.type.toUpperCase() + ' ' + args.params + String.fromCharCode(1), callback); -- 2.25.1