mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
working and jsonify obj
This commit is contained in:
parent
2916b39c24
commit
9bb0587447
1 changed files with 3 additions and 5 deletions
|
@ -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 msg {Object} the message we're sending
|
||||||
* @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
|
||||||
|
@ -263,10 +264,7 @@ function handleSaveRevisionMessage(client, message){
|
||||||
exports.handleCustomObjectMessage = function (msg, sessionID, cb) {
|
exports.handleCustomObjectMessage = function (msg, sessionID, cb) {
|
||||||
if(msg.data.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
|
||||||
console.warn("Sent msg", msg);
|
socketio.sockets.socket(sessionID).json.send(msg); // send a targeted message
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue