mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 04:43:09 +02:00
wip
This commit is contained in:
parent
0616d29fd5
commit
3972e98f74
2 changed files with 16 additions and 0 deletions
14
src/server/api/stream/user-list.ts
Normal file
14
src/server/api/stream/user-list.ts
Normal 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);
|
||||
});
|
||||
}
|
|
@ -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 :
|
||||
|
|
Loading…
Reference in a new issue