Hide suspended user profile (#5452)

This commit is contained in:
MeiMei
2020-01-02 02:47:20 +09:00
committed by syuilo
parent a3c7901f87
commit 541f5f1314
6 changed files with 40 additions and 11 deletions

View File

@@ -101,7 +101,8 @@ const getFeed = async (acct: string) => {
const { username, host } = parseAcct(acct);
const user = await Users.findOne({
usernameLower: username.toLowerCase(),
host
host,
isSuspended: false
});
return user && await packFeed(user);
@@ -149,7 +150,8 @@ router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => {
const { username, host } = parseAcct(ctx.params.user);
const user = await Users.findOne({
usernameLower: username.toLowerCase(),
host
host,
isSuspended: false
});
if (user != null) {
@@ -170,6 +172,7 @@ router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => {
ctx.set('Cache-Control', 'public, max-age=30');
} else {
// リモートユーザーなので
// モデレータがAPI経由で参照可能にするために404にはしない
await next();
}
});
@@ -177,7 +180,8 @@ router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => {
router.get('/users/:user', async ctx => {
const user = await Users.findOne({
id: ctx.params.user,
host: null
host: null,
isSuspended: false
});
if (user == null) {