From: Jack Allnutt Date: Thu, 22 Sep 2011 01:47:05 +0000 (+0100) Subject: Can now send CTCP requests using /ctcp. Displays incoming CTCP requests not handled... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a3c7edd404cc3aa85038787683a6924145612791;p=KiwiIRC.git Can now send CTCP requests using /ctcp. Displays incoming CTCP requests not handled by the server --- diff --git a/js/front.js b/js/front.js index 2f7160f..4a17ef2 100644 --- a/js/front.js +++ b/js/front.js @@ -417,6 +417,14 @@ kiwi.front = { kiwi.gateway.kiwi(kiwi.front.cur_channel.name, msg.substring(6)); break; + case '/ctcp': + parts = parts.slice(1); + dest = parts.shift(); + msg = parts.join(' '); + + kiwi.gateway.msg(dest, String.fromCharCode(1) + msg + String.fromCharCode(1)); + kiwi.front.tabviews.server.addMsg(null, 'CTCP Request', '[to ' + dest + '] ' + msg, 'ctcp'); + break; default: //kiwi.front.cur_channel.addMsg(null, ' ', '--> Invalid command: '+parts[0].substring(1)); kiwi.gateway.raw(msg.substring(1)); @@ -513,10 +521,11 @@ kiwi.front = { kiwi.gateway.notice(data.nick, String.fromCharCode(1) + 'TIME ' + (new Date()).toLocaleString() + String.fromCharCode(1)); break; } - kiwi.front.tabviews.server.addMsg(null, 'CTCP [' + data.nick + ']', data.msg, 'ctcp'); + kiwi.front.tabviews.server.addMsg(null, 'CTCP Request', '[from ' + data.nick + '] ' + data.msg, 'ctcp'); }, onCTCPResponse: function (e, data) { + kiwi.front.tabviews.server.addMsg(null, 'CTCP Reply', '[from ' + data.nick + '] ' + data.msg, 'ctcp'); }, onKiwi: function (e, data) {