MOTD now sent in 1 client event
authorDarren <darren@darrenwhitlen.com>
Mon, 7 Nov 2011 14:30:38 +0000 (14:30 +0000)
committerDarren <darren@darrenwhitlen.com>
Mon, 7 Nov 2011 14:30:38 +0000 (14:30 +0000)
server/app.js

index 550e1af1c4bb81e68d281780996ad4dbde237ed1..d6d69a918d64ee4c3fc32f3b77f3548ba2b092c8 100644 (file)
@@ -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(" ");