From 51b2c6579a4638ca528a144a17087a107f74904e Mon Sep 17 00:00:00 2001 From: yash-rajpal Date: Fri, 22 Sep 2023 00:04:55 +0530 Subject: [PATCH 1/2] search subscription using fname field too --- .../UserAndRoomAutoCompleteMultiple.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx b/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx index 96d11cf44cb7..d3066a2c880e 100644 --- a/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx @@ -18,7 +18,13 @@ const UserAndRoomAutoCompleteMultiple = ({ value, onChange, ...props }: UserAndR const debouncedFilter = useDebouncedValue(filter, 1000); const rooms = useUserSubscriptions( - useMemo(() => ({ open: { $ne: false }, lowerCaseName: new RegExp(escapeRegExp(debouncedFilter), 'i') }), [debouncedFilter]), + useMemo( + () => ({ + open: { $ne: false }, + $or: [{ lowerCaseName: new RegExp(escapeRegExp(debouncedFilter), 'i') }, { fname: new RegExp(escapeRegExp(debouncedFilter), 'i') }], + }), + [debouncedFilter], + ), ).filter((room) => { if (!user) { return; From ee7b8f3815b5f959852cd556e2294573a7be7f95 Mon Sep 17 00:00:00 2001 From: yash-rajpal Date: Fri, 22 Sep 2023 00:06:12 +0530 Subject: [PATCH 2/2] add changeset --- .changeset/brown-flowers-switch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/brown-flowers-switch.md diff --git a/.changeset/brown-flowers-switch.md b/.changeset/brown-flowers-switch.md new file mode 100644 index 000000000000..f2735e615491 --- /dev/null +++ b/.changeset/brown-flowers-switch.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Search users using full name too on share message modal