monitor: Show 005 entry only if m_monitor.so is actually loaded.

This only affects the MONITOR=<max> entry, not TARGMAX=...,MONITOR:
which is harder to modify from a module.
This commit is contained in:
Jilles Tjoelker 2015-11-15 00:20:14 +01:00
parent 0b05d1aad5
commit 439bf4db58
2 changed files with 15 additions and 2 deletions

View file

@ -39,7 +39,10 @@
#include "numeric.h" #include "numeric.h"
#include "s_conf.h" #include "s_conf.h"
#include "send.h" #include "send.h"
#include "supported.h"
static int monitor_init(void);
static void monitor_deinit(void);
static int m_monitor(struct Client *, struct Client *, int, const char **); static int m_monitor(struct Client *, struct Client *, int, const char **);
struct Message monitor_msgtab = { struct Message monitor_msgtab = {
@ -48,7 +51,18 @@ struct Message monitor_msgtab = {
}; };
mapi_clist_av1 monitor_clist[] = { &monitor_msgtab, NULL }; mapi_clist_av1 monitor_clist[] = { &monitor_msgtab, NULL };
DECLARE_MODULE_AV1(monitor, NULL, NULL, monitor_clist, NULL, NULL, "$Revision: 312 $"); DECLARE_MODULE_AV1(monitor, monitor_init, monitor_deinit, monitor_clist, NULL, NULL, "$Revision: 312 $");
static int monitor_init(void)
{
add_isupport("MONITOR", isupport_intptr, &ConfigFileEntry.max_monitor);
return 0;
}
static void monitor_deinit(void)
{
delete_isupport("MONITOR");
}
static void static void
add_monitor(struct Client *client_p, const char *nicks) add_monitor(struct Client *client_p, const char *nicks)

View file

@ -338,7 +338,6 @@ init_isupport(void)
add_isupport("CPRIVMSG", isupport_string, ""); add_isupport("CPRIVMSG", isupport_string, "");
add_isupport("CNOTICE", isupport_string, ""); add_isupport("CNOTICE", isupport_string, "");
add_isupport("DEAF", isupport_umode, "D"); add_isupport("DEAF", isupport_umode, "D");
add_isupport("MONITOR", isupport_intptr, &ConfigFileEntry.max_monitor);
add_isupport("FNC", isupport_string, ""); add_isupport("FNC", isupport_string, "");
add_isupport("TARGMAX", isupport_targmax, NULL); add_isupport("TARGMAX", isupport_targmax, NULL);
add_isupport("EXTBAN", isupport_extban, NULL); add_isupport("EXTBAN", isupport_extban, NULL);