feat: added event for online page editors (#8130)

This commit is contained in:
Nayan 2021-10-03 20:36:17 +06:00 committed by GitHub
parent 82fac6405e
commit dbb0cdef85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,6 +87,11 @@ function main() {
}
});
io.of(PAGE_EDIT_NAMESPACE).adapter.on("join-room", (room, id) => {
log.debug(`ns:${PAGE_EDIT_NAMESPACE}# socket ${id} joined the room ${room}`)
sendCurrentUsers(io.of(PAGE_EDIT_NAMESPACE), room, PAGE_ROOM_PREFIX);
});
watchMongoDB(io)
.catch((error) => log.error("Error watching MongoDB", error))