summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands.cpp9
-rw-r--r--src/inspircd_io.cpp3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 4d09db9fe..4b376bbde 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -133,7 +133,14 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i
WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, cl.c_str());
}
}
- WriteServ(user->fd,"312 %s %s %s :%s",user->nick, dest->nick, dest->server, GetServerDescription(dest->server).c_str());
+ if (*Config->HideWhoisServer)
+ {
+ WriteServ(user->fd,"312 %s %s %s :%s",user->nick, dest->nick, *user->oper ? dest->server : Config->HideWhoisServer, *user->oper ? GetServerDescription(dest->server).c_str() : Config->Network);
+ }
+ else
+ {
+ WriteServ(user->fd,"312 %s %s %s :%s",user->nick, dest->nick, dest->server, GetServerDescription(dest->server).c_str());
+ }
if (*dest->awaymsg)
{
WriteServ(user->fd,"301 %s %s :%s",user->nick, dest->nick, dest->awaymsg);
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 88cb1438f..66fa0908e 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -45,7 +45,7 @@ ServerConfig::ServerConfig()
{
this->ClearStack();
*ServerName = *Network = *ServerDesc = *AdminName = '\0';
- *AdminEmail = *AdminNick = *diepass = *restartpass = '\0';
+ *HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = '\0';
*CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
*OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
log_file = NULL;
@@ -227,6 +227,7 @@ void ServerConfig::Read(bool bail, userrec* user)
ConfValue("options","customversion",0,Config->CustomVersion,&Config->config_f);
ConfValue("options","maxtargets",0,MT,&Config->config_f);
ConfValue("options","hidesplits",0,HS,&Config->config_f);
+ ConfValue("options","hidewhois",0,Config->HideWhoisServer,&Config->config_f);
Config->HideSplits = ((*HS == 'y') || (*HS == 'Y') || (*HS == '1') || (*HS == 't') || (*HS == 'T'));
Config->SoftLimit = atoi(SLIMT);