Skip to content
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