]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/channel.c
New configuration opion "MorePrivacy" to "censor" some user information
[ngircd.git] / src / ngircd / channel.c
index 306f4deec0d1db5def2139a80730dcd482d3fcc5..a36131c0031f3c99e3bf2cd0ad359f622d932c4d 100644 (file)
@@ -9,10 +9,8 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
-
 #define __channel_c__
 
-
 #include "portab.h"
 
 /**
@@ -265,6 +263,9 @@ Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Rea
                return false;
        }
 
+       if (Conf_MorePrivacy)
+               Reason = "";
+
        /* Part client from channel */
        if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
                return false;
@@ -333,6 +334,9 @@ Channel_Quit( CLIENT *Client, const char *Reason )
        assert( Client != NULL );
        assert( Reason != NULL );
 
+       if (Conf_MorePrivacy)
+               Reason = "";
+
        IRC_WriteStrRelatedPrefix( Client, Client, false, "QUIT :%s", Reason );
 
        c = My_Channels;
@@ -963,6 +967,9 @@ Remove_Client( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const ch
                                Client_Mask( Client ), c->name, Client_ID(Origin), Reason);
                        break;
                default: /* PART */
+                       if (Conf_MorePrivacy)
+                               Reason = "";
+
                        if (InformServer)
                                IRC_WriteStrServersPrefix(Origin, Client, "PART %s :%s", c->name, Reason);
 
@@ -1084,10 +1091,10 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key)
 
        if (!strchr(Chan->modes, 'k'))
                return true;
-       if (strcmp(Chan->key, Key) == 0)
-               return true;
        if (*Key == '\0')
                return false;
+       if (strcmp(Chan->key, Key) == 0)
+               return true;
 
        file_name = array_start(&Chan->keyfile);
        if (!file_name)