Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: connected users search on spotlight for user mentions #31134

Merged
merged 10 commits into from
Dec 15, 2023
5 changes: 5 additions & 0 deletions .changeset/pretty-eyes-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixed issue searching connected users on spotlight
4 changes: 2 additions & 2 deletions apps/meteor/server/lib/spotlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class Spotlight {
}
}

if (users.length === 0 && canListOutsiders) {
if (users.length === 0 && canListOutsiders && text) {
const exactMatch = await Users.findOneByUsernameIgnoringCase(text, {
projection: options.projection,
readPreference: options.readPreference,
Expand Down Expand Up @@ -265,7 +265,7 @@ export class Spotlight {
if (await this._searchOutsiderUsers(searchParams)) {
return users;
}
} else if (await this._searchConnectedUsers(userId, searchParams)) {
} else if (await this._searchConnectedUsers(userId, searchParams, 'd')) {
return users;
}

Expand Down
Loading