From: Darren Date: Fri, 22 Jul 2011 20:22:28 +0000 (+0100) Subject: CTCP fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d9e91fed8e01751a09f806b40c4531b348110dd6;p=KiwiIRC.git CTCP fixes --- diff --git a/js/front.js b/js/front.js index c76b1b7..dc7c187 100644 --- a/js/front.js +++ b/js/front.js @@ -32,8 +32,8 @@ var front = { $(gateway).bind("onsync", front.onSync); $(gateway).bind("onchannel_redirect", front.onChannelRedirect); $(gateway).bind("ondebug", front.onDebug); - $(dateway).bind("onctcp_request", front.onCTCPRequest); - $(dateway).bind("onctcp_response", front.onCTCPResponse); + $(gateway).bind("onctcp_request", front.onCTCPRequest); + $(gateway).bind("onctcp_response", front.onCTCPResponse); this.buffer = []; @@ -327,14 +327,14 @@ var front = { case 'PING': gateway.notice(data.nick, '\001PING ' + msg[1] + '\001'); break; - case 'TIME'; + case 'TIME': gateway.notice(data.nick, '\001TIME ' + (new Date()).toLocaleString() + '\001'); break; } - front.tabviews.server.addMsg(null, data.server, data.msg, 'ctcp'); + front.tabviews.server.addMsg(null, 'CTCP ['+data.nick+']', data.msg, 'ctcp'); }, - on CTCPResponse: function(e, data) { + onCTCPResponse: function(e, data) { }, onConnect: function (e, data) { diff --git a/node/kiwi.js b/node/kiwi.js index 22a806c..d7457c4 100644 --- a/node/kiwi.js +++ b/node/kiwi.js @@ -197,7 +197,8 @@ var parseIRCMessage = function (websocket, ircSocket, data) { if (msg.trailing.substr(1, 6) === 'ACTION') { websocket.emit('message', {event: 'action', nick: msg.nick, ident: msg.ident, hostname: msg.hostname, channel: msg.params.trim(), msg: msg.trailing.substr(1, msg.trailing.length - 2)}); } else if (msg.trailing.substr(1, 7) === 'VERSION') { - ircSocket.write('NOTICE ' + msg.nick + ':\001VERSION Kiwi IRC\001\r\n'); + console.log('NOTICE ' + msg.nick + ':\001VERSION KiwiIRC\001\r\n'); + ircSocket.write('NOTICE ' + msg.nick + ':\001VERSION KiwiIRC\001\r\n'); } else { websocket.emit('message', {event: 'ctcp_request', nick: msg.nick, ident: msg.ident, hostname: msg.hostname, channel: msg.params.trim(), msg: msg.trailing.substr(1, msg.trailing.length - 2)}); }