summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-01 13:20:55 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-01 13:20:55 +0900
commitc5b6dabd07e33ae7972300caf260b690d27db8cd (patch)
treee3b47b75b5dc846dd3a8b6791eaa4a243b06ea7e /src/api
parentFix bug (diff)
downloadsharkey-c5b6dabd07e33ae7972300caf260b690d27db8cd.tar.gz
sharkey-c5b6dabd07e33ae7972300caf260b690d27db8cd.tar.bz2
sharkey-c5b6dabd07e33ae7972300caf260b690d27db8cd.zip
wip
Diffstat (limited to 'src/api')
-rw-r--r--src/api/endpoints/posts/create.ts29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts
index e1138c3edc..360b5df0d9 100644
--- a/src/api/endpoints/posts/create.ts
+++ b/src/api/endpoints/posts/create.ts
@@ -264,20 +264,23 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
publishChannelStream(channel._id, 'post', postObj);
}
- // Fetch all followers
- const followers = await Following
- .find({
- followee_id: user._id,
- // 削除されたドキュメントは除く
- deleted_at: { $exists: false }
- }, {
- follower_id: true,
- _id: false
- });
+ // TODO
+ if (!channel) {
+ // Fetch all followers
+ const followers = await Following
+ .find({
+ followee_id: user._id,
+ // 削除されたドキュメントは除く
+ deleted_at: { $exists: false }
+ }, {
+ follower_id: true,
+ _id: false
+ });
- // Publish event to followers stream
- followers.forEach(following =>
- event(following.follower_id, 'post', postObj));
+ // Publish event to followers stream
+ followers.forEach(following =>
+ event(following.follower_id, 'post', postObj));
+ }
// Increment my posts count
User.update({ _id: user._id }, {