mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 13:20:41 +01:00
test: one more fix
This commit is contained in:
@@ -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]]');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user