|
|
@ -37,12 +37,14 @@ const recvUpdate = async (channel, data) => {
|
|
|
|
|
|
|
|
|
|
|
|
const sendInitial = async (id) => {
|
|
|
|
const sendInitial = async (id) => {
|
|
|
|
const c = connections[id]
|
|
|
|
const c = connections[id]
|
|
|
|
|
|
|
|
if (c.streamid !== null) {
|
|
|
|
const stream = await crud['streams'].getById(c.streamid)
|
|
|
|
const stream = await crud['streams'].getById(c.streamid)
|
|
|
|
c.connection.send(JSON.stringify({
|
|
|
|
c.connection.send(JSON.stringify({
|
|
|
|
event: 'streams:read',
|
|
|
|
event: 'streams:read',
|
|
|
|
data: stream,
|
|
|
|
data: stream,
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
module.exports = {
|
|
|
|
subscribe,
|
|
|
|
subscribe,
|
|
|
|