ActivityPub Outboxの修正とactivity idのURLを実装 (#2662)
* Fix Outbox structure * Implement activity endpoint * Use in instead of or * Use in, addition
This commit is contained in:
@ -10,7 +10,7 @@ import User, { isLocalUser, ILocalUser, IUser } from '../models/user';
|
||||
import renderNote from '../remote/activitypub/renderer/note';
|
||||
import renderKey from '../remote/activitypub/renderer/key';
|
||||
import renderPerson from '../remote/activitypub/renderer/person';
|
||||
import Outbox from './activitypub/outbox';
|
||||
import Outbox, { packActivity } from './activitypub/outbox';
|
||||
import Followers from './activitypub/followers';
|
||||
import Following from './activitypub/following';
|
||||
|
||||
@ -77,6 +77,22 @@ router.get('/notes/:note', async (ctx, next) => {
|
||||
setResponseType(ctx);
|
||||
});
|
||||
|
||||
// note activity
|
||||
router.get('/notes/:note/activity', async ctx => {
|
||||
const note = await Note.findOne({
|
||||
_id: new mongo.ObjectID(ctx.params.note),
|
||||
visibility: { $in: ['public', 'home'] }
|
||||
});
|
||||
|
||||
if (note === null) {
|
||||
ctx.status = 404;
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.body = pack(await packActivity(note));
|
||||
setResponseType(ctx);
|
||||
});
|
||||
|
||||
// outbox
|
||||
router.get('/users/:user/outbox', Outbox);
|
||||
|
||||
|
Reference in New Issue
Block a user