]> jfr.im git - irc/Elemental-IRCd/elemental-ircd.git/commitdiff
Add channel mode +u to hide banlists
authorSam Dodrill <redacted>
Thu, 29 May 2014 02:36:14 +0000 (19:36 -0700)
committerSam Dodrill <redacted>
Thu, 29 May 2014 02:36:14 +0000 (19:36 -0700)
Banlists are silently hidden from all non-halfops or up. Bans still may
be seen as normally. This mode is entirely opt-in.

help/opers/cmode
help/users/cmode
include/channel.h
src/chmode.c

index d9b6771d729edcbd6f0cece70bcc0672e36f7d5a..1c67bafb2322936994ae146b6f4fdb024d236bd2 100644 (file)
@@ -26,6 +26,8 @@ NO PARAMETERS:
               weakens +i control.
      +z     - Op moderated.  Messages blocked by +m, +b and +q are instead
               sent to ops.
+     +u     - Hidden ban/quiet list. Ban/quiet lists may only be seen
+              by halfops or higher.
    * +L     - Large ban list.  Increase maximum number of +beIq entries.
    * +P     - Permanent.  Channel does not disappear when empty.
      +F     - Free target.  Anyone may set forwards to this (otherwise
index ca10f2fd3a2a21f7c86bda63f4dc8f34e5529ec5..cbe6b35ee8819730b86a491c517ced5bc90fde42 100644 (file)
@@ -24,6 +24,8 @@ NO PARAMETERS:
               change nick.
      +g     - Free invite.  Everyone may invite users.  Significantly
               weakens +i control.
+     +u     - Hidden ban/quiet lists. Ban/quiet lists are hidden from all
+              channel members that are not a halfop or higher.
      +z     - Op moderated.  Messages blocked by +m, +b and +q are instead
               sent to ops.
    * +L     - Large ban list.  Increase maximum number of +beIq entries.
index 553a92836b7879f910c72875d7e18faecc59b178..ed045051cd0443001d287e601158e87998bcc7f8 100644 (file)
@@ -191,6 +191,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
 #define MODE_NOREJOIN  0x200000 /* Block rejoin immediately after kick */
 #define MODE_NOREPEAT  0x400000 /* Block repeat messages */
 #define MODE_NOOPERKICK        0x800000 /* disallow kicking opers */
+#define MODE_HIDEBANS  0x1000000 /* disallow non-chanops from seeing ban/quiet lists */
 
 #define CHFL_BAN        0x10000000     /* ban channel flag */
 #define CHFL_EXCEPTION  0x20000000     /* exception to ban channel flag */
index cf6220d067a480d5d50f791491d45e51caa698e0..d7318c362a9b5eaff8a26e818de77aa59e7e58fb 100644 (file)
@@ -907,13 +907,16 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
                        }
                }
 
-               RB_DLINK_FOREACH(ptr, list->head)
-               {
-                       banptr = ptr->data;
-                       sendto_one(source_p, form_str(rpl_list),
-                                  me.name, source_p->name, chptr->chname,
-                                  banptr->banstr, banptr->who, banptr->when);
+               if(!(chptr->mode.mode & MODE_HIDEBANS) || alevel & ONLY_CHANOPS) {
+                       RB_DLINK_FOREACH(ptr, list->head)
+                       {
+                               banptr = ptr->data;
+                               sendto_one(source_p, form_str(rpl_list),
+                                          me.name, source_p->name, chptr->chname,
+                                          banptr->banstr, banptr->who, banptr->when);
+                       }
                }
+
                sendto_one(source_p, form_str(rpl_endlist), me.name, source_p->name, chptr->chname);
                return;
        }
@@ -2004,7 +2007,7 @@ struct ChannelMode chmode_table[256] =
   {chm_simple, MODE_REGONLY },         /* r */
   {chm_simple, MODE_SECRET },          /* s */
   {chm_simple, MODE_TOPICLIMIT },      /* t */
-  {chm_nosuch, 0 },                    /* u */
+  {chm_simple, MODE_HIDEBANS },        /* u */
   {chm_voice,  0 },                    /* v */
   {chm_nosuch, 0 },                    /* w */
   {chm_nosuch, 0 },                    /* x */