mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 09:23:48 +01:00
wip
This commit is contained in:
parent
98bf740ec4
commit
9879dc1464
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 New Issue
Block a user