Fix incorrect error when sending private messages (PMs) to a player you have blocked #11612

Introduce a new error type blockedToSendToThisUser for the cases where you have blocked a player from sending private messages to you, if you try to message them or if you try to transfer gems to them, you will see the error "You can't send to this player because you have block this player."
This commit is contained in:
osiris
2019-12-15 19:18:16 +08:00
parent 023173fada
commit 104d888bfb
4 changed files with 4 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ const INTERACTION_CHECKS = Object.freeze({
// Direct user blocks prevent all interactions
(sndr, rcvr) => rcvr.inbox.blocks.includes(sndr._id) && 'notAuthorizedToSendMessageToThisUser',
(sndr, rcvr) => sndr.inbox.blocks.includes(rcvr._id) && 'notAuthorizedToSendMessageToThisUser',
(sndr, rcvr) => sndr.inbox.blocks.includes(rcvr._id) && 'blockedToSendToThisUser',
],
'send-private-message': [