Reed Loden's patch to add /stats J, listing nick jupes. (Plus documentation.)
[ircu2.10.12-pk.git] / ircd / hash.c
index ff777ae58f972c1af2702934bab492bd5b6b874f..571a5023da922a46c581922a7f49f0a90081e14b 100644 (file)
@@ -108,7 +108,7 @@ static HASHREGS strhash(const char *n)
  * I avoided introducing new variables to do the work myself and I did let
  * the optimizer play with more free registers, actual tests proved this
  * solution to be faster than doing things like tmp2=tmp->hnext... and then
- * use tmp2 myself wich would have given less freedom to the optimizer.
+ * use tmp2 myself which would have given less freedom to the optimizer.
  */
 
 /** Prepend a client to the appropriate hash bucket.
@@ -408,6 +408,20 @@ void clearNickJupes(void)
     jupeTable[i][0] = '\000';
 }
 
+/** Report all nick jupes to a user.
+ * @param[in] to Client requesting statistics.
+ * @param[in] sd Stats descriptor for request (ignored).
+ * @param[in] param Extra parameter from user (ignored).
+ */
+void
+stats_nickjupes(struct Client* to, const struct StatDesc* sd, char* param)
+{
+  int i;
+  for (i = 0; i < JUPEHASHSIZE; i++)
+    if (jupeTable[i][0])
+      send_reply(to, RPL_STATSJLINE, jupeTable[i]);
+}
+
 /** Send more channels to a client in mid-LIST.
  * @param[in] cptr Client to send the list to.
  */