fix bug where old users could see broken presence indicators on new users

This commit is contained in:
David Renshaw 2016-11-21 22:49:53 -05:00
parent 1ad4107201
commit 7b5d08afd1

View file

@ -99,20 +99,21 @@ Meteor.publishRelations('board', function(boardId) {
this.cursor(Attachments.find({ cardId })); this.cursor(Attachments.find({ cardId }));
}); });
// Board members. This publication also includes former board members that if (board.members) {
// aren't members anymore but may have some activities attached to them in // Board members. This publication also includes former board members that
// the history. // aren't members anymore but may have some activities attached to them in
// // the history.
this.cursor(Users.find({ this.cursor(Users.find({
_id: { $in: _.pluck(board.members, 'userId') }, _id: { $in: _.pluck(board.members, 'userId') },
}, { fields: { }, { fields: {
'username': 1, 'username': 1,
'profile.fullname': 1, 'profile.fullname': 1,
'profile.avatarUrl': 1, 'profile.avatarUrl': 1,
}}), function(userId) { }}), function(userId) {
// Presence indicators // Presence indicators
this.cursor(presences.find({ userId })); this.cursor(presences.find({ userId }));
}); });
}
}); });
return this.ready(); return this.ready();