From 454c8d374955d2ffb3ec1fca39a6efc32032c649 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 7 Apr 2018 15:07:24 +0100 Subject: Move OnStats from the core to a cross-module event. Some core code still exists in the XLine system but this will be replaced when the XLine system is replaced later. --- include/modules/stats.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/modules/stats.h') diff --git a/include/modules/stats.h b/include/modules/stats.h index d2f6eabbb..e69070c9f 100644 --- a/include/modules/stats.h +++ b/include/modules/stats.h @@ -19,12 +19,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: -- cgit v1.2.3