1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-16 15:48:19 +09:00
MisskeyIO/src/server/api/stream/messaging-index.ts
2018-07-30 07:20:27 +09:00

10 lines
334 B
TypeScript

import * as websocket from 'websocket';
import Xev from 'xev';
export default function(request: websocket.request, connection: websocket.connection, subscriber: Xev, user: any): void {
// Subscribe messaging index stream
subscriber.on(`messaging-index-stream:${user._id}`, data => {
connection.send(JSON.stringify(data));
});
}