From: Darren Date: Sat, 10 May 2014 20:01:43 +0000 (+0100) Subject: CTCP request renamed to is_request X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d07c843505005b0add55074eeaf4577d7900c51a;p=KiwiIRC.git CTCP request renamed to is_request --- 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);