mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 08:01:02 -04:00
Fixed pad updates.
This commit is contained in:
parent
0b48179415
commit
3a5555b0ed
1 changed files with 11 additions and 5 deletions
|
@ -397,7 +397,7 @@ exports.handleCustomObjectMessage = (msg, sessionID) => {
|
||||||
socketio.to(sessionID).emit('message', msg);
|
socketio.to(sessionID).emit('message', msg);
|
||||||
} else {
|
} else {
|
||||||
// broadcast to all clients on this pad
|
// broadcast to all clients on this pad
|
||||||
socketio.to(msg.data.payload.padId).emit('message', msg);
|
socketio.broadcast.to(msg.data.payload.padId).emit('message', msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -540,7 +540,7 @@ const handleUserInfoUpdate = async (socket, {data: {userInfo: {name, colorId}}})
|
||||||
};
|
};
|
||||||
|
|
||||||
// Send the other clients on the pad the update message
|
// Send the other clients on the pad the update message
|
||||||
socket.to(padId).emit('message', infoMsg);
|
socket.broadcast.to(padId).emit('message', infoMsg);
|
||||||
|
|
||||||
// Block until the authorManager has stored the new attributes.
|
// Block until the authorManager has stored the new attributes.
|
||||||
await p;
|
await p;
|
||||||
|
@ -1235,9 +1235,15 @@ const composePadChangesets = async (pad, startNum, endNum) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const _getRoomSockets = (padID) => {
|
const _getRoomSockets = (padID) => {
|
||||||
if (!socketio.in(padID).engine.clientsCount === 0) return [];
|
const ns = socketio.sockets;
|
||||||
const data = Object.keys(socketio.in(padID).engine.clients).map((socketId) => socketio.in(padID).engine.clients[socketId]);
|
const adapter = ns.adapter.rooms;
|
||||||
return data;
|
const room = adapter.get(padID);
|
||||||
|
const result = []
|
||||||
|
if (!room) return []
|
||||||
|
room.forEach(sID=>{
|
||||||
|
if (ns.sockets.has(sID)) result.push(ns.sockets.get(sID))
|
||||||
|
})
|
||||||
|
return result
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue