This commit is contained in:
syuilo 2017-11-01 13:20:55 +09:00
parent c3174e9768
commit c5b6dabd07

View file

@ -264,6 +264,8 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
publishChannelStream(channel._id, 'post', postObj);
}
// TODO
if (!channel) {
// Fetch all followers
const followers = await Following
.find({
@ -278,6 +280,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
// Publish event to followers stream
followers.forEach(following =>
event(following.follower_id, 'post', postObj));
}
// Increment my posts count
User.update({ _id: user._id }, {