diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-01 03:17:14 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-01 03:17:14 +0900 |
| commit | f37fb38640a31c4b8865a5562628197ff21f3cce (patch) | |
| tree | c68d1b73aeb8c0c61d6a76ed4577036d4c3c04a5 /src/api/endpoints/posts | |
| parent | wip (diff) | |
| download | sharkey-f37fb38640a31c4b8865a5562628197ff21f3cce.tar.gz sharkey-f37fb38640a31c4b8865a5562628197ff21f3cce.tar.bz2 sharkey-f37fb38640a31c4b8865a5562628197ff21f3cce.zip | |
wip
Diffstat (limited to 'src/api/endpoints/posts')
| -rw-r--r-- | src/api/endpoints/posts/create.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts index 183cabf135..34265dcbc3 100644 --- a/src/api/endpoints/posts/create.ts +++ b/src/api/endpoints/posts/create.ts @@ -13,7 +13,7 @@ import Watching from '../../models/post-watching'; import serialize from '../../serializers/post'; import notify from '../../common/notify'; import watch from '../../common/watch-post'; -import event from '../../event'; +import { default as event, publishChannelStream } from '../../event'; import config from '../../../conf'; /** @@ -258,6 +258,11 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { // Publish event to myself's stream event(user._id, 'post', postObj); + // Publish event to channel + if (channel) { + publishChannelStream(channel._id, 'post', postObj); + } + // Fetch all followers const followers = await Following .find({ |