From 1436617aab030fa5b3760a3eeae37a1cdeeba2df Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 21 Nov 2017 03:40:09 +0900 Subject: wip --- src/api/event.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/api/event.ts') diff --git a/src/api/event.ts b/src/api/event.ts index 8605a0f1e4..4a2e4e453d 100644 --- a/src/api/event.ts +++ b/src/api/event.ts @@ -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); -- cgit v1.2.3-freya