mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 12:24:25 +02:00
Merge pull request #2003 from overleaf/bg-use-individual-channels
support individual pubsub channels GitOrigin-RevId: e750eeb1945ddcf2c92d0d1878363f14da208984
This commit is contained in:
@@ -26,8 +26,14 @@ module.exports = EditorRealTimeController = {
|
||||
emitToRoom(room_id, message, ...payload) {
|
||||
// create a unique message id using a counter
|
||||
const message_id = `web:${HOST}:${RND}-${COUNT++}`
|
||||
var channel
|
||||
if (room_id === 'all' || !Settings.publishOnIndividualChannels) {
|
||||
channel = 'editor-events'
|
||||
} else {
|
||||
channel = `editor-events:${room_id}`
|
||||
}
|
||||
return rclient.publish(
|
||||
'editor-events',
|
||||
channel,
|
||||
JSON.stringify({
|
||||
room_id,
|
||||
message,
|
||||
|
||||
Reference in New Issue
Block a user