diff options
author | Adam <Adam@anope.org> | 2012-10-05 05:03:55 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-05 05:03:55 -0400 |
commit | eff61c7a9708013f9617282c4f327bbe2b1bfb79 (patch) | |
tree | 655b0ff225a53446c5cfd60470988b759bf333fe /modules/commands/cs_set_successor.cpp | |
parent | 7c96227cd3dd9c562fb382a9af62e451846328fa (diff) |
Add an event for when nick or channel options are set
Diffstat (limited to 'modules/commands/cs_set_successor.cpp')
-rw-r--r-- | modules/commands/cs_set_successor.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/commands/cs_set_successor.cpp b/modules/commands/cs_set_successor.cpp index 5d3da40f1..64f875dce 100644 --- a/modules/commands/cs_set_successor.cpp +++ b/modules/commands/cs_set_successor.cpp @@ -31,16 +31,24 @@ class CommandCSSetSuccessor : public Command return; } - if (source.permission.empty() && !source.AccessFor(ci).HasPriv("SET")) - { - source.Reply(ACCESS_DENIED); + EventReturn MOD_RESULT; + FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + if (MOD_RESULT == EVENT_STOP) return; - } - if (source.permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) + if (MOD_RESULT != EVENT_ALLOW && source.permission.empty()) { - source.Reply(ACCESS_DENIED); - return; + if (!source.AccessFor(ci).HasPriv("SET")) + { + source.Reply(ACCESS_DENIED); + return; + } + + if (ci->HasFlag(CI_SECUREFOUNDER) ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) + { + source.Reply(ACCESS_DENIED); + return; + } } NickCore *nc; |