From 2955d2b2c7647015348ea231c8c9dd31be82dfd0 Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 7 Nov 2011 14:30:38 +0000 Subject: [PATCH] MOTD now sent in 1 client event --- server/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 550e1af..d6d69a9 100644 --- a/server/app.js +++ b/server/app.js @@ -94,6 +94,8 @@ var ircNumerics = { RPL_BANLIST: '367', RPL_ENDOFBANLIST: '368', RPL_MOTD: '372', + RPL_MOTDSTART: '375', + RPL_ENDOFMOTD: '376', RPL_WHOISMODES: '379', ERR_NOSUCHNICK: '401', ERR_CANNOTSENDTOCHAN: '404', @@ -245,7 +247,13 @@ this.parseIRCMessage = function (websocket, ircSocket, data) { websocket.sendClientEvent('whois', rtn); break; case ircNumerics.RPL_MOTD: - websocket.sendClientEvent('motd', {server: '', "msg": msg.trailing}); + websocket.kiwi.buffer.motd += msg.trailing + '\n'; + break; + case ircNumerics.RPL_MOTDSTART: + websocket.kiwi.buffer.motd = ''; + break; + case ircNumerics.RPL_ENDOFMOTD: + websocket.sendClientEvent('motd', {server: '', 'msg': websocket.kiwi.buffer.motd}); break; case ircNumerics.RPL_NAMEREPLY: params = msg.params.split(" "); -- 2.25.1