]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add chmode +T, which blocks notices.
authorB.Greenham <redacted>
Tue, 23 Feb 2010 05:49:24 +0000 (00:49 -0500)
committerB.Greenham <redacted>
Tue, 23 Feb 2010 05:49:24 +0000 (00:49 -0500)
help/opers/cmode
include/channel.h
modules/core/m_message.c
src/chmode.c

index 2fb5096ff14a02d0b4fe371fd07e7ce0e7466e21..85943254fcb31d7e89c2b350f05832eabe7407e7 100644 (file)
@@ -28,6 +28,7 @@ NO PARAMETERS:
               (however, new forwards can still be set subject to +F).
      +C     - Disable CTCP. All CTCP messages to the channel, except ACTION,
               are disallowed.
+     +T     - Disable notice. All notices to the channel are disallowed.
 
 WITH PARAMETERS:
      +f     - Forward.  Forwards users who cannot join because of +i,
index 1e3b5bb45218f0eda456f900ec4e6dcd24ee90c4..d9c46e2187132a5cc19ca80889062ec82bf68805 100644 (file)
@@ -172,6 +172,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
 #define MODE_FREETARGET 0x1000  /* can be forwarded to without authorization */
 #define MODE_DISFORWARD 0x2000  /* disable channel forwarding */
 #define MODE_NOCTCP     0x8000  /* Block CTCPs directed to this channel */
+#define MODE_NONOTICE  0x16000 /* Block notices directed to this channel */
 
 #define CHFL_BAN        0x10000000     /* ban channel flag */
 #define CHFL_EXCEPTION  0x20000000     /* exception to ban channel flag */
index cd35b33c345411f606d543c098533c428ccdf9c4..c94a1b3117d169520ecc3e2fa8e5de5187b84154 100644 (file)
@@ -513,6 +513,12 @@ msg_channel(int p_or_n, const char *command,
                if(result == CAN_SEND_OPV ||
                   !flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
                {
+                       if (p_or_n != PRIVMSG && chptr->mode.mode & MODE_NONOTICE)
+                       {
+                               sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN,
+                                               form_str(ERR_CANNOTSENDTOCHAN), chptr->chname);
+                               return;
+                       }
                        if (p_or_n != NOTICE && *text == '\001' &&
                                        strncasecmp(text + 1, "ACTION", 6))
                        {
index 9d67ed256a0c8dd05081a60066f362a58757b809..b518733f98aea4bcc105b6e8f990ad94d284f95f 100644 (file)
@@ -1416,7 +1416,7 @@ struct ChannelMode chmode_table[256] =
   {chm_simple, MODE_DISFORWARD },      /* Q */
   {chm_nosuch, 0 },                    /* R */
   {chm_nosuch, 0 },                    /* S */
-  {chm_nosuch, 0 },                    /* T */
+  {chm_simple, MODE_NONOTICE },        /* T */
   {chm_nosuch, 0 },                    /* U */
   {chm_nosuch, 0 },                    /* V */
   {chm_nosuch, 0 },                    /* W */