X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/439bf4db58d78c3e969461c30fbf68c6e7fae215..ea41b24fd4807e3565bf5f8f293e2efc4c20b62d:/modules/m_monitor.c diff --git a/modules/m_monitor.c b/modules/m_monitor.c index 1274a3c9..4269ad56 100644 --- a/modules/m_monitor.c +++ b/modules/m_monitor.c @@ -26,8 +26,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: m_monitor.c 312 2005-11-07 10:47:33Z jilles $ */ #include "stdinc.h" @@ -41,17 +39,20 @@ #include "send.h" #include "supported.h" +static const char monitor_desc[] = "Provides the MONITOR facility for tracking user signon and signoff"; + static int monitor_init(void); static void monitor_deinit(void); -static int m_monitor(struct Client *, struct Client *, int, const char **); +static void m_monitor(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message monitor_msgtab = { - "MONITOR", 0, 0, 0, MFLG_SLOW, + "MONITOR", 0, 0, 0, 0, {mg_unreg, {m_monitor, 2}, mg_ignore, mg_ignore, mg_ignore, {m_monitor, 2}} }; mapi_clist_av1 monitor_clist[] = { &monitor_msgtab, NULL }; -DECLARE_MODULE_AV1(monitor, monitor_init, monitor_deinit, monitor_clist, NULL, NULL, "$Revision: 312 $"); + +DECLARE_MODULE_AV2(monitor, monitor_init, monitor_deinit, monitor_clist, NULL, NULL, NULL, NULL, monitor_desc); static int monitor_init(void) { @@ -104,9 +105,9 @@ add_monitor(struct Client *client_p, const char *nicks) sendto_one(client_p, "%s", offbuf); if(p) - rb_snprintf(buf, sizeof(buf), "%s,%s", name, p); + snprintf(buf, sizeof(buf), "%s,%s", name, p); else - rb_snprintf(buf, sizeof(buf), "%s", name); + snprintf(buf, sizeof(buf), "%s", name); sendto_one(client_p, form_str(ERR_MONLISTFULL), me.name, client_p->name, @@ -114,6 +115,9 @@ add_monitor(struct Client *client_p, const char *nicks) return; } + if (!clean_nick(name, 0)) + continue; + monptr = find_monitor(name, 1); /* already monitoring this nick */ @@ -320,8 +324,8 @@ show_monitor_status(struct Client *client_p) sendto_one(client_p, "%s", offbuf); } -static int -m_monitor(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +static void +m_monitor(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { switch(parv[1][0]) { @@ -330,7 +334,7 @@ m_monitor(struct Client *client_p, struct Client *source_p, int parc, const char { sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MONITOR"); - return 0; + return; } add_monitor(source_p, parv[2]); @@ -340,7 +344,7 @@ m_monitor(struct Client *client_p, struct Client *source_p, int parc, const char { sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MONITOR"); - return 0; + return; } del_monitor(source_p, parv[2]); @@ -364,7 +368,4 @@ m_monitor(struct Client *client_p, struct Client *source_p, int parc, const char default: break; } - - return 0; } -