diff options
Diffstat (limited to 'src/api/event.ts')
| -rw-r--r-- | src/api/event.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/api/event.ts b/src/api/event.ts index 39dc809bdc..9613a9f7cc 100644 --- a/src/api/event.ts +++ b/src/api/event.ts @@ -13,14 +13,6 @@ class MisskeyEvent { config.redis.port, config.redis.host); } - private publish(channel: string, type: string, value?: any): void { - const message = value == null ? - { type: type } : - { type: type, body: value }; - - this.redisClient.publish(`misskey:${channel}`, JSON.stringify(message)); - } - public publishUserStream(userId: ID, type: string, value?: any): void { this.publish(`user-stream:${userId}`, type, typeof value === 'undefined' ? null : value); } @@ -32,6 +24,14 @@ class MisskeyEvent { public publishMessagingStream(userId: ID, otherpartyId: ID, type: string, value?: any): void { this.publish(`messaging-stream:${userId}-${otherpartyId}`, type, typeof value === 'undefined' ? null : value); } + + private publish(channel: string, type: string, value?: any): void { + const message = value == null ? + { type: type } : + { type: type, body: value }; + + this.redisClient.publish(`misskey:${channel}`, JSON.stringify(message)); + } } const ev = new MisskeyEvent(); |