make sure the sessionID target is right
parent
d0e656d0a6
commit
2916b39c24
|
@ -156,7 +156,6 @@ exports.handleMessage = function(client, message)
|
||||||
// handleMessage will be called, even if the client is not authorized
|
// handleMessage will be called, even if the client is not authorized
|
||||||
hooks.aCallAll("handleMessage", { client: client, message: message }, function ( err, messages ) {
|
hooks.aCallAll("handleMessage", { client: client, message: message }, function ( err, messages ) {
|
||||||
if(ERR(err, callback)) return;
|
if(ERR(err, callback)) return;
|
||||||
|
|
||||||
_.each(messages, function(newMessage){
|
_.each(messages, function(newMessage){
|
||||||
if ( newMessage === null ) {
|
if ( newMessage === null ) {
|
||||||
dropMessage = true;
|
dropMessage = true;
|
||||||
|
@ -193,6 +192,7 @@ exports.handleMessage = function(client, message)
|
||||||
handleSuggestUserName(client, message);
|
handleSuggestUserName(client, message);
|
||||||
} else {
|
} else {
|
||||||
messageLogger.warn("Dropped message, unknown COLLABROOM Data Type " + message.data.type);
|
messageLogger.warn("Dropped message, unknown COLLABROOM Data Type " + message.data.type);
|
||||||
|
console.warn(message);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
messageLogger.warn("Dropped message, unknown Message Type " + message.type);
|
messageLogger.warn("Dropped message, unknown Message Type " + message.type);
|
||||||
|
@ -261,9 +261,12 @@ function handleSaveRevisionMessage(client, message){
|
||||||
* @param sessionID {string} the socketIO session to which we're sending this message
|
* @param sessionID {string} the socketIO session to which we're sending this message
|
||||||
*/
|
*/
|
||||||
exports.handleCustomObjectMessage = function (msg, sessionID, cb) {
|
exports.handleCustomObjectMessage = function (msg, sessionID, cb) {
|
||||||
if(msg.type === "CUSTOM"){
|
if(msg.data.type === "CUSTOM"){
|
||||||
if(sessionID){ // If a sessionID is targeted then send directly to this sessionID
|
if(sessionID){ // If a sessionID is targeted then send directly to this sessionID
|
||||||
io.sockets.socket(sessionID).emit(msg); // send a targeted message
|
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
|
||||||
}else{
|
}else{
|
||||||
socketio.sockets.in(msg.data.padId).json.send(msg); // broadcast to all clients on this pad
|
socketio.sockets.in(msg.data.padId).json.send(msg); // broadcast to all clients on this pad
|
||||||
}
|
}
|
||||||
|
@ -1496,3 +1499,5 @@ exports.padUsers = function (padID, callback) {
|
||||||
callback(null, {padUsers: result});
|
callback(null, {padUsers: result});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.sessioninfos = sessioninfos;
|
||||||
|
|
Loading…
Reference in New Issue