This commit is contained in:
syuilo 2018-03-07 11:40:40 +09:00
parent 06eabcbc63
commit 6c495268ae
15 changed files with 230 additions and 95 deletions

View file

@ -0,0 +1,12 @@
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 {
const otherparty = request.resourceURL.query.otherparty;
// Subscribe matching stream
subscriber.subscribe(`misskey:othello-matching:${user._id}-${otherparty}`);
subscriber.on('message', (_, data) => {
connection.send(data);
});
}