fix: Prevent user from inivting self to group

fixes #7491
This commit is contained in:
Blade Barringer
2016-05-29 10:09:02 -05:00
parent d23f79d001
commit bbafe3d52d
3 changed files with 14 additions and 0 deletions

View File

@@ -487,6 +487,8 @@ async function _inviteByUUID (uuid, group, inviter, req, res) {
if (!userToInvite) {
throw new NotFound(res.t('userWithIDNotFound', {userId: uuid}));
} else if (inviter._id === userToInvite._id) {
throw new BadRequest(res.t('cannotInviteSelfToGroup'));
}
if (group.type === 'guild') {