From 9bb05874475a1dfab177dc42a003e91b5724ea00 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 19 Mar 2013 16:40:51 +0000 Subject: [PATCH 1/2] working and jsonify obj --- src/node/handler/PadMessageHandler.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 4b7abb6b..9fa9c39c 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -255,7 +255,8 @@ function handleSaveRevisionMessage(client, message){ } /** - * Handles a custom message, different to the function below as it handles objects not strings and you can direct the message to specific sessionID + * Handles a custom message, different to the function below as it handles objects not strings and you can + * direct the message to specific sessionID * * @param msg {Object} the message we're sending * @param sessionID {string} the socketIO session to which we're sending this message @@ -263,10 +264,7 @@ function handleSaveRevisionMessage(client, message){ exports.handleCustomObjectMessage = function (msg, sessionID, cb) { if(msg.data.type === "CUSTOM"){ if(sessionID){ // If a sessionID is targeted then send directly to this sessionID - console.warn("Sent msg", msg); - console.warn("to sessionID", sessionID); - // socketio.clients[sessionID].send(msg); - socketio.sockets.socket(sessionID).emit(msg); // send a targeted message + socketio.sockets.socket(sessionID).json.send(msg); // send a targeted message }else{ socketio.sockets.in(msg.data.padId).json.send(msg); // broadcast to all clients on this pad } From a9bd081a44ea4a338a025420457f55248e012b0f Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 19 Mar 2013 16:55:42 +0000 Subject: [PATCH 2/2] more clean up --- src/node/handler/PadMessageHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 9fa9c39c..954c116d 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -192,7 +192,6 @@ exports.handleMessage = function(client, message) handleSuggestUserName(client, message); } else { messageLogger.warn("Dropped message, unknown COLLABROOM Data Type " + message.data.type); -console.warn(message); } } else { messageLogger.warn("Dropped message, unknown Message Type " + message.type);