]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules/stats.h
Remove the Kiwi links from the readme.
[user/henk/code/inspircd.git] / include / modules / stats.h
index b1e27b4e7205eceebaa3424b4ef7ee20ba47000d..02b3b9b4aa8cd3c7cae1dce310d47180db9afe80 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
 
 #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:
@@ -167,6 +186,7 @@ class Stats::Context
                n.push(p5);
                n.push(p6);
                n.push(p7);
+               n.push(p8);
                AddRow(n);
        }
 };