]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_conf.c
Add channel::exemptchanops, and make +cCDTNG support it.
[irc/rqf/shadowircd.git] / src / s_conf.c
index 5eb07d552d6a873e801b110a73ec498fdbf561c4..66d407cef8ba768d5aa33d5e3ac59316b76af9c2 100644 (file)
@@ -747,6 +747,7 @@ set_default_conf(void)
        ConfigFileEntry.oper_snomask = SNO_GENERAL;
 
        ConfigChannel.autochanmodes = rb_strdup("nt");
+       ConfigChannel.exemptchanops = rb_strdup("");
        ConfigChannel.use_halfop = YES;
        ConfigChannel.use_owner = YES;
        ConfigChannel.use_except = YES;
@@ -772,6 +773,14 @@ set_default_conf(void)
        ConfigChannel.resv_forcepart = YES;
        ConfigChannel.kick_no_rejoin_time = 30;
 
+       ConfigChannel.exempt_cmode_c = NO;
+       ConfigChannel.exempt_cmode_C = NO;
+       ConfigChannel.exempt_cmode_D = NO;
+       ConfigChannel.exempt_cmode_T = NO;
+       ConfigChannel.exempt_cmode_N = NO;
+       ConfigChannel.exempt_cmode_G = NO;
+       ConfigChannel.exempt_cmode_K = NO;
+
        ConfigServerHide.flatten_links = 0;
        ConfigServerHide.links_delay = 300;
        ConfigServerHide.hidden = 0;
@@ -866,6 +875,46 @@ validate_conf(void)
                splitmode = 0;
                splitchecking = 0;
        }
+
+       /* Parse the exemptchanops option and set the internal variables
+        * that we will use. */
+       char * ech;
+
+       for(ech = ConfigChannel.exemptchanops; *ech; ech++)
+       {
+               if(*ech == 'c')
+               {
+                       ConfigChannel.exempt_cmode_c = 1;
+                       continue;
+               }
+               if(*ech == 'C')
+               {
+                       ConfigChannel.exempt_cmode_C = 1;
+                       continue;
+               }
+               if(*ech == 'D')
+               {
+                       ConfigChannel.exempt_cmode_D = 1;
+                       continue;
+               }
+               if(*ech == 'T')
+               {
+                       ConfigChannel.exempt_cmode_T = 1;
+                       continue;
+               }
+               if(*ech == 'N')
+               {
+                       ConfigChannel.exempt_cmode_N = 1;
+                       continue;
+               }
+               if(*ech == 'G')
+               {
+                       ConfigChannel.exempt_cmode_G = 1;
+                       continue;
+               }
+               if(*ech == 'K')
+                       ConfigChannel.exempt_cmode_K = 1;
+       }
 }
 
 /* add_temp_kline()