mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-02 07:49:39 +00:00
fix(private-messages): blocker can't message blockee
This commit is contained in:
parent
31fdc866c3
commit
a429dce5dd
1 changed files with 3 additions and 1 deletions
|
|
@ -21,7 +21,9 @@ api.sendPrivateMessage = function(req,res,next){
|
|||
},
|
||||
function(member, cb){
|
||||
if (!member) return cb({code:404, err: 'User not found'});
|
||||
if (~member.inbox.blocks.indexOf(res.locals.user._id) || member.inbox.optOut) {
|
||||
if (~member.inbox.blocks.indexOf(res.locals.user._id) // can't send message if that user blocked me
|
||||
|| ~res.locals.user.inbox.blocks.indexOf(member._id) // or if I blocked them
|
||||
|| member.inbox.optOut) { // or if they've opted out of messaging
|
||||
return cb({code:401, err: "Can't send message to this user."});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue