From 44955257058b1f42036a693eba51a0d12b96abd5 Mon Sep 17 00:00:00 2001 From: mei23 Date: Tue, 21 Aug 2018 13:17:37 +0900 Subject: Respect visibility in ActivityPub Note/Outbox --- src/server/activitypub.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/server/activitypub.ts') diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index c2dec2b997..26eaa68fe8 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -54,7 +54,8 @@ router.get('/notes/:note', async (ctx, next) => { if (!isActivityPubReq(ctx)) return await next(); const note = await Note.findOne({ - _id: new mongo.ObjectID(ctx.params.note) + _id: new mongo.ObjectID(ctx.params.note), + $or: [ { visibility: 'public' }, { visibility: 'home' } ] }); if (note === null) { @@ -62,7 +63,7 @@ router.get('/notes/:note', async (ctx, next) => { return; } - ctx.body = pack(await renderNote(note)); + ctx.body = pack(await renderNote(note, false)); }); // outbox -- cgit v1.2.3-freya