Do not import as pack from AP renderer (#4048)

* Do not import as pack from AP renderer

* rename
This commit is contained in:
MeiMei
2019-01-31 02:29:36 +09:00
committed by syuilo
parent e220ef3e75
commit b8a7468c4a
21 changed files with 55 additions and 55 deletions

View File

@@ -4,7 +4,7 @@ const json = require('koa-json-body');
const httpSignature = require('http-signature');
import { createHttpJob } from '../queue';
import pack from '../remote/activitypub/renderer';
import { renderActivity } from '../remote/activitypub/renderer';
import Note from '../models/note';
import User, { isLocalUser, ILocalUser, IUser } from '../models/user';
import Emoji from '../models/emoji';
@@ -83,7 +83,7 @@ router.get('/notes/:note', async (ctx, next) => {
return;
}
ctx.body = pack(await renderNote(note, false));
ctx.body = renderActivity(await renderNote(note, false));
ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
});
@@ -106,7 +106,7 @@ router.get('/notes/:note/activity', async ctx => {
return;
}
ctx.body = pack(await packActivity(note));
ctx.body = renderActivity(await packActivity(note));
ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
});
@@ -137,7 +137,7 @@ router.get('/questions/:question', async (ctx, next) => {
_id: poll.userId
});
ctx.body = pack(await renderQuestion(user as ILocalUser, poll));
ctx.body = renderActivity(await renderQuestion(user as ILocalUser, poll));
setResponseType(ctx);
});
@@ -173,7 +173,7 @@ router.get('/users/:user/publickey', async ctx => {
}
if (isLocalUser(user)) {
ctx.body = pack(renderKey(user));
ctx.body = renderActivity(renderKey(user));
ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
} else {
@@ -188,7 +188,7 @@ async function userInfo(ctx: Router.IRouterContext, user: IUser) {
return;
}
ctx.body = pack(await renderPerson(user as ILocalUser));
ctx.body = renderActivity(await renderPerson(user as ILocalUser));
ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
}
@@ -235,7 +235,7 @@ router.get('/emojis/:emoji', async ctx => {
return;
}
ctx.body = pack(await renderEmoji(emoji));
ctx.body = renderActivity(await renderEmoji(emoji));
ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
});