diff options
| author | 2022-03-24 02:33:45 +0000 | |
|---|---|---|
| committer | 2022-03-25 13:18:42 +0000 | |
| commit | 3bf6454518f4a22a63dec4c5379848df34215a85 (patch) | |
| tree | b6d020a15aead6818550b180372ffb3a8b816005 /include | |
| parent | Fix allowing modules to have a path on Windows. (diff) | |
Allow modules to handle WHO matching.
Diffstat (limited to 'include')
| -rw-r--r-- | include/modules/who.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/modules/who.h b/include/modules/who.h index d2930f97b..6e8fa024b 100644 --- a/include/modules/who.h +++ b/include/modules/who.h @@ -25,6 +25,7 @@ namespace Who { class EventListener; + class MatchEventListener; class Request; } @@ -48,6 +49,25 @@ class Who::EventListener : public Events::ModuleEventListener virtual ModResult OnWhoLine(const Request& request, LocalUser* source, User* user, Membership* memb, Numeric::Numeric& numeric) = 0; }; +class Who::MatchEventListener + : public Events::ModuleEventListener +{ + public: + MatchEventListener(Module* mod) + : ModuleEventListener(mod, "event/who-match") + { + } + + /** Called when a WHO request needs to check if a user matches it. + * @param request Details about the WHO request which caused this match attempt. + * @param source The user who initiated this WHO request. + * @param user The user to attempt to match the WHO request against. + * @return MOD_RES_ALLOW to explicitly allow the match, MOD_RES_DENY to explicitly deny the + * match, or MOD_RES_PASSTHRU to let another module handle the event. + */ + virtual ModResult OnWhoMatch(const Request& request, LocalUser* source, User* user) = 0; +}; + class Who::Request { public: |
