Resolve #4501
This commit is contained in:
parent
5a87763193
commit
dfabdef60f
@ -20,6 +20,7 @@ User.createIndex('createdAt');
|
|||||||
User.createIndex('updatedAt');
|
User.createIndex('updatedAt');
|
||||||
User.createIndex('followersCount');
|
User.createIndex('followersCount');
|
||||||
User.createIndex('tags');
|
User.createIndex('tags');
|
||||||
|
User.createIndex('isSuspended');
|
||||||
User.createIndex('username');
|
User.createIndex('username');
|
||||||
User.createIndex('usernameLower');
|
User.createIndex('usernameLower');
|
||||||
User.createIndex('host');
|
User.createIndex('host');
|
||||||
|
@ -70,7 +70,8 @@ export default define(meta, async (ps, me) => {
|
|||||||
users = await User
|
users = await User
|
||||||
.find({
|
.find({
|
||||||
host: null,
|
host: null,
|
||||||
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase()))
|
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase())),
|
||||||
|
isSuspended: false
|
||||||
}, {
|
}, {
|
||||||
limit: ps.limit,
|
limit: ps.limit,
|
||||||
skip: ps.offset
|
skip: ps.offset
|
||||||
@ -80,7 +81,8 @@ export default define(meta, async (ps, me) => {
|
|||||||
const otherUsers = await User
|
const otherUsers = await User
|
||||||
.find({
|
.find({
|
||||||
host: { $ne: null },
|
host: { $ne: null },
|
||||||
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase()))
|
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase())),
|
||||||
|
isSuspended: false
|
||||||
}, {
|
}, {
|
||||||
limit: ps.limit - users.length
|
limit: ps.limit - users.length
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user