summaryrefslogtreecommitdiff
path: root/src/server/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-12 01:52:25 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-12 01:52:25 +0900
commit2ff3069d23aa688cea5a3bd204236f2f2f64c201 (patch)
tree479448f49c2204e5729ed28a1af34a86e354492b /src/server/web
parentトランザクションを使用してアンケートレコードの挿入... (diff)
downloadsharkey-2ff3069d23aa688cea5a3bd204236f2f2f64c201.tar.gz
sharkey-2ff3069d23aa688cea5a3bd204236f2f2f64c201.tar.bz2
sharkey-2ff3069d23aa688cea5a3bd204236f2f2f64c201.zip
トランザクションを使うようにしたり
Diffstat (limited to 'src/server/web')
-rw-r--r--src/server/web/index.ts7
-rw-r--r--src/server/web/views/user.pug14
2 files changed, 12 insertions, 9 deletions
diff --git a/src/server/web/index.ts b/src/server/web/index.ts
index de0d65cf33..d1a15e3929 100644
--- a/src/server/web/index.ts
+++ b/src/server/web/index.ts
@@ -16,7 +16,7 @@ import fetchMeta from '../../misc/fetch-meta';
import * as pkg from '../../../package.json';
import { genOpenapiSpec } from '../api/openapi/gen-spec';
import config from '../../config';
-import { Users, Notes, Emojis } from '../../models';
+import { Users, Notes, Emojis, UserProfiles } from '../../models';
import parseAcct from '../../misc/acct/parse';
import getNoteSummary from '../../misc/get-note-summary';
@@ -149,11 +149,14 @@ router.get('/@:user', async (ctx, next) => {
usernameLower: username.toLowerCase(),
host
});
+ const profile = await UserProfiles.findOne({
+ userId: user.id
+ });
if (user != null) {
const meta = await fetchMeta();
await ctx.render('user', {
- user,
+ user, profile,
instanceName: meta.name || 'Misskey'
});
ctx.set('Cache-Control', 'public, max-age=180');
diff --git a/src/server/web/views/user.pug b/src/server/web/views/user.pug
index 3f32933f52..bff98ba80f 100644
--- a/src/server/web/views/user.pug
+++ b/src/server/web/views/user.pug
@@ -9,12 +9,12 @@ block title
= `${title} | ${instanceName}`
block desc
- meta(name='description' content= user.description)
+ meta(name='description' content= profile.description)
block og
meta(property='og:type' content='blog')
meta(property='og:title' content= title)
- meta(property='og:description' content= user.description)
+ meta(property='og:description' content= profile.description)
meta(property='og:url' content= url)
meta(property='og:image' content= img)
@@ -24,12 +24,12 @@ block meta
meta(name='twitter:card' content='summary')
- if user.twitter
- meta(name='twitter:creator' content=`@${user.twitter.screenName}`)
+ if profile.twitter
+ meta(name='twitter:creator' content=`@${profile.twitter.screenName}`)
if !user.host
- link(rel='alternate' href=`${config.url}/users/${user._id}` type='application/activity+json')
+ link(rel='alternate' href=`${config.url}/users/${user.id}` type='application/activity+json')
if user.uri
link(rel='alternate' href=user.uri type='application/activity+json')
- if user.url
- link(rel='alternate' href=user.url type='text/html')
+ if profile.url
+ link(rel='alternate' href=profile.url type='text/html')