From 8d5135c419951a37dddfaf7d653fe28803e37ce0 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 5 Jun 2016 14:16:36 +0100 Subject: Add support for hidden command modules --- include/parse.h | 1 + src/parse.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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) -- cgit