summaryrefslogtreecommitdiff
path: root/src/api/event.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/event.ts')
-rw-r--r--src/api/event.ts7
1 files changed, 7 insertions, 0 deletions
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);