From f8013e089955329bbf915c1617f668618533c266 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 5 Jan 2020 14:41:06 +0000 Subject: Move ISupport logic out of the core and into core_info. --- src/modules/m_httpd_stats.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/modules/m_httpd_stats.cpp') diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index daecafc11..9a5e67bed 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -22,9 +22,12 @@ #include "inspircd.h" +#include "modules/isupport.h" #include "modules/httpd.h" #include "xline.h" +static ISupport::EventProvider* isevprov; + namespace Stats { struct Entities @@ -105,12 +108,14 @@ namespace Stats std::ostream& ISupport(std::ostream& data) { data << ""; - const std::vector& isupport = ServerInstance->ISupport.GetLines(); - for (std::vector::const_iterator i = isupport.begin(); i != isupport.end(); ++i) + + ISupport::TokenMap tokens; + FOREACH_MOD_CUSTOM(*isevprov, ISupport::EventListener, OnBuildISupport, (tokens)); + for (ISupport::TokenMap::const_iterator it = tokens.begin(); it != tokens.end(); ++it) { - const Numeric::Numeric& num = *i; - for (std::vector::const_iterator j = num.GetParams().begin(); j != num.GetParams().end() - 1; ++j) - data << "" << Sanitize(*j) << ""; + data << "" << Sanitize(it->first) + << "" << Sanitize(it->second) + << ""; } return data << ""; } @@ -392,15 +397,19 @@ namespace Stats class ModuleHttpStats : public Module, public HTTPRequestEventListener { + private: HTTPdAPI API; + ISupport::EventProvider isupportevprov; bool enableparams; public: ModuleHttpStats() : HTTPRequestEventListener(this) , API(this) + , isupportevprov(this) , enableparams(false) { + isevprov = &isupportevprov; } void ReadConfig(ConfigStatus& status) override -- cgit v1.3.1-10-gc9f91