mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-19 19:14:02 +00:00
Merge pull request #2003 from overleaf/bg-use-individual-channels
support individual pubsub channels GitOrigin-RevId: e750eeb1945ddcf2c92d0d1878363f14da208984
This commit is contained in:
parent
49ac91efe6
commit
e197d58103
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue