Reed Loden's patch to add /stats J, listing nick jupes. (Plus documentation.)
[ircu2.10.12-pk.git] / ircd / s_stats.c
index d61f0f59327840f5172eca6e045417608fc7bb66..190e8dbbbf36ced95679ad09f01afcd82a1129cc 100644 (file)
@@ -24,6 +24,7 @@
 #include "class.h"
 #include "client.h"
 #include "gline.h"
+#include "hash.h"
 #include "ircd.h"
 #include "ircd_chattr.h"
 #include "ircd_events.h"
@@ -104,7 +105,7 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd,
       if (tmp->status & CONF_UWORLD)
        send_reply(sptr, RPL_STATSULINE, host);
       else if (tmp->status & CONF_SERVER)
-       send_reply(sptr, RPL_STATSCLINE, name, (host[0] == ':' ? "0" : ""), host, port, maximum, hub_limit, get_conf_class(tmp));
+       send_reply(sptr, RPL_STATSCLINE, name, "", "*", port, maximum, hub_limit, get_conf_class(tmp));
       else if (tmp->status & CONF_CLIENT)
         send_reply(sptr, RPL_STATSILINE,
                    (tmp->host ? tmp->host : "*"), maximum,
@@ -523,9 +524,12 @@ struct StatDesc statsinfo[] = {
   { 'i', "access", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_i,
     stats_access, CONF_CLIENT,
     "Connection authorization lines." },
-  { 'j', "histogram", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_j,
+  { 'j', "histogram", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_j,
     msgq_histogram, 0,
     "Message length histogram." },
+  { 'J', "jupes", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_J,
+    stats_nickjupes, 0,
+    "Nickname jupes." },
   { 'k', "klines", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_k,
     stats_klines, 0,
     "Local bans (K-Lines)." },
@@ -565,7 +569,7 @@ struct StatDesc statsinfo[] = {
     "Local connection statistics (Total SND/RCV, etc)." },
   { 'U', "uworld", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_U,
     stats_configured_links, CONF_UWORLD,
-    "Service server & nick jupes information." },
+    "Service server information." },
   { 'u', "uptime", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_u,
     stats_uptime, 0,
     "Current uptime & highest connection count." },
@@ -619,7 +623,7 @@ stats_cmp(const void *a_, const void *b_)
 /** Compare a StatDesc's name against a string.
  * @param[in] key Pointer to a null-terminated string.
  * @param[in] sd_ Pointer to a StatDesc.
- * @return Less than,qual to, or greater than zero if \a key is
+ * @return Less than, equal to, or greater than zero if \a key is
  * lexicographically less than, equal to, or greater than \a
  * sd_->sd_name.
  */