about summary refs log tree commit diff
path: root/streaming/index.js
diff options
context:
space:
mode:
authorMatthew Walsh <mattwcstrfan@gmail.com>2017-10-15 21:02:39 -0700
committerMatthew Walsh <mattwcstrfan@gmail.com>2017-10-22 18:35:14 -0700
commit3db80f75a6d76a7eea576413c5ae9b206d2ab385 (patch)
tree0b6f4a0f446c94fbbda1484b6f14537181d00a1a /streaming/index.js
parent09d81defcda96eae7ffba36ccf1fb091ce08f17b (diff)
Added a timeline for Direct statuses
* Lists all Direct statuses you've sent and received
* Displayed in Getting Started
* Streaming server support for direct TL
Diffstat (limited to 'streaming/index.js')
-rw-r--r--streaming/index.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 83903b89b..8adc5174a 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -402,6 +402,10 @@ const startWorker = (workerId) => {
     streamFrom('timeline:public:local', req, streamToHttp(req, res), streamHttpEnd(req), true);
   });
 
+  app.get('/api/v1/streaming/direct', (req, res) => {
+    streamFrom(`timeline:direct:${req.accountId}`, req, streamToHttp(req, res), streamHttpEnd(req), true);
+  });
+
   app.get('/api/v1/streaming/hashtag', (req, res) => {
     streamFrom(`timeline:hashtag:${req.query.tag.toLowerCase()}`, req, streamToHttp(req, res), streamHttpEnd(req), true);
   });
@@ -437,6 +441,9 @@ const startWorker = (workerId) => {
     case 'public:local':
       streamFrom('timeline:public:local', req, streamToWs(req, ws), streamWsEnd(req, ws), true);
       break;
+    case 'direct':
+      streamFrom(`timeline:direct:${req.accountId}`, req, streamToWs(req, ws), streamWsEnd(req, ws), true);
+      break;
     case 'hashtag':
       streamFrom(`timeline:hashtag:${location.query.tag.toLowerCase()}`, req, streamToWs(req, ws), streamWsEnd(req, ws), true);
       break;