]> jfr.im git - solanum.git/blobdiff - modules/m_wallops.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / modules / m_wallops.c
index 3301d2507a94b194a849a22f61216ef920b8daa4..db0f9b3973448c8e36514481020de6d850dacc4e 100644 (file)
@@ -27,7 +27,7 @@
 #include "stdinc.h"
 #include "client.h"
 #include "ircd.h"
-#include "irc_string.h"
+#include "match.h"
 #include "numeric.h"
 #include "send.h"
 #include "s_user.h"
 #include "modules.h"
 #include "s_serv.h"
 
-static int mo_operwall(struct Client *, struct Client *, int, const char **);
-static int ms_operwall(struct Client *, struct Client *, int, const char **);
-static int ms_wallops(struct Client *, struct Client *, int, const char **);
+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 **);
 
 struct Message wallops_msgtab = {
-       "WALLOPS", 0, 0, 0, MFLG_SLOW,
+       "WALLOPS", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, {ms_wallops, 2}, {ms_wallops, 2}, mg_ignore, {ms_wallops, 2}}
 };
 struct Message operwall_msgtab = {
-       "OPERWALL", 0, 0, 0, MFLG_SLOW,
+       "OPERWALL", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, {ms_operwall, 2}, mg_ignore, mg_ignore, {mo_operwall, 2}}
 };
 
@@ -59,7 +59,7 @@ DECLARE_MODULE_AV1(wallops, NULL, NULL, wallops_clist, NULL, NULL, "$Revision: 1
  *      parv[1] = message text
  */
 static int
-mo_operwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mo_operwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(!IsOperOperwall(source_p))
        {
@@ -69,10 +69,8 @@ mo_operwall(struct Client *client_p, struct Client *source_p, int parc, const ch
        }
 
        sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
-       sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s", 
+       sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
                      use_id(source_p), parv[1]);
-       sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", 
-                     source_p->name, parv[1]);
 
        return 0;
 }
@@ -80,16 +78,13 @@ mo_operwall(struct Client *client_p, struct Client *source_p, int parc, const ch
 /*
  * ms_operwall - OPERWALL message handler
  *  (write to *all* local opers currently online)
- *      parv[0] = sender prefix
  *      parv[1] = message text
  */
 static int
-ms_operwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+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_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s",
-                     source_p->name, parv[1]);
        sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
 
        return 0;
@@ -100,24 +95,30 @@ ms_operwall(struct Client *client_p, struct Client *source_p, int parc, const ch
  *      parv[1] = message text
  */
 static int
-ms_wallops(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+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))
+       {
+               sendto_one(source_p, form_str(ERR_NOPRIVS),
+                          me.name, source_p->name, "mass_notice");
+               return 0;
+       }
+
        if (IsPerson(source_p))
        {
                if (!strncmp(parv[1], "OPERWALL - ", 11) ||
                                !strncmp(parv[1], "LOCOPS - ", 9) ||
-                               !strncmp(parv[1], "SLOCOPS - ", 10))
+                               !strncmp(parv[1], "SLOCOPS - ", 10) ||
+                               !strncmp(parv[1], "ADMINWALL - ", 12))
                        prefix = "WALLOPS - ";
        }
 
        sendto_wallops_flags(UMODE_WALLOP, source_p, "%s%s", prefix, parv[1]);
 
-       sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :%s", 
+       sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :%s",
                      use_id(source_p), parv[1]);
-       sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s WALLOPS :%s", 
-                     source_p->name, parv[1]);
 
        return 0;
 }