Merge pull request #2381 from mei23/mei-0821-apnote
ActivityPub Note/Outbox の公開範囲の修正
This commit is contained in:
		
						commit
						3476be16ab
					
				
					 2 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -54,7 +54,8 @@ router.get('/notes/:note', async (ctx, next) => {
 | 
				
			||||||
	if (!isActivityPubReq(ctx)) return await next();
 | 
						if (!isActivityPubReq(ctx)) return await next();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const note = await Note.findOne({
 | 
						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) {
 | 
						if (note === null) {
 | 
				
			||||||
| 
						 | 
					@ -62,7 +63,7 @@ router.get('/notes/:note', async (ctx, next) => {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.body = pack(await renderNote(note));
 | 
						ctx.body = pack(await renderNote(note, false));
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// outbox
 | 
					// outbox
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -83,7 +83,7 @@ export default async (ctx: Koa.Context) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (sinceId) notes.reverse();
 | 
							if (sinceId) notes.reverse();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const renderedNotes = await Promise.all(notes.map(note => renderNote(note)));
 | 
							const renderedNotes = await Promise.all(notes.map(note => renderNote(note, false)));
 | 
				
			||||||
		const rendered = renderOrderedCollectionPage(
 | 
							const rendered = renderOrderedCollectionPage(
 | 
				
			||||||
			`${partOf}?page=true${sinceId ? `&since_id=${sinceId}` : ''}${untilId ? `&until_id=${untilId}` : ''}`,
 | 
								`${partOf}?page=true${sinceId ? `&since_id=${sinceId}` : ''}${untilId ? `&until_id=${untilId}` : ''}`,
 | 
				
			||||||
			user.notesCount, renderedNotes, partOf,
 | 
								user.notesCount, renderedNotes, partOf,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue