aboutsummaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-25 03:43:40 +0000
committerGravatar Sadie Powell2023-01-25 03:43:40 +0000
commit4472683dc7d321eaee30aae715a71b32342dffd4 (patch)
tree71e136985e1b6b2e68f0fc7f2888e5f38eaa0d0e /include/modules
parentFix using std::max instead of std::min when clamping NetBufferSize. (diff)
Move CheckExemption::Call to CheckExemption::EventProvider.
Now FirstResult not a macro there's no need for this to be a free function.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/exemption.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/include/modules/exemption.h b/include/modules/exemption.h
index 4c76762be..bbd018f4b 100644
--- a/include/modules/exemption.h
+++ b/include/modules/exemption.h
@@ -23,16 +23,6 @@ namespace CheckExemption
{
class EventListener;
class EventProvider;
-
- /** Helper function for calling the CheckExemption::EventListener::OnCheckExemption event.
- * @param prov The CheckExemption::EventProvider which is calling the event.
- * @param user The user to check exemption for.
- * @param chan The channel to check exemption on.
- * @param restriction The restriction to check for.
- * @return Either MOD_RES_ALLOW if the exemption was confirmed, MOD_RES_DENY if the exemption was
- * denied or MOD_RES_PASSTHRU if no module handled the event.
- */
- inline ModResult Call(const CheckExemption::EventProvider& prov, User* user, Channel* chan, const std::string& restriction);
}
class CheckExemption::EventListener
@@ -63,9 +53,16 @@ public:
: ModuleEventProvider(mod, "event/exemption")
{
}
-};
-inline ModResult CheckExemption::Call(const CheckExemption::EventProvider& prov, User* user, Channel* chan, const std::string& restriction)
-{
- return prov.FirstResult(&CheckExemption::EventListener::OnCheckExemption, user, chan, restriction);
-}
+ /** Helper function for calling the CheckExemption::EventListener::OnCheckExemption event.
+ * @param user The user to check exemption for.
+ * @param chan The channel to check exemption on.
+ * @param restriction The restriction to check for.
+ * @return Either MOD_RES_ALLOW if the exemption was confirmed, MOD_RES_DENY if the exemption was
+ * denied or MOD_RES_PASSTHRU if no module handled the event.
+ */
+ inline ModResult Check(User* user, Channel* chan, const std::string& restriction)
+ {
+ return FirstResult(&CheckExemption::EventListener::OnCheckExemption, user, chan, restriction);
+ }
+};