diff options
| author | 2020-01-05 14:41:06 +0000 | |
|---|---|---|
| committer | 2020-01-05 14:41:06 +0000 | |
| commit | f8013e089955329bbf915c1617f668618533c266 (patch) | |
| tree | 6244df0adc4dea3e2fd9af4158648d7d4bac9d03 /src/modules/m_httpd_stats.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Move ISupport logic out of the core and into core_info.
Diffstat (limited to 'src/modules/m_httpd_stats.cpp')
| -rw-r--r-- | src/modules/m_httpd_stats.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
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 << "<isupport>"; - const std::vector<Numeric::Numeric>& isupport = ServerInstance->ISupport.GetLines(); - for (std::vector<Numeric::Numeric>::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<std::string>::const_iterator j = num.GetParams().begin(); j != num.GetParams().end() - 1; ++j) - data << "<token>" << Sanitize(*j) << "</token>"; + data << "<token><name>" << Sanitize(it->first) + << "</name><value>" << Sanitize(it->second) + << "</value></token>"; } return data << "</isupport>"; } @@ -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 |
