]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
ClientUserNick setting
[ngircd-alex.git] / src / ngircd / conf.c
index c2dde4b79e3a6f6747cdbef3ce60a999571636c8..487c1eb50bc1397bc8482abbc69275df676610f0 100644 (file)
@@ -9,7 +9,6 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
-
 #include "portab.h"
 
 /**
@@ -296,6 +295,8 @@ Conf_Test( void )
 
        puts( "[GLOBAL]" );
        printf("  Name = %s\n", Conf_ServerName);
+       printf("  ClientHost = %s\n", Conf_ClientHost);
+       printf("  ClientUserNick = %s\n", yesno_to_str(Conf_ClientUserNick));
        printf("  Info = %s\n", Conf_ServerInfo);
 #ifndef PAM
        printf("  Password = %s\n", Conf_ServerPwd);
@@ -591,6 +592,8 @@ Set_Defaults(bool InitServers)
        int i;
 
        strcpy(Conf_ServerName, "");
+       strcpy(Conf_ClientHost, "");
+       Conf_ClientUserNick = false;
        snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s",
                 PACKAGE_NAME, PACKAGE_VERSION);
        strcpy(Conf_ServerPwd, "");
@@ -971,6 +974,18 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
                        Config_Error_TooLong( Line, Var );
                return;
        }
+       if( strcasecmp( Var, "ClientHost" ) == 0 ) {
+               /* Client hostname */
+               len = strlcpy( Conf_ClientHost, Arg, sizeof( Conf_ClientHost ));
+               if (len >= sizeof( Conf_ClientHost ))
+                       Config_Error_TooLong( Line, Var );
+               return;
+       }
+       if( strcasecmp( Var, "ClientUserNick" ) == 0 ) {
+               /* Use client nick name as user name */
+               Conf_ClientUserNick = Check_ArgIsTrue( Arg );
+               return;
+       }
        if( strcasecmp( Var, "Info" ) == 0 ) {
                /* Info text of server */
                len = strlcpy( Conf_ServerInfo, Arg, sizeof( Conf_ServerInfo ));