summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2016-06-05 14:16:36 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2016-06-05 17:47:56 +0100
commit8d5135c419951a37dddfaf7d653fe28803e37ce0 (patch)
tree73aa6f15175669e3b97edac09668032afd47b784
parent52f2f768af8fbc251924c510eecb87f16b6af5bb (diff)
Add support for hidden command modules
-rw-r--r--include/parse.h1
-rw-r--r--src/parse.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/include/parse.h b/include/parse.h
index 4f00054..607233e 100644
--- a/include/parse.h
+++ b/include/parse.h
@@ -149,6 +149,7 @@ struct Message
#define MFLG_SLOW 0x001 /* Command can be executed roughly
* once per 2 seconds.
*/
+#define MFLG_HIDDEN 0x002
#define MAXPARA 15
extern void parse(struct Client *, char *, char *);
diff --git a/src/parse.c b/src/parse.c
index 447dcd2..fdc2da3 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -524,10 +524,14 @@ recurse_report_messages(struct Client *source_p, const struct MessageTree *mtree
unsigned int i;
if (mtree->msg != NULL)
- sendto_one(source_p, form_str(RPL_STATSCOMMANDS),
+ {
+ if (!(mtree->msg->flags & MFLG_HIDDEN) ||
+ HasUMode(source_p, UMODE_ADMIN))
+ sendto_one(source_p, form_str(RPL_STATSCOMMANDS),
me.name, source_p->name, mtree->msg->cmd,
mtree->msg->count, mtree->msg->bytes,
mtree->msg->rcount);
+ }
for (i = 0; i < MAXPTRLEN; ++i)
if (mtree->pointers[i] != NULL)