This commit is contained in:
syuilo 2018-04-26 11:02:15 +09:00
parent 0616d29fd5
commit 3972e98f74
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import * as websocket from 'websocket';
import * as redis from 'redis';
import { ParsedUrlQuery } from 'querystring';
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
const q = request.resourceURL.query as ParsedUrlQuery;
const listId = q.listId as string;
// Subscribe stream
subscriber.subscribe(`misskey:user-list-stream:${listId}`);
subscriber.on('message', (_, data) => {
connection.send(data);
});
}

View File

@ -6,6 +6,7 @@ import config from '../../config';
import homeStream from './stream/home';
import localTimelineStream from './stream/local-timeline';
import globalTimelineStream from './stream/global-timeline';
import userListStream from './stream/user-list';
import driveStream from './stream/drive';
import messagingStream from './stream/messaging';
import messagingIndexStream from './stream/messaging-index';
@ -70,6 +71,7 @@ module.exports = (server: http.Server) => {
request.resourceURL.pathname === '/' ? homeStream :
request.resourceURL.pathname === '/local-timeline' ? localTimelineStream :
request.resourceURL.pathname === '/global-timeline' ? globalTimelineStream :
request.resourceURL.pathname === '/user-list' ? userListStream :
request.resourceURL.pathname === '/drive' ? driveStream :
request.resourceURL.pathname === '/messaging' ? messagingStream :
request.resourceURL.pathname === '/messaging-index' ? messagingIndexStream :