Skip to content

Commit

Permalink
fix: connected users search on spotlight for user mentions (#31134)
Browse files Browse the repository at this point in the history
Co-authored-by: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com>
Co-authored-by: Guilherme Jun Grillo <48109548+guijun13@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 15, 2023
1 parent 13ef78a commit 83bcf04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-eyes-sleep.md
@@ -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
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

0 comments on commit 83bcf04

Please sign in to comment.