about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorKaito Sinclaire <MattWCSTRFAN@gmail.com>2018-04-18 04:09:06 -0700
committerEugen Rochko <eugen@zeonfederated.com>2018-04-18 13:09:06 +0200
commit156b916caf4ec902a8db525843e95c1a42350207 (patch)
tree3f80c7da4842fc87bb56e62f5258072693fe415f /streaming
parentaedfea3554dc5cd60f4bebd828109d1ef4327814 (diff)
Direct messages column (#4514)
* 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

* Changes to match other timelines in 2.0
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 1b4f8596c..48bab8078 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -466,6 +466,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);
   });
@@ -517,6 +521,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;