From 8b533d5467c3aa47724663ae1bb13e17c2df52df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 19 Aug 2023 16:47:10 -0400 Subject: [PATCH] test: one more fix --- src/messaging/rooms.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js index 03586ef6da..c78be73671 100644 --- a/src/messaging/rooms.js +++ b/src/messaging/rooms.js @@ -447,16 +447,16 @@ module.exports = function (Messaging) { user.isAdministrator(uid), user.isGlobalModerator(uid), ]); - if (!room) { - return null; - } - if (!canChat || + if (!room || (!room.public && !inRoom) || (room.public && ( Array.isArray(room.groups) && room.groups.length && !isAdmin && !(await groups.isMemberOfAny(uid, room.groups))) ) ) { + return null; + } + if (!canChat) { throw new Error('[[error:no-privileges]]'); }