1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-29 22:18:07 +09:00
hotomoe/src/api/stream/home.ts

11 lines
385 B
TypeScript
Raw Normal View History

2016-12-29 07:49:51 +09:00
import * as websocket from 'websocket';
import * as redis from 'redis';
export default function homeStream(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
// Subscribe Home stream channel
subscriber.subscribe(`misskey:user-stream:${user._id}`);
subscriber.on('message', (_, data) => {
connection.send(data);
});
}