Hide suspended user profile (#5452)
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user