]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Merge +C (no CTCP to channels) from ircd-seven.
authorWilliam Pitcock <redacted>
Tue, 19 Jan 2010 08:11:04 +0000 (02:11 -0600)
committerWilliam Pitcock <redacted>
Tue, 19 Jan 2010 08:11:04 +0000 (02:11 -0600)
help/opers/cmode
include/channel.h
modules/core/m_message.c
src/chmode.c

index ce084703a6eee7e4ef721d241241683124286517..2fb5096ff14a02d0b4fe371fd07e7ce0e7466e21 100644 (file)
@@ -26,6 +26,8 @@ NO PARAMETERS:
               ops are necessary).
      +Q     - Disable forward.  Users cannot be forwarded to the channel
               (however, new forwards can still be set subject to +F).
+     +C     - Disable CTCP. All CTCP messages to the channel, except ACTION,
+              are disallowed.
 
 WITH PARAMETERS:
      +f     - Forward.  Forwards users who cannot join because of +i,
index b4da1b6edaeabe353cf979295f693e56317df4c1..1e3b5bb45218f0eda456f900ec4e6dcd24ee90c4 100644 (file)
@@ -171,6 +171,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
 #define MODE_FREEINVITE 0x0800  /* allow free use of /invite */
 #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 CHFL_BAN        0x10000000     /* ban channel flag */
 #define CHFL_EXCEPTION  0x20000000     /* exception to ban channel flag */
index 08ccc1d36dd2c33735010dff6c59dd38fc5e6a42..4f726471b2030028e3e3fb350100b32fb1ea4cb1 100644 (file)
@@ -513,12 +513,19 @@ 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 != NOTICE && *text == '\001')
+                       {
+                               if (strncasecmp(text + 1, "ACTION", 6) && chptr->mode.mode & MODE_NOCTCP)
+                               {
+                                       sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN,
+                                                          form_str(ERR_CANNOTSENDTOCHAN), chptr->chname);
+                                       return;
+                               }
+                               else if (rb_dlink_list_length(&chptr->locmembers) > (unsigned)(GlobalSetOptions.floodcount / 2))
+                                       source_p->large_ctcp_sent = rb_current_time();
+                       }
                        sendto_channel_flags(client_p, ALL_MEMBERS, source_p, chptr,
                                             "%s %s :%s", command, chptr->chname, text);
-                       if (p_or_n != NOTICE && *text == '\001' &&
-                                       strncasecmp(text + 1, "ACTION", 6) &&
-                                       rb_dlink_list_length(&chptr->locmembers) > (unsigned)(GlobalSetOptions.floodcount / 2))
-                               source_p->large_ctcp_sent = rb_current_time();
                }
        }
        else if(chptr->mode.mode & MODE_OPMODERATE &&
index 5cbcde396e7d592a283b075347f8dc2ebe46990e..9d67ed256a0c8dd05081a60066f362a58757b809 100644 (file)
@@ -1399,7 +1399,7 @@ struct ChannelMode chmode_table[256] =
   {chm_nosuch, 0 },                    /* @ */
   {chm_nosuch, 0 },                    /* A */
   {chm_nosuch, 0 },                    /* B */
-  {chm_nosuch, 0 },                    /* C */
+  {chm_simple, MODE_NOCTCP },          /* C */
   {chm_nosuch, 0 },                    /* D */
   {chm_nosuch, 0 },                    /* E */
   {chm_simple, MODE_FREETARGET },      /* F */