ChanServ bugfixes for +z and addbans in suspended channels
authorMichael Poole <mdpoole@troilus.org>
Mon, 13 Sep 2004 13:11:38 +0000 (13:11 +0000)
committerMichael Poole <mdpoole@troilus.org>
Mon, 13 Sep 2004 13:11:38 +0000 (13:11 +0000)
If ChanServ should use MODE_REGISTERED, update that when moving channels.

Do not check for bans against an auth'ing user in suspended channels.

Change the example entries for off_channel and use_registered_mode to
make the enabled/on values more obvious.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-80

ChangeLog
src/chanserv.c
srvx.conf.example

index 2d7e6789881a69f33a5f76325ad678a5e6d23f56..22113d3cd8b3836ede179b3baeb0872f2635e265 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,24 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
 #
 
+2004-09-13 13:11:38 GMT        Michael Poole <mdpoole@troilus.org>     patch-80
+
+    Summary:
+      ChanServ bugfixes for +z and addbans in suspended channels
+    Revision:
+      srvx--devo--1.3--patch-80
+
+    If ChanServ should use MODE_REGISTERED, update that when moving channels.
+    
+    Do not check for bans against an auth'ing user in suspended channels.
+    
+    Change the example entries for off_channel and use_registered_mode to
+    make the enabled/on values more obvious.
+
+    modified files:
+     ChangeLog src/chanserv.c srvx.conf.example
+
+
 2004-09-08 23:36:51 GMT        Michael Poole <mdpoole@troilus.org>     patch-79
 
     Summary:
index 0a2bbd762bceb5d15eae2b14c6762130c44a4451..61eba388d749fce02cee2ac37ff5f27b740d0a63 100644 (file)
@@ -1845,6 +1845,7 @@ static CHANSERV_FUNC(cmd_unregister)
 
 static CHANSERV_FUNC(cmd_move)
 {
+    struct mod_chanmode change;
     struct chanNode *target;
     struct modeNode *mn;
     struct userData *uData;
@@ -1886,6 +1887,7 @@ static CHANSERV_FUNC(cmd_move)
         }
     }
 
+    mod_chanmode_init(&change);
     if(!(target = GetChannel(argv[1])))
     {
         target = AddChannel(argv[1], now, NULL, NULL);
@@ -1905,14 +1907,23 @@ static CHANSERV_FUNC(cmd_move)
     }
     else if(!IsSuspended(channel->channel_info))
     {
-        struct mod_chanmode change;
-        mod_chanmode_init(&change);
         change.argc = 1;
         change.args[0].mode = MODE_CHANOP;
         change.args[0].u.member = AddChannelUser(chanserv, target);
         mod_chanmode_announce(chanserv, target, &change);
     }
 
+    if(chanserv_conf.use_registered_mode)
+    {
+        /* Clear MODE_REGISTERED from old channel, add it to new. */
+        change.argc = 0;
+        change.modes_clear = MODE_REGISTERED;
+        mod_chanmode_announce(chanserv, channel, &change);
+        change.modes_clear = 0;
+        change.modes_set = MODE_REGISTERED;
+        mod_chanmode_announce(chanserv, target, &change);
+    }
+
     /* Move the channel_info to the target channel; it
        shouldn't be necessary to clear timeq callbacks
        for the old channel. */
@@ -6023,7 +6034,8 @@ handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
         struct banData *ban;
 
         if((user->channels.list[ii]->modes & (MODE_CHANOP|MODE_VOICE))
-           || !channel->channel_info)
+           || !channel->channel_info
+           || IsSuspended(channel->channel_info))
             continue;
         for(jj = 0; jj < channel->banlist.used; ++jj)
             if(user_matches_glob(user, channel->banlist.list[jj]->ban, 1))
index 23b6a4aebdb65e2c5985a8d6b7522dc163e1da52..8145b1fb7893f20c2d1371cc81f8093f2d723d6f 100644 (file)
        // "modes" "+iok";
         // Does your ircd have off-channel services support?
         // Bahamut does; ircu2.10.11 does not.
-        "off_channel" "no";
+        "off_channel" "off";
        // Does your ircd have a mode for registered channels?
        // Bahamut does; ircu2.10.11 does not.
-       "use_registered_mode" "no";
+       "use_registered_mode" "off";
         // how long should a person be unseen before resending infoline?
         "info_delay" "120";
         // maximum greeting length