From 818ef327e940edf36cc120701d0fb38377f60b88 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Wed, 27 Jul 2011 18:46:59 +0100 Subject: [PATCH] Additional errors --- js/front.js | 6 ++++++ node/kiwi.js | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/js/front.js b/js/front.js index 6a16751..301e05d 100644 --- a/js/front.js +++ b/js/front.js @@ -488,6 +488,12 @@ var front = { case 'channel_is_full': front.tabviews.server.addMsg(null, ' ', '=== ' + data.channel + ' is full.', 'status'); break; + case 'chanop_privs_needed': + front.tabviews[data.channel].addMsg(null, ' ', '=== ' + data.reason, 'status'); + break; + case 'no_such_nick': + front.tabviews.server.addMsg(null, ' ', '=== ' + data.nick + ': ' + data.reason, 'status'); + break; default: front.tabviews.server.addMsg(null, ' ', '=== ' + data, 'status'); } diff --git a/node/kiwi.js b/node/kiwi.js index 6d7f54c..e26482b 100644 --- a/node/kiwi.js +++ b/node/kiwi.js @@ -78,6 +78,7 @@ var ircNumerics = { RPL_WHOISIDLE: '317', RPL_ENDOFWHOIS: '318', RPL_WHOISCHANNELS: '319', + RPL_NOTOPIC: '331', RPL_TOPIC: '332', RPL_NAMEREPLY: '353', RPL_ENDOFNAMES: '366', @@ -93,6 +94,8 @@ var ircNumerics = { ERR_INVITEONLYCHAN: '473', ERR_BANNEDFROMCHAN: '474', ERR_BADCHANNELKEY: '475', + ERR_LINKCHANNEL: '470', + ERR_CHANOPRIVSNEEDED: '482', RPL_STARTTLS: '670' }; @@ -204,7 +207,7 @@ var parseIRCMessage = function (websocket, ircSocket, data) { websocket.emit('message', {event: 'channel_redirect', from: params[1], to: params[2]}); break; case ircNumerics.ERR_NOSUCHNICK: - //TODO: shit + websocket.emit('message', {event: 'irc_error', error: 'no_suck_nick', nick: msg.params.split(" ")[1], reason: msg.trailing}); break; case 'JOIN': websocket.emit('message', {event: 'join', nick: msg.nick, ident: msg.ident, hostname: msg.hostname, channel: msg.trailing}); @@ -239,6 +242,9 @@ var parseIRCMessage = function (websocket, ircSocket, data) { case ircNumerics.RPL_TOPIC: websocket.emit('message', {event: 'topic', nick: '', channel: msg.params.split(" ")[1], topic: msg.trailing}); break; + case ircNumerics.RPL_NOTOPIC: + websocket.emit('message', {event: 'topic', nick: '', channel: msg.params.split(" ")[1], topic:''}); + break; case 'MODE': opts = msg.params.split(" "); params = {event: 'mode', nick: msg.nick}; @@ -359,6 +365,9 @@ var parseIRCMessage = function (websocket, ircSocket, data) { case ircNumerics.ERR_BADCHANNELKEY: websocket.emit('message', {event: 'irc_error', error: 'bad_channel_key', channel: msg.params.split(" ")[1], reason: msg.trailing}); break; + case ircNumerics.ERR_CHANOPRIVSNEEDED: + websocket.emit('message', {event: 'irc_error', error: 'chanop_privs_needed', channel: msg.params.split(" ")[1], reason: msg.trailing}); + break; } } else { console.log("Unknown command.\r\n"); -- 2.25.1