added revoke_mode_a setting
authorpk910 <philipp@zoelle1.de>
Tue, 7 Feb 2012 13:19:36 +0000 (14:19 +0100)
committerpk910 <philipp@zoelle1.de>
Tue, 7 Feb 2012 13:19:36 +0000 (14:19 +0100)
src/chanserv.c
srvx.conf.example

index 75122799b0d28a6e729cea46cbe3d51f9eb3652a..e06cf468053de91c6afa5030f2f17ffed0203299 100644 (file)
@@ -58,6 +58,7 @@
 #define KEY_MAX_USERINFO_LENGTH     "max_userinfo_length"
 #define KEY_GIVEOWNERSHIP_PERIOD    "giveownership_timeout"
 #define KEY_INVITED_INTERVAL           "invite_timeout"
+#define KEY_REVOKE_MODE_A           "revoke_mode_a"
 #define KEY_NEW_CHANNEL_AUTHED      "new_channel_authed_join"
 #define KEY_NEW_CHANNEL_UNAUTHED    "new_channel_unauthed_join"
 #define KEY_NEW_CHANNEL_MSG         "new_channel_message"
@@ -568,6 +569,8 @@ static struct
     unsigned int    max_chan_users;
     unsigned int    max_chan_bans;
     unsigned int    max_userinfo_length;
+    
+    unsigned int    revoke_mode_a;
 
     struct string_list  *set_shows;
     struct string_list  *eightball;
@@ -1438,11 +1441,13 @@ unregister_channel(struct chanData *channel, const char *reason)
 
     timeq_del(0, NULL, channel, TIMEQ_IGNORE_FUNC | TIMEQ_IGNORE_WHEN);
 
-    if(off_channel > 0)
-    {
-      mod_chanmode_init(&change);
-      change.modes_clear |= MODE_REGISTERED;
-      mod_chanmode_announce(chanserv, channel->channel, &change);
+    if(off_channel > 0 || chanserv_conf.revoke_mode_a) {
+        mod_chanmode_init(&change);
+        if(off_channel > 0)
+            change.modes_clear |= MODE_REGISTERED;
+        if(chanserv_conf.revoke_mode_a)
+            change.modes_clear |= MODE_ACCESS;
+        mod_chanmode_announce(chanserv, channel->channel, &change);
     }
 
     while(channel->users)
@@ -7659,6 +7664,8 @@ chanserv_conf_read(void)
     chanserv_conf.dnr_expire_frequency = str ? ParseInterval(str) : 3600;
     str = database_get_data(conf_node, KEY_INVITED_INTERVAL, RECDB_QSTRING);
     chanserv_conf.invited_timeout = str ? ParseInterval(str) : 600*2;
+    str = database_get_data(conf_node, KEY_REVOKE_MODE_A, RECDB_QSTRING);
+    chanserv_conf.revoke_mode_a = str ? atoi(str) : 1;
     str = database_get_data(conf_node, KEY_NODELETE_LEVEL, RECDB_QSTRING);
     chanserv_conf.nodelete_level = str ? atoi(str) : 1;
     str = database_get_data(conf_node, KEY_MAX_CHAN_USERS, RECDB_QSTRING);
index 331975133d9a93dcb109339ce1f95cbf8c11264f..83ffb71c00a44b5a64c8bacb210b0f1d5d79c18e 100644 (file)
 "services" {
     "nickserv" {
         "nick" "NickServ";
-       // What user modes do you want this service to have? Please keep in
-       // mind which ircd software you are using here, and that all of the
-       // services need to be at least +o.
-       // "modes" "+iok";
+        // What user modes do you want this service to have? Please keep in
+        // mind which ircd software you are using here, and that all of the
+        // services need to be at least +o.
+        // "modes" "+iok";
         // If you want to by have *@* as the default hostmask for all
         // new accounts, set default_hostmask.  This is discouraged
         // for security reasons.
             "uc_H" "800"; // .. and upper case H
             "S" "999";
             "b" "800";
-                       "I" "800";
+                        "I" "800";
         };
         // and for who can change epithets for staff
         "set_epithet_level" "800";
 
     "opserv" {
         "nick" "OpServ";
-       // What user modes do you want this service to have? Please keep in
-       // mind which ircd software you are using here, and that all of the
-       // services need to be at least +o.
-       // "modes" "+iok";
+        // What user modes do you want this service to have? Please keep in
+        // mind which ircd software you are using here, and that all of the
+        // services need to be at least +o.
+        // "modes" "+iok";
         // should use of this service be limited to global opers?
         "privileged" "1";
         // fullname for service
         // (This is changed relative srvx-1.0.x, which would use default
         // unless you specified ".disabled".)
         "nick" "ChanServ";
-       // What user modes do you want this service to have? Please keep in
-       // mind which ircd software you are using here, and that all of the
-       // services need to be at least +o.
-       // "modes" "+iok";
+        // What user modes do you want this service to have? Please keep in
+        // mind which ircd software you are using here, and that all of the
+        // services need to be at least +o.
+        // "modes" "+iok";
         // Does your ircd have off-channel services support? Does it have
-       // a registered channel mode? Does it support services opping themselves?
+        // a registered channel mode? Does it support services opping themselves?
         // Bahamut has these things; ircu2.10.11 does not.
-       // This setting takes three numerical values:
-       //   0 = off
-       //   1 = use a registered channel mode, have services op themselves
-       //   2 = all of the above, and a channel setting to have ChanServ not
-       //       idle in the channel
+        // This setting takes three numerical values:
+        //   0 = off
+        //   1 = use a registered channel mode, have services op themselves
+        //   2 = all of the above, and a channel setting to have ChanServ not
+        //       idle in the channel
         "off_channel" "0";
+        // revoke channel mode +a on unregister?
+        "revoke_mode_a" "1";
         // how long should a person be unseen before resending infoline?
         "info_delay" "120";
         // maximum greeting length
 
     "global" {
         "nick" "Global";
-       // What user modes do you want this service to have? Please keep in
-       // mind which ircd software you are using here, and that all of the
-       // services need to be at least +o.
-       // "modes" "+iok";
+        // What user modes do you want this service to have? Please keep in
+        // mind which ircd software you are using here, and that all of the
+        // services need to be at least +o.
+        // "modes" "+iok";
         // should users get community announcements by default or not?
         "announcements_default" "on";
     };