summaryrefslogtreecommitdiff
path: root/src/api/stream/messaging.ts
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-29 01:20:40 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-29 01:54:41 +0900
commit90f8fe7e538bb7e52d2558152a0390e693f39b11 (patch)
tree0f830887053c8f352b1cd0c13ca715fd14c1f030 /src/api/stream/messaging.ts
parentImplement remote account resolution (diff)
downloadsharkey-90f8fe7e538bb7e52d2558152a0390e693f39b11.tar.gz
sharkey-90f8fe7e538bb7e52d2558152a0390e693f39b11.tar.bz2
sharkey-90f8fe7e538bb7e52d2558152a0390e693f39b11.zip
Introduce processor
Diffstat (limited to 'src/api/stream/messaging.ts')
-rw-r--r--src/api/stream/messaging.ts24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/api/stream/messaging.ts b/src/api/stream/messaging.ts
deleted file mode 100644
index a4a12426a3..0000000000
--- a/src/api/stream/messaging.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import * as websocket from 'websocket';
-import * as redis from 'redis';
-import read from '../common/read-messaging-message';
-
-export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
- const otherparty = request.resourceURL.query.otherparty;
-
- // Subscribe messaging stream
- subscriber.subscribe(`misskey:messaging-stream:${user._id}-${otherparty}`);
- subscriber.on('message', (_, data) => {
- connection.send(data);
- });
-
- connection.on('message', async (data) => {
- const msg = JSON.parse(data.utf8Data);
-
- switch (msg.type) {
- case 'read':
- if (!msg.id) return;
- read(user._id, otherparty, msg.id);
- break;
- }
- });
-}