diff --git a/routes/outbox.js b/routes/outbox.js index 0effc41..f1e4c84 100644 --- a/routes/outbox.js +++ b/routes/outbox.js @@ -19,7 +19,7 @@ router.post('/', net.security.auth, net.validators.outboxActivity, function (req router.get('/', function (req, res) { const db = req.app.get('db') db.collection('streams') - .find({ actor: pub.utils.usernameToIRI(req.user) }) + .find({ actor: pub.utils.usernameToIRI(req.user), type: { $in: ['Announce', 'Create'] } }) .sort({ _id: -1 }) .project({ _id: 0, _meta: 0, 'object._id': 0, 'object.@context': 0, 'object._meta': 0 }) .toArray() diff --git a/routes/user.js b/routes/user.js index 9dab8bd..0000481 100644 --- a/routes/user.js +++ b/routes/user.js @@ -15,7 +15,7 @@ router.get('/', net.validators.jsonld, function (req, res) { { $lookup: { from: 'objects', localField: '_id', foreignField: 'id', as: 'actor' } }, // merge joined actor up { $replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ['$actor', 0] }, '$$ROOT'] } } }, - { $project: { postCount: 1, preferredUsername: 1 } } + { $project: { _id: 0, _meta: 0, actor: 0 } } ]) .sort({ postCount: -1 }) .limit(Number.parseInt(req.query.n) || 20)