mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-09 04:33:09 +02:00
11 lines
388 B
TypeScript
11 lines
388 B
TypeScript
|
import * as websocket from 'websocket';
|
||
|
import * as redis from 'redis';
|
||
|
|
||
|
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
|
||
|
// Subscribe messaging index stream
|
||
|
subscriber.subscribe(`misskey:messaging-index-stream:${user._id}`);
|
||
|
subscriber.on('message', (_, data) => {
|
||
|
connection.send(data);
|
||
|
});
|
||
|
}
|