Author: LordLuke <lordluke@undernet.org>
authorPerry Lorier <isomer@undernet.org>
Tue, 19 Mar 2002 10:54:28 +0000 (10:54 +0000)
committerPerry Lorier <isomer@undernet.org>
Tue, 19 Mar 2002 10:54:28 +0000 (10:54 +0000)
Log message:

>> This patch will allow an oper to list secret channels via /list if           >> allowed in the F line                                                        >>                                                                              >> F:LIST_CHAN:TRUE|FALSE (default is true)                                     >>                                                                              >> Tested on ircu 2.10.11pl24                                                   >                                                                               >I like this patch, could we have it against the alpha branch tho?              >                                                                               >cvs update -A                                                                  >                                                                               >should get it to you :)                                                        >                                                                                                                                                               This file is for:                                                                                                                                                u2.10.12.alpha.00. Test.undernet.org B27AeEFfIKMpSU

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@677 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/channel.h
include/client.h
include/ircd_features.h
ircd/channel.c
ircd/client.c
ircd/ircd_features.c
ircd/s_user.c

index 14a5324a9b7c7fcebf48186cdf6277ef7d1c3ab0..5f9874cca244ad67a793a89d5218062f1b33eea6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-03-19 LordLuke <lordluke@undernet.org>
+
+       * include/channel.h: Allow opers to view +s channels in /list
+
+       * include/client.h: Add "PRIV_LIST_CHAN" oper privilege
+
+       * include/ircd_features.h: added "LIST_CHAN" feature
+
+       * ircd/channel.c: Allow opers to view +s channels in /list
+
+       * ircd/client.c: Add "PRIV_LIST_CHAN"
+
+       * ircd/ircd_features.c: Add "LIST_CHAN" feature
+
 2002-03-13 Joseph Bongaarts <foxxe@wtfs.net>
 
        * ircd/m_kill.c: Last of the last of the bug fixes (Thanks Spike).
index 861a0108ceaa60381641217089048ddfa5122930..b4e31b83d6523cf15938a017dc3e4e9fb7f2f5bf 100644 (file)
@@ -106,7 +106,8 @@ struct Client;
 /* channel not shown but names are */
 #define HiddenChannel(x)        ((x) && ((x)->mode.mode & MODE_PRIVATE))
 /* channel visible */
-#define ShowChannel(v,c)        (PubChannel(c) || find_channel_member((v),(c)))
+#define ShowChannel(v,c)        (PubChannel(c) || find_channel_member((v),(c)) || \
+                                 (IsAnOper(v)) && HasPriv(v, PRIV_LIST_CHAN))
 #define PubChannel(x)           ((!x) || ((x)->mode.mode & \
                                     (MODE_PRIVATE | MODE_SECRET)) == 0)
 #define is_listed(x)            ((x)->mode.mode & MODE_LISTED)
index 2e563456ff78727e269802120d5933a9a52c5e0e..ffbaf548d3ee04062c09b1a9279c26983e7171f2 100644 (file)
@@ -97,7 +97,9 @@ struct AuthRequest;
 
 #define PRIV_WIDE_GLINE                27 /* oper can set wider G-lines */
 
-#define PRIV_LAST_PRIV         27 /* must be the same as the last priv */
+#define PRIV_LIST_CHAN          28 /* oper can list secret channels */
+
+#define PRIV_LAST_PRIV         28 /* must be the same as the last priv */
 
 #define _PRIV_NBITS            (8 * sizeof(unsigned long))
 
index ddb31db985c900d2998feeb1e41c0ff13c0e520a..fa73a77e82301ce21cf8de6a4fd0a101b18b97e3 100644 (file)
@@ -83,6 +83,7 @@ enum Feature {
   FEAT_UNLIMIT_OPER_QUERY,
   FEAT_LOCAL_KILL_ONLY,
   FEAT_CONFIG_OPERCMDS,
+  FEAT_LIST_CHAN,
 
   /* features that affect global opers on this server */
   FEAT_OPER_KILL,
index a3a761706c77cd7da76cd0f63d6138d39427b77a..9cf805c9536b0780203de4abe7bc4b504ed0d492 100644 (file)
@@ -1313,7 +1313,8 @@ void list_next_channels(struct Client *cptr, int nr)
   {
     for (; chptr; chptr = chptr->next)
     {
-      if (!cli_user(cptr) || (SecretChannel(chptr) && !find_channel_member(cptr, chptr)))
+      if (!cli_user(cptr) || (!(HasPriv(cptr, PRIV_LIST_CHAN) && IsAnOper(cptr)) && 
+          SecretChannel(chptr) && !find_channel_member(cptr, chptr)))
         continue;
       if (chptr->users > args->min_users && chptr->users < args->max_users &&
           chptr->creationtime > args->min_time &&
@@ -1361,7 +1362,7 @@ void list_next_channels(struct Client *cptr, int nr)
  * via 'a', or on server 'B' via either 'b' or 'c', or on server D via 'd'.
  *
  * a) On server A : set CHFL_ZOMBIE for `who' (lp) and pass on the KICK.
- *    Remove the user immedeately when no users are left on the channel.
+ *    Remove the user immediately when no users are left on the channel.
  * b) On server B : remove the user (who/lp) from the channel, send a
  *    PART upstream (to A) and pass on the KICK.
  * c) KICKed by `client'; On server B : remove the user (who/lp) from the
@@ -2262,7 +2263,7 @@ mode_parse_upass(struct ParseState *state, int *flag_p)
     } else {
       send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname,
          "Re-create the channel.  The channel must be *empty* for",
-         TStime() - state->chptr->creationtime >= 171000 ? "48 contigious hours" : "a minute or two",
+         TStime() - state->chptr->creationtime >= 171000 ? "48 contiguous hours" : "a minute or two",
          "before it can be recreated.");
     }
     return;
@@ -2433,7 +2434,7 @@ mode_parse_apass(struct ParseState *state, int *flag_p)
            "You will NOT be able to change this password anymore once the channel is more than 48 hours old!");
        send_reply(state->sptr, RPL_APASSWARN,
            "Use \"/MODE ", state->chptr->chname, " -A ", state->chptr->mode.apass,
-           "\" to remove the password and then immediatly set a new one. "
+           "\" to remove the password and then immediately set a new one. "
            "IMPORTANT: YOU CANNOT RECOVER THIS PASSWORD, EVER; "
            "WRITE THE PASSWORD DOWN (don't store this rescue password on disk)! "
            "Now set the channel user password (+u).");
index 3cbe27d96935d098b427b52c8ed1f2c2a62e7576..db6ce6fb4ed19a72e7f6e51bc13abde9cdc788d7 100644 (file)
@@ -118,6 +118,7 @@ static struct {
   { PRIV_SHOW_ALL_INVIS, FEAT_SHOW_ALL_INVISIBLE_USERS,
     (FLAGS_OPER | FLAGS_LOCOP) },
   { PRIV_UNLIMIT_QUERY, FEAT_UNLIMIT_OPER_QUERY, (FLAGS_OPER | FLAGS_LOCOP) },
+  { PRIV_LIST_CHAN, FEAT_LIST_CHAN, (FLAGS_OPER | FLAGS_LOCOP) },
 
   { PRIV_KILL, FEAT_LOCAL_KILL_ONLY, 0 },
   { PRIV_GLINE, FEAT_CONFIG_OPERCMDS, ~0 },
index 269af261f4f3ad8e57714647080533a9d583e3d7..d9fb2d0c7e50aa020a42e6ca4a4da1e614cf84bd 100644 (file)
@@ -290,6 +290,7 @@ static struct FeatureDesc {
   F_B(UNLIMIT_OPER_QUERY, 0, 0, 0),
   F_B(LOCAL_KILL_ONLY, 0, 0, 0),
   F_B(CONFIG_OPERCMDS, 0, 0, 0),
+  F_B(LIST_CHAN, 0, 1, 0),
 
   /* features that affect global opers on this server */
   F_B(OPER_KILL, 0, 1, 0),
index 82709b3e5a5fab4972d3a6a490996f11dab684ab..b61977c693b25d46cdb74b81ff4fdf37c4ef6230 100644 (file)
@@ -737,7 +737,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
        * then 30 seconds ago. This is intended to get rid of
        * clone bots doing NICK FLOOD. -SeKs
        * If someone didn't change their nick for more then 60 seconds
-       * however, allow to do two nick changes immedately after another
+       * however, allow to do two nick changes immediately after another
        * before limiting the nick flood. -Run
        */
       if (CurrentTime < cli_nextnick(cptr)) {