This commit is contained in:
syuilo
2017-11-21 03:40:09 +09:00
parent ff1a20d74a
commit 1436617aab
13 changed files with 234 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
import * as mongo from 'mongodb';
import * as redis from 'redis';
import swPush from './common/push-sw';
import config from '../conf';
type ID = string | mongo.ObjectID;
@@ -17,6 +18,10 @@ class MisskeyEvent {
this.publish(`user-stream:${userId}`, type, typeof value === 'undefined' ? null : value);
}
public publishSw(userId: ID, type: string, value?: any): void {
swPush(userId, type, value);
}
public publishDriveStream(userId: ID, type: string, value?: any): void {
this.publish(`drive-stream:${userId}`, type, typeof value === 'undefined' ? null : value);
}
@@ -50,6 +55,8 @@ const ev = new MisskeyEvent();
export default ev.publishUserStream.bind(ev);
export const pushSw = ev.publishSw.bind(ev);
export const publishDriveStream = ev.publishDriveStream.bind(ev);
export const publishPostStream = ev.publishPostStream.bind(ev);