diff options
| author | 2022-03-27 15:30:41 +0100 | |
|---|---|---|
| committer | 2022-03-27 15:30:41 +0100 | |
| commit | f06ea52d0ab08db213b2c2fd81a4dee95910af16 (patch) | |
| tree | 1d91cc063670e5458ac4124ce1705db74734102b /include | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Add support for matching against geolocation data with WHO. (diff) | |
Merge branch 'insp3' into master.
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 d7a259f30..b68c85f17 100644 --- a/include/modules/who.h +++ b/include/modules/who.h @@ -23,6 +23,7 @@ namespace Who { class EventListener; + class MatchEventListener; class Request; } @@ -47,6 +48,25 @@ public: 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: |
