mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +01:00
feat: banned-users group
This commit is contained in:
@@ -202,10 +202,6 @@ Messaging.canMessageUser = async (uid, toUid) => {
|
||||
throw new Error('[[error:no-user]]');
|
||||
}
|
||||
|
||||
const userData = await user.getUserFields(uid, ['banned']);
|
||||
if (userData.banned) {
|
||||
throw new Error('[[error:user-banned]]');
|
||||
}
|
||||
const canChat = await privileges.global.can('chat', uid);
|
||||
if (!canChat) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
@@ -238,10 +234,6 @@ Messaging.canMessageRoom = async (uid, roomId) => {
|
||||
throw new Error('[[error:not-in-room]]');
|
||||
}
|
||||
|
||||
const userData = await user.getUserFields(uid, ['banned']);
|
||||
if (userData.banned) {
|
||||
throw new Error('[[error:user-banned]]');
|
||||
}
|
||||
const canChat = await privileges.global.can('chat', uid);
|
||||
if (!canChat) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
|
||||
Reference in New Issue
Block a user