]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_wallops.c
Filter bogus CTCP ACTION messages.
[irc/rqf/shadowircd.git] / modules / m_wallops.c
index 82a29657f25ad699e5afcad20eaf82632c1221ac..58a83d8275134c995b2efc2cb99e3d6aecfca275 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_wallops.c 1377 2006-05-20 13:48:37Z jilles $
  */
 
 #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"
@@ -71,8 +70,6 @@ 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", 
                      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,7 +77,6 @@ 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
@@ -88,8 +84,6 @@ ms_operwall(struct Client *client_p, struct Client *source_p, int parc, const ch
 {
        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;
@@ -104,6 +98,13 @@ ms_wallops(struct Client *client_p, struct Client *source_p, int parc, const cha
 {
        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) ||
@@ -117,8 +118,6 @@ ms_wallops(struct Client *client_p, struct Client *source_p, int parc, const cha
 
        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;
 }