]> jfr.im git - solanum.git/blobdiff - modules/m_wallops.c
extensions/umode_hide_idle_time: mask times for hidden sources (#373)
[solanum.git] / modules / m_wallops.c
index 8e0ba6e9f88ab313d0f395916395d6eb474545ba..f64bc96e9ee3ef4642b5044fdcc58bc85baba3f1 100644 (file)
 #include "modules.h"
 #include "s_serv.h"
 
-static int mo_operwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_operwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_wallops(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char wallops_desc[] =
+       "Provides the WALLOPS and OPERWALL commands to message online operators";
+
+static void mo_operwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_operwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_wallops(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message wallops_msgtab = {
        "WALLOPS", 0, 0, 0, 0,
@@ -50,27 +53,26 @@ struct Message operwall_msgtab = {
 };
 
 mapi_clist_av1 wallops_clist[] = { &wallops_msgtab, &operwall_msgtab, NULL };
-DECLARE_MODULE_AV2(wallops, NULL, NULL, wallops_clist, NULL, NULL, NULL, NULL, NULL);
+
+DECLARE_MODULE_AV2(wallops, NULL, NULL, wallops_clist, NULL, NULL, NULL, NULL, wallops_desc);
 
 /*
  * mo_operwall (write to *all* opers currently online)
  *      parv[1] = message text
  */
-static int
+static void
 mo_operwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(!IsOperOperwall(source_p))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
                           me.name, source_p->name, "operwall");
-               return 0;
+               return;
        }
 
        sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
        sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
                      use_id(source_p), parv[1]);
-
-       return 0;
 }
 
 /*
@@ -78,30 +80,28 @@ mo_operwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
  *  (write to *all* local opers currently online)
  *      parv[1] = message text
  */
-static int
+static void
 ms_operwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
                      use_id(source_p), parv[1]);
        sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
-
-       return 0;
 }
 
 /*
  * ms_wallops (write to *all* opers currently online)
  *      parv[1] = message text
  */
-static int
+static void
 ms_wallops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        const char *prefix = "";
 
-       if (MyClient(source_p) && !IsOperMassNotice(source_p))
+       if (MyClient(source_p) && !HasPrivilege(source_p, "oper:wallops"))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
-                          me.name, source_p->name, "mass_notice");
-               return 0;
+                          me.name, source_p->name, "wallops");
+               return;
        }
 
        if (IsPerson(source_p))
@@ -117,7 +117,5 @@ ms_wallops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
 
        sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :%s",
                      use_id(source_p), parv[1]);
-
-       return 0;
 }