]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/client.c
New configuration opion "MorePrivacy" to "censor" some user information
[ngircd-alex.git] / src / ngircd / client.c
index 7a6b275da5918ea0030a12f4aa97804d980cd6ee..d038fd2481cde6bc01aca29d1669c93fdf01c1ff 100644 (file)
@@ -9,10 +9,8 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
-
 #define __client_c__
 
-
 #include "portab.h"
 
 /**
 
 #include <exp.h>
 
-
 #define GETID_LEN (CLIENT_NICK_LEN-1) + 1 + (CLIENT_USER_LEN-1) + 1 + (CLIENT_HOST_LEN-1) + 1
 
-
 static CLIENT *This_Server, *My_Clients;
 
 static WHOWAS My_Whowas[MAX_WHOWAS];
@@ -323,7 +319,11 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
        assert( Client != NULL );
        assert( Hostname != NULL );
 
-       strlcpy( Client->host, Hostname, sizeof( Client->host ));
+       if (strlen(Conf_CloakHost)) {
+               strlcpy( Client->host, Conf_CloakHost, sizeof( Client->host ));
+       } else {
+               strlcpy( Client->host, Hostname, sizeof( Client->host ));
+       }
 } /* Client_SetHostname */
 
 
@@ -335,6 +335,11 @@ Client_SetID( CLIENT *Client, const char *ID )
        
        strlcpy( Client->id, ID, sizeof( Client->id ));
 
+       if (Conf_CloakUserToNick) {
+               strlcpy( Client->user, ID, sizeof( Client->user ));
+               strlcpy( Client->info, ID, sizeof( Client->info ));
+       }
+
        /* Hash */
        Client->hash = Hash( Client->id );
 } /* Client_SetID */
@@ -348,7 +353,9 @@ Client_SetUser( CLIENT *Client, const char *User, bool Idented )
        assert( Client != NULL );
        assert( User != NULL );
 
-       if (Idented) {
+       if (Conf_CloakUserToNick) {
+               strlcpy(Client->user, Client->id, sizeof(Client->user));
+       } else if (Idented) {
                strlcpy(Client->user, User, sizeof(Client->user));
        } else {
                Client->user[0] = '~';
@@ -385,7 +392,10 @@ Client_SetInfo( CLIENT *Client, const char *Info )
        assert( Client != NULL );
        assert( Info != NULL );
 
-       strlcpy(Client->info, Info, sizeof(Client->info));
+       if (Conf_CloakUserToNick)
+               strlcpy(Client->info, Client->id, sizeof(Client->info));
+       else
+               strlcpy(Client->info, Info, sizeof(Client->info));
 } /* Client_SetInfo */