From 8bf9eff1f931de9b94d05defda0c4f0a8f7be744 Mon Sep 17 00:00:00 2001 From: Heitor Tanoue <68477006+heitortanoue@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:21:50 -0300 Subject: [PATCH] fix!: hide archived rooms in room.autocomplete endpoint (#31383) --- .changeset/three-avocados-search.md | 5 +++++ apps/meteor/server/models/raw/Rooms.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/three-avocados-search.md diff --git a/.changeset/three-avocados-search.md b/.changeset/three-avocados-search.md new file mode 100644 index 0000000000000..82b9b3abfb06c --- /dev/null +++ b/.changeset/three-avocados-search.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": major +--- + +No longer shows archived rooms in `rooms.autocomplete.channelAndPrivate` endpoint diff --git a/apps/meteor/server/models/raw/Rooms.ts b/apps/meteor/server/models/raw/Rooms.ts index e09b64a49cf59..05afc102d1647 100644 --- a/apps/meteor/server/models/raw/Rooms.ts +++ b/apps/meteor/server/models/raw/Rooms.ts @@ -306,7 +306,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { }, ], prid: { $exists: false }, - $and: [{ $or: [{ federated: { $exists: false } }, { federated: false }] }], + $and: [{ federated: { $ne: true } }, { archived: { $ne: true } }], }; return this.find(query, options);