diff options
author | Sadie Powell <sadie@witchery.services> | 2020-02-18 17:49:32 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-02-18 18:56:14 +0000 |
commit | 2e0cc3684df72b2a8de45b354848af43c6b47606 (patch) | |
tree | 5fb6b9f587309746c2311e5e3043062523cdc122 /include | |
parent | 5ddbcd3f56bb79a5dc6b693fc2c6ad7a46ba5a3c (diff) |
Generalise XLine stats numerics using RPL_STATS from aircd.
Diffstat (limited to 'include')
-rw-r--r-- | include/numerics.h | 1 | ||||
-rw-r--r-- | include/xline.h | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/include/numerics.h b/include/numerics.h index baae8de5c..5a05a61eb 100644 --- a/include/numerics.h +++ b/include/numerics.h @@ -50,6 +50,7 @@ enum RPL_ENDMAP = 17, // ircu RPL_MAPUSERS = 18, // insp-specific + RPL_STATS = 210, // From aircd. RPL_UMODEIS = 221, RPL_LUSERCLIENT = 251, diff --git a/include/xline.h b/include/xline.h index 0aaa21a16..fe564358f 100644 --- a/include/xline.h +++ b/include/xline.h @@ -529,14 +529,15 @@ class CoreExport XLineManager */ void ApplyLines(); - /** Handle /STATS for a given type. - * NOTE: Any items in the list for this particular line type which have expired - * will be expired and removed before the list is displayed. - * @param type The type of stats to show - * @param numeric The numeric to give to each result line - * @param stats Stats context - */ - void InvokeStats(const std::string& type, unsigned int numeric, Stats::Context& stats); + /** DEPRECATED: use the `bool InvokeStats(const std::string&, Stats::Context&)` overload instead. */ + DEPRECATED_METHOD(void InvokeStats(const std::string& type, unsigned int numeric, Stats::Context& stats)); + + /** Generates a /STATS response for the given X-line type. + * @param type The type of X-line to look up. + * @param context The stats context to respond with. + * @return True if a response was sent; otherwise, false. + */ + bool InvokeStats(const std::string& type, Stats::Context& context); /** Expire X-lines which were added by the server configuration and have been removed. */ void ExpireRemovedConfigLines(const std::string& type, const insp::flat_set<std::string>& configlines); |