Created
November 25, 2014 20:13
-
-
Save lefnire/86659101831476a65b8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/controllers/members.js b/src/controllers/members.js | |
index 9d30179..05b64be 100644 | |
--- a/src/controllers/members.js | |
+++ b/src/controllers/members.js | |
@@ -21,6 +21,7 @@ api.sendPrivateMessage = function(req,res,next){ | |
}, | |
function(member, cb){ | |
if (!member) return cb({code:404, err: 'User not found'}); | |
+ if (member.inbox.optOut && member.contributor.admin) return cb({code:401}, err: "Please report issues to Github"); | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment