]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-channel.c
New configuration option "OperChanPAutoOp"
[ngircd-alex.git] / src / ngircd / irc-channel.c
index 9e88e1bd0031de480a33d3ddfb5b447fed81d013..4a157d67e5fca76d8461f421644da3d00e7b7dd0 100644 (file)
@@ -167,8 +167,10 @@ join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags)
                }
        }
 
-       /* If channel persistent and client is ircop: make client chanop */
-       if (strchr(Channel_Modes(chan), 'P') && strchr(Client_Modes(target), 'o'))
+       /* If the channel is persistent (+P) and client is an IRC op:
+        * make client chanop, if not disabled in configuration. */
+       if (strchr(Channel_Modes(chan), 'P') && Conf_OperChanPAutoOp
+           && strchr(Client_Modes(target), 'o'))
                Channel_UserModeAdd(chan, target, 'o');
 } /* join_set_channelmodes */
 
@@ -669,7 +671,8 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
                        if (MatchCaseInsensitive(pattern, Channel_Name(chan))) {
                                /* Gotcha! */
                                if (!strchr(Channel_Modes(chan), 's')
-                                   || Channel_IsMemberOf(chan, from)) {
+                                   || Channel_IsMemberOf(chan, from)
+                                   || (!Conf_MorePrivacy && Client_OperByMe(Client))) {
                                        if (IRC_CheckListTooBig(from, count,
                                                                 MAX_RPL_LIST,
                                                                 "LIST"))