|
@@ -485,7 +485,8 @@ const startWorker = (workerId) => {
|
|
});
|
|
});
|
|
|
|
|
|
app.get('/api/v1/streaming/direct', (req, res) => {
|
|
app.get('/api/v1/streaming/direct', (req, res) => {
|
|
- streamFrom(`timeline:direct:${req.accountId}`, req, streamToHttp(req, res), streamHttpEnd(req), true);
|
|
|
|
|
|
+ const channel = `timeline:direct:${req.accountId}`;
|
|
|
|
+ streamFrom(channel, req, streamToHttp(req, res), streamHttpEnd(req, subscriptionHeartbeat(channel)), true);
|
|
});
|
|
});
|
|
|
|
|
|
app.get('/api/v1/streaming/hashtag', (req, res) => {
|
|
app.get('/api/v1/streaming/hashtag', (req, res) => {
|
|
@@ -525,9 +526,11 @@ const startWorker = (workerId) => {
|
|
ws.isAlive = true;
|
|
ws.isAlive = true;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ let channel;
|
|
|
|
+
|
|
switch(location.query.stream) {
|
|
switch(location.query.stream) {
|
|
case 'user':
|
|
case 'user':
|
|
- const channel = `timeline:${req.accountId}`;
|
|
|
|
|
|
+ channel = `timeline:${req.accountId}`;
|
|
streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel)));
|
|
streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel)));
|
|
break;
|
|
break;
|
|
case 'user:notification':
|
|
case 'user:notification':
|
|
@@ -546,7 +549,8 @@ const startWorker = (workerId) => {
|
|
streamFrom('timeline:public:local:media', req, streamToWs(req, ws), streamWsEnd(req, ws), true);
|
|
streamFrom('timeline:public:local:media', req, streamToWs(req, ws), streamWsEnd(req, ws), true);
|
|
break;
|
|
break;
|
|
case 'direct':
|
|
case 'direct':
|
|
- streamFrom(`timeline:direct:${req.accountId}`, req, streamToWs(req, ws), streamWsEnd(req, ws), true);
|
|
|
|
|
|
+ channel = `timeline:direct:${req.accountId}`;
|
|
|
|
+ streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel)), true);
|
|
break;
|
|
break;
|
|
case 'hashtag':
|
|
case 'hashtag':
|
|
streamFrom(`timeline:hashtag:${location.query.tag.toLowerCase()}`, req, streamToWs(req, ws), streamWsEnd(req, ws), true);
|
|
streamFrom(`timeline:hashtag:${location.query.tag.toLowerCase()}`, req, streamToWs(req, ws), streamWsEnd(req, ws), true);
|
|
@@ -563,7 +567,7 @@ const startWorker = (workerId) => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- const channel = `timeline:list:${listId}`;
|
|
|
|
|
|
+ channel = `timeline:list:${listId}`;
|
|
streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel)));
|
|
streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel)));
|
|
});
|
|
});
|
|
break;
|
|
break;
|