mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
fix: closes #12758, show different error message for block
This commit is contained in:
@@ -179,6 +179,7 @@
|
|||||||
|
|
||||||
"cant-chat-with-yourself": "You can't chat with yourself!",
|
"cant-chat-with-yourself": "You can't chat with yourself!",
|
||||||
"chat-restricted": "This user has restricted their chat messages. They must follow you before you can chat with them",
|
"chat-restricted": "This user has restricted their chat messages. They must follow you before you can chat with them",
|
||||||
|
"chat-user-blocked": "You have been blocked by this user.",
|
||||||
"chat-disabled": "Chat system disabled",
|
"chat-disabled": "Chat system disabled",
|
||||||
"too-many-messages": "You have sent too many messages, please wait awhile.",
|
"too-many-messages": "You have sent too many messages, please wait awhile.",
|
||||||
"invalid-chat-message": "Invalid chat message",
|
"invalid-chat-message": "Invalid chat message",
|
||||||
|
|||||||
@@ -363,7 +363,10 @@ Messaging.canMessageUser = async (uid, toUid) => {
|
|||||||
user.blocks.is(uid, toUid),
|
user.blocks.is(uid, toUid),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (isBlocked || (settings.restrictChat && !isAdmin && !isModerator && !isFollowing)) {
|
if (isBlocked) {
|
||||||
|
throw new Error('[[error:chat-user-blocked]]');
|
||||||
|
}
|
||||||
|
if (settings.restrictChat && !isAdmin && !isModerator && !isFollowing) {
|
||||||
throw new Error('[[error:chat-restricted]]');
|
throw new Error('[[error:chat-restricted]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user