Mastodonのリンクの所有者認証に対応 (#5161)

* Profile metadata を設定できるように

* API desc
This commit is contained in:
MeiMei
2019-07-18 00:11:39 +09:00
committed by syuilo
parent f1a7ab639b
commit ef44eda69e
8 changed files with 92 additions and 4 deletions

View File

@@ -156,11 +156,17 @@ router.get('/@:user', async (ctx, next) => {
if (user != null) {
const profile = await UserProfiles.findOne(user.id).then(ensure);
const meta = await fetchMeta();
const me = profile.fields
? profile.fields
.filter(filed => filed.value != null && filed.value.match(/^https?:/))
.map(field => field.value)
: [];
await ctx.render('user', {
user, profile,
user, profile, me,
instanceName: meta.name || 'Misskey'
});
ctx.set('Cache-Control', 'public, max-age=180');
ctx.set('Cache-Control', 'public, max-age=30');
} else {
// リモートユーザーなので
await next();