Meteor.publish('allActivities', function () {
  return Activities.find();
});

Meteor.publish('userActivities', function (userId) {
  // Activities for a given user
  return Activities.find({'createdById': userId});
});

Meteor.publish('residentActivities', function (residentId) {
  // Activities for a given user
  return Activities.find({'residentIds':  residentId });
});

@@ -361,16 +361,285 @@
 identId %7D);%0A%7D);%0A
+%0AMeteor.publish('residentLatestActivities', function () %7B%0A  // Get latest activity IDs%0A  var latestActivityIds = Meteor.call('getAllResidentsLatestActivityIdsByType');%0A%0A  // Get cursor to latest activities%0A  return Activities.find(%7B_id: %7B$in: latestActivityIds%7D%7D);%0A%7D);%0A

Add residentLatestActivities publication