aboutsummaryrefslogtreecommitdiffstats
path: root/src/commands/cmd_invite.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-03-02 12:04:53 -0600
committerGravatar Daniel De Graaf2010-08-03 17:32:39 -0400
commit89f72a4d63c6868ac3c191197f37e08341b8bc16 (patch)
tree619fc74cfc57928de1bd0a9b08a8ad65903a8e7b /src/commands/cmd_invite.cpp
parentUnset umode +x when a different vhost is set on a user (diff)
Create OnChannelPermissionCheck hook
Diffstat (limited to 'src/commands/cmd_invite.cpp')
-rw-r--r--src/commands/cmd_invite.cpp19
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)