Consolidate use_registered_mode into off_channel and expand overall functionality
authoradam <adam@gamesurge.net>
Wed, 15 Sep 2004 04:14:14 +0000 (04:14 +0000)
committeradam <adam@gamesurge.net>
Wed, 15 Sep 2004 04:14:14 +0000 (04:14 +0000)
* srvx.conf's off_channel setting now allows us to turn on all of the features of out-of-channel services without activating the
channel setting to have chanserv part

git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-81

ChangeLog
src/chanserv.c
srvx.conf.example

index 22113d3cd8b3836ede179b3baeb0872f2635e265..0d9f1145246c3c227b875990b9d7a0146ca83be2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,23 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
 #
 
+2004-09-15 04:14:14 GMT        adam <adam@gamesurge.net>       patch-81
+
+    Summary:
+      Consolidate use_registered_mode into off_channel and expand overall functionality
+    Revision:
+      srvx--devo--1.3--patch-81
+
+    * srvx.conf's off_channel setting now allows us to turn on all of the features of out-of-channel services without activating the
+    channel setting to have chanserv part
+    
+    
+    
+
+    modified files:
+     ChangeLog src/chanserv.c srvx.conf.example
+
+
 2004-09-13 13:11:38 GMT        Michael Poole <mdpoole@troilus.org>     patch-80
 
     Summary:
index 61eba388d749fce02cee2ac37ff5f27b740d0a63..abba31fa3717cfa974ea4014edba4a7f25c531b8 100644 (file)
@@ -502,8 +502,6 @@ static struct
     unsigned int       max_chan_bans;
     unsigned int        max_userinfo_length;
 
-    unsigned int       use_registered_mode;
-
     struct string_list  *set_shows;
     struct string_list  *eightball;
     struct string_list  *old_ban_names;
@@ -1292,7 +1290,7 @@ unregister_channel(struct chanData *channel, const char *reason)
 
     timeq_del(0, NULL, channel, TIMEQ_IGNORE_FUNC | TIMEQ_IGNORE_WHEN);
 
-    if(chanserv_conf.use_registered_mode)
+    if(off_channel > 0)
     {
       mod_chanmode_init(&change);
       change.modes_clear |= MODE_REGISTERED;
@@ -1753,7 +1751,7 @@ static CHANSERV_FUNC(cmd_register)
     cData = register_channel(channel, user->handle_info->handle);
     scan_user_presence(add_channel_user(cData, handle, UL_OWNER, 0, NULL), NULL);
     cData->modes = chanserv_conf.default_modes;
-    if(chanserv_conf.use_registered_mode)
+    if(off_channel > 0)
       cData->modes.modes_set |= MODE_REGISTERED;
     change = mod_chanmode_dup(&cData->modes, 1);
     change->args[change->argc].mode = MODE_CHANOP;
@@ -1913,7 +1911,7 @@ static CHANSERV_FUNC(cmd_move)
         mod_chanmode_announce(chanserv, target, &change);
     }
 
-    if(chanserv_conf.use_registered_mode)
+    if(off_channel > 0)
     {
         /* Clear MODE_REGISTERED from old channel, add it to new. */
         change.argc = 0;
@@ -6468,9 +6466,7 @@ chanserv_conf_read(void)
     /* the variable itself is actually declared in proto-common.c; this is equally 
      * parse issue. */
     str = database_get_data(conf_node, "off_channel", RECDB_QSTRING);
-    off_channel = (str && enabled_string(str)) ? 1 : 0;
-    str = database_get_data(conf_node, "use_registered_mode", RECDB_QSTRING);
-    chanserv_conf.use_registered_mode = (str && enabled_string(str)) ? 1 : 0;
+    off_channel = str ? atoi(str) : 0;
 }
 
 static void
@@ -6780,7 +6776,7 @@ chanserv_channel_read(const char *key, struct record_data *hir)
        && (argc = split_line(str, 0, ArrayLength(argv), argv))
        && (modes = mod_chanmode_parse(cNode, argv, argc, MCP_KEY_FREE))) {
         cData->modes = *modes;
-       if(chanserv_conf.use_registered_mode)
+       if(off_channel > 0)
           cData->modes.modes_set |= MODE_REGISTERED;
         if(cData->modes.argc > 1)
             cData->modes.argc = 1;
@@ -7264,7 +7260,7 @@ init_chanserv(const char *nick)
     DEFINE_CHANNEL_OPTION(ctcpusers);
     DEFINE_CHANNEL_OPTION(ctcpreaction);
     DEFINE_CHANNEL_OPTION(inviteme);
-    if(off_channel)
+    if(off_channel > 1)
         DEFINE_CHANNEL_OPTION(offchannel);
     modcmd_register(chanserv_module, "set defaults", chan_opt_defaults, 1, 0, "access", "owner", NULL);
 
index 8145b1fb7893f20c2d1371cc81f8093f2d723d6f..fa446b212473853b969a1bd1fd56d7e77c4d7227 100644 (file)
        // 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?
-        // Bahamut does; ircu2.10.11 does not.
-        "off_channel" "off";
-       // Does your ircd have a mode for registered channels?
-       // Bahamut does; ircu2.10.11 does not.
-       "use_registered_mode" "off";
+        // Does your ircd have off-channel services support? Does it have
+       // 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
+        "off_channel" "0";
         // how long should a person be unseen before resending infoline?
         "info_delay" "120";
         // maximum greeting length