From 89f72a4d63c6868ac3c191197f37e08341b8bc16 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Tue, 2 Mar 2010 12:04:53 -0600 Subject: Create OnChannelPermissionCheck hook --- src/commands/cmd_invite.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/commands/cmd_invite.cpp') 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& 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) -- cgit v1.3.1-10-gc9f91