X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules%2Fstats.h;h=02b3b9b4aa8cd3c7cae1dce310d47180db9afe80;hb=635cb9d65f6d7f6758ae8ed874da00c8d94b6e39;hp=d2f6eabbb89f01d4f5c3781ac337d7a3b119ac08;hpb=565544fac966b14e046bb3042ab485f79bcf7c9e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules/stats.h b/include/modules/stats.h index d2f6eabbb..02b3b9b4a 100644 --- a/include/modules/stats.h +++ b/include/modules/stats.h @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2018 Sadie Powell * Copyright (C) 2016 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -19,12 +20,30 @@ #pragma once +#include "event.h" + namespace Stats { class Context; + class EventListener; class Row; } +class Stats::EventListener : public Events::ModuleEventListener +{ + public: + EventListener(Module* mod) + : ModuleEventListener(mod, "event/stats") + { + } + + /** Called when the STATS command is executed. + * @param stats Context of the /STATS request, contains requesting user, list of answer rows etc. + * @return MOD_RES_DENY if the stats request has been fulfilled. Otherwise, MOD_RES_PASSTHRU. + */ + virtual ModResult OnStats(Stats::Context& stats) = 0; +}; + class Stats::Row : public Numeric::Numeric { public: