diff options
Diffstat (limited to 'src/commands/cmd_invite.cpp')
| -rw-r--r-- | src/commands/cmd_invite.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp index 8b2fcfa93..826a8ea53 100644 --- a/src/commands/cmd_invite.cpp +++ b/src/commands/cmd_invite.cpp @@ -70,15 +70,18 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use return CMD_FAILURE; } - FIRST_MOD_RESULT(OnUserPreInvite, MOD_RESULT, (user,u,c,timeout)); - - if (MOD_RESULT == MOD_RES_DENY) - { - return CMD_FAILURE; - } - else if (MOD_RESULT == MOD_RES_PASSTHRU) + if (IS_LOCAL(user)) { - if (IS_LOCAL(user)) + TargetedPermissionData perm("invite", u); + FOR_EACH_MOD(OnChannelPermissionCheck, (user,c,perm)); + + if (MOD_RESULT == MOD_RES_DENY) + { + if (!perm.reason.empty()) + user->SendText(perm.reason); + return CMD_FAILURE; + } + else if (MOD_RESULT == MOD_RES_PASSTHRU) { int rank = c->GetPrefixValue(user); if (rank < HALFOP_VALUE) |
