Progress on dms, code cleanup

Progress on dms, code cleanup
This commit is contained in:
mgabdev
2020-12-02 23:22:51 -05:00
parent 20d4fc09af
commit 9a43c51085
103 changed files with 3656 additions and 859 deletions

View File

@@ -537,7 +537,8 @@ const startWorker = (workerId) => {
});
app.get('/api/v1/streaming/chat_messages', (req, res) => {
const channel = `chat_messages:${req.accountId}`;
console.log("tilly hello from inside here:", req)
const channel = `chat_messages:${req.chatConversationId}`;
streamFrom(channel, req, streamToHttp(req, res), streamHttpEnd(req, subscriptionHeartbeat(channel)));
});
@@ -550,6 +551,8 @@ const startWorker = (workerId) => {
let channel;
console.log("tilly location.query.stream:", location.query.stream)
switch (location.query.stream) {
case 'statuscard':
channel = `statuscard:${req.accountId}`;
@@ -563,7 +566,8 @@ const startWorker = (workerId) => {
streamFrom(`timeline:${req.accountId}`, req, streamToWs(req, ws), streamWsEnd(req, ws), false, true);
break;
case 'chat_messages':
streamFrom(`chat_messages:${req.accountId}`, req, streamToWs(req, ws), streamWsEnd(req, ws), false, true);
console.log("tilly incoming chat_messages:", req.chatConversationId, location.query.stream)
streamFrom(`chat_messages:${req.chatConversationId}`, req, streamToWs(req, ws), streamWsEnd(req, ws), false, true);
break;
default:
ws.close();