From: William Pitcock Date: Sun, 5 Feb 2012 03:33:54 +0000 (-0600) Subject: m_stats: iterate capability indexes on /stats C X-Git-Url: https://jfr.im/git/solanum.git/commitdiff_plain/ac37f16a3dbd948446403bc3e4ba8fc99cb2ddb1 m_stats: iterate capability indexes on /stats C --- diff --git a/modules/m_stats.c b/modules/m_stats.c index b9ab3907..c3f36fd5 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -120,6 +120,8 @@ static void stats_servlinks(struct Client *); static void stats_ltrace(struct Client *, int, const char **); static void stats_ziplinks(struct Client *); static void stats_comm(struct Client *); +static void stats_capability(struct Client *); + /* This table contains the possible stats items, in order: * stats letter, function to call, operonly? adminonly? * case only matters in the stats letter column.. -- fl_ @@ -131,7 +133,7 @@ static struct StatsStruct stats_cmd_table[] = { {'b', stats_delay, 1, 1, }, {'B', stats_hash, 1, 1, }, {'c', stats_connect, 0, 0, }, - {'C', stats_connect, 0, 0, }, + {'C', stats_capability, 1, 1, }, {'d', stats_tdeny, 1, 0, }, {'D', stats_deny, 1, 0, }, {'e', stats_exempt, 1, 0, }, @@ -706,6 +708,20 @@ stats_oper(struct Client *source_p) } } +static void +stats_capability_walk(const char *line, void *data) +{ + struct Client *client_p = data; + + sendto_one_numeric(client_p, RPL_STATSDEBUG, "C :%s", line); +} + +static void +stats_capability(struct Client *client_p) +{ + capability_index_stats(stats_capability_walk, client_p); +} + static void stats_privset(struct Client *source_p) {