about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-10-25 17:37:06 -0400
committerGitHub <noreply@github.com>2017-10-25 17:37:06 -0400
commit31814ddda009939d5d2ebe3e0ac061c26387529a (patch)
tree19e002405d30a50aca740a979efeb6b3a9d1e186 /streaming
parent5f0268ab842990740d79d44e77159bb52f1a08ce (diff)
parent42f2045c217df4b482e6ce70615a1d3252e0e972 (diff)
Merge pull request #198 from glitch-soc/gs-direct-timeline
Direct messages timeline from tootsuite/mastodon#4514
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 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;