]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add chmode +E, which prevents ops from using /kick on channels where it is set.
authorB.Greenham <redacted>
Tue, 23 Feb 2010 23:14:43 +0000 (18:14 -0500)
committerB.Greenham <redacted>
Tue, 23 Feb 2010 23:14:43 +0000 (18:14 -0500)
help/opers/cmode
include/channel.h
include/numeric.h
modules/core/m_kick.c
src/chmode.c
src/messages.tab

index c3f84b04d77c73fcacb3cda7cb6633d68a5eb21d..751c1a08d4372900ab932570ab044779858338ef 100644 (file)
@@ -31,6 +31,8 @@ NO PARAMETERS:
      +D     - Disable CTCP ACTION. All CTCP ACTIONs to the channel will
               be blocked.
      +T     - Disable notice. All notices to the channel are disallowed.
+     +E     - No kicks. Chanops will not be able to use /kick on this
+              channel.
 
 WITH PARAMETERS:
      +f     - Forward.  Forwards users who cannot join because of +i,
index c9c3ee1358df270fb5af9c5746484e29c6b45766..4939ff96da8dbe25226835fad66c5aa680f550b8 100644 (file)
@@ -174,6 +174,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
 #define MODE_NOCTCP     0x8000  /* Block CTCPs directed to this channel */
 #define MODE_NONOTICE  0x16000 /* Block notices directed to this channel */
 #define MODE_NOACTION  0x32000 /* Block CTCP ACTION directed to this channel */
+#define MODE_NOKICK    0x64000 /* Disable /kick on this channel */
 
 #define CHFL_BAN        0x10000000     /* ban channel flag */
 #define CHFL_EXCEPTION  0x20000000     /* exception to ban channel flag */
index 1648189967d395a1fdb70ca4260c4b0a1959dc0f..e8cc0f24842100435c916958b0b135ba5f4d8443 100644 (file)
@@ -319,6 +319,8 @@ extern const char *form_str(int);
 
 #define ERR_DISABLED         517 /* from ircu */
 
+#define ERR_NOKICK           519 /* from old shadow */
+
 #define ERR_HELPNOTFOUND     524
 
 #define RPL_WHOISSECURE      671 /* Unreal3.2 --nenolod */
index 88befacdb47e4e0c99c14ac55ec27bedcb41ba7c..841485f871b912ebae3d8fe79c9598b8c4518859 100644 (file)
@@ -158,6 +158,14 @@ m_kick(struct Client *client_p, struct Client *source_p, int parc, const char *p
                        return 0;
                }
 
+               if(MyClient(source_p) && chptr->mode.mode & MODE_NOKICK)
+               {
+                       sendto_one_numeric(source_p, ERR_NOKICK,
+                                       form_str(ERR_NOKICK),
+                                       chptr->chname);
+                       return 0;
+               }
+
                if(MyClient(source_p))
                {
                        hook_data_channel_approval hookdata;
index 7095adeeada60315976af7ad509c61a6c76f14d7..a1fbbce8941686bf7b75b112d14e0067270832e9 100644 (file)
@@ -1401,7 +1401,7 @@ struct ChannelMode chmode_table[256] =
   {chm_nosuch, 0 },                    /* B */
   {chm_simple, MODE_NOCTCP },          /* C */
   {chm_simple, MODE_NOACTION },        /* D */
-  {chm_nosuch, 0 },                    /* E */
+  {chm_simple, MODE_NOKICK },          /* E */
   {chm_simple, MODE_FREETARGET },      /* F */
   {chm_nosuch, 0 },                    /* G */
   {chm_nosuch, 0 },                    /* H */
index cce3b41de34d89691f6b74b24c1b75eb207186be..c24ebd25de271a082ce7bcfead18816d238e5b1a 100644 (file)
@@ -540,7 +540,7 @@ static  const char *  replies[] = {
 /* 516 */      NULL,
 /* 517 ERR_DISABLED */         "%s :This command has been administratively disabled",
 /* 518 */      NULL,
-/* 519 */      NULL,
+/* 519 ERR_NOKICK */           "%s :You cannot kick users in this channel because +E is set",
 /* 520 */      NULL,
 /* 521 */      NULL,
 /* 522 */      NULL,