mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 05:53:09 +02:00
Fix #3432
This commit is contained in:
parent
77d2d84e05
commit
8ca27a4480
1 changed files with 0 additions and 78 deletions
|
@ -70,84 +70,6 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
|||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
|
||||
if (users.length < ps.limit) {
|
||||
const otherUsers = await User
|
||||
.find({
|
||||
_id: { $nin: users.map(u => u._id) },
|
||||
host: null,
|
||||
usernameLower: new RegExp(escapeRegexp(ps.query.replace('@', '').toLowerCase()))
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
|
||||
if (users.length < ps.limit && !ps.localOnly) {
|
||||
const otherUsers = await User
|
||||
.find({
|
||||
_id: { $nin: users.map(u => u._id) },
|
||||
host: { $ne: null },
|
||||
usernameLower: new RegExp(escapeRegexp(ps.query.replace('@', '').toLowerCase()))
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
}
|
||||
|
||||
if (users.length < ps.limit) {
|
||||
const otherUsers = await User
|
||||
.find({
|
||||
_id: { $nin: users.map(u => u._id) },
|
||||
host: null,
|
||||
name: new RegExp('^' + escapeRegexp(ps.query.toLowerCase()))
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
|
||||
if (users.length < ps.limit && !ps.localOnly) {
|
||||
const otherUsers = await User
|
||||
.find({
|
||||
_id: { $nin: users.map(u => u._id) },
|
||||
host: { $ne: null },
|
||||
name: new RegExp('^' + escapeRegexp(ps.query.toLowerCase()))
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
|
||||
if (users.length < ps.limit) {
|
||||
const otherUsers = await User
|
||||
.find({
|
||||
_id: { $nin: users.map(u => u._id) },
|
||||
host: null,
|
||||
name: new RegExp(escapeRegexp(ps.query.toLowerCase()))
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
|
||||
if (users.length < ps.limit && !ps.localOnly) {
|
||||
const otherUsers = await User
|
||||
.find({
|
||||
_id: { $nin: users.map(u => u._id) },
|
||||
host: { $ne: null },
|
||||
name: new RegExp(escapeRegexp(ps.query.toLowerCase()))
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
||||
users = users.concat(otherUsers);
|
||||
}
|
||||
|
||||
// Serialize
|
||||
|
|
Loading…
Reference in a new issue