]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Rename <security:hidewhois> to <security:hideserver>.
authorPeter Powell <petpow@saberuk.com>
Fri, 15 Dec 2017 23:26:15 +0000 (23:26 +0000)
committerPeter Powell <petpow@saberuk.com>
Fri, 22 Dec 2017 01:11:14 +0000 (01:11 +0000)
The previous name was horrible and didn't describe what the setting
actually does.

docs/conf/inspircd.conf.example
include/configreader.h
src/configreader.cpp
src/coremods/core_who.cpp
src/coremods/core_whois.cpp
src/coremods/core_whowas.cpp
src/users.cpp

index 94504162463f744d285d1aada2e1866e84fa6dab..9804098630d2728e4f9aea96949db7f108e2a56d 100644 (file)
           # be flattened when shown to non-opers.
           flatlinks="no"
 
-          # hidewhois: When defined, the given text will be used in place
-          # of the server a user is on when whoised by a non-oper. Most
-          # networks will want to set this to something like "*.netname.net"
-          # to conceal the actual server a user is on.
-          # Note that enabling this will cause users' idle times to only be
-          # shown when the format /WHOIS <nick> <nick> is used.
-          hidewhois=""
+          # hideserver: When defined, the given text will be used in place
+          # of the server name in public messages. As with <server:name> this
+          # does not need to resolve but does need to be a valid hostname.
+          #
+          # NOTE: enabling this will cause users' idle times to only be shown
+          # when a remote whois (/WHOIS <nick> <nick>) is used.
+          #hideserver="*.example.com"
 
           # hidebans: If this value is set to yes, when a user is banned ([gkz]lined)
           # only opers will see the ban message when the user is removed
index db7258d4e2b8114805eea909017f75ffcc29f789..1a2335e52f8af61134d5d4820276f005430d4a2a 100644 (file)
@@ -385,9 +385,8 @@ class CoreExport ServerConfig
        /** True if raw I/O is being logged */
        bool RawLog;
 
-       /** Set to a non-empty string to obfuscate the server name of users in WHOIS
-        */
-       std::string HideWhoisServer;
+       /** Set to a non-empty string to obfuscate server names. */
+       std::string HideServer;
 
        /** Set to a non empty string to obfuscate nicknames prepended to a KILL.
         */
index ff9d5bd141dafa02a3d9cf0085b0fc00104fda21..970aaba805db37ce247bfc31c929d26754bbf4f2 100644 (file)
@@ -431,7 +431,7 @@ void ServerConfig::Fill()
        CustomVersion = security->getString("customversion");
        HideSplits = security->getBool("hidesplits");
        HideBans = security->getBool("hidebans");
-       HideWhoisServer = security->getString("hidewhois");
+       HideServer = security->getString("hideserver", security->getString("hidewhois"));
        HideKillsServer = security->getString("hidekills");
        HideULineKills = security->getBool("hideulinekills");
        RestrictBannedUsers = security->getBool("restrictbannedusers", true);
index 5a3db9f835cc13191d9ee073213b6c0614018402..29feefc2ba8c095173968ba004c99b9138b11f22 100644 (file)
@@ -166,8 +166,8 @@ bool CommandWho::whomatch(User* cuser, User* user, const char* matchtext)
                if (!match)
                        match = InspIRCd::Match(user->nick, matchtext);
 
-               /* Don't allow server name matches if HideWhoisServer is enabled, unless the command user has the priv */
-               if (!match && (ServerInstance->Config->HideWhoisServer.empty() || cuser->HasPrivPermission("users/auspex")))
+               /* Don't allow server name matches if HideServer is enabled, unless the command user has the priv */
+               if (!match && (ServerInstance->Config->HideServer.empty() || cuser->HasPrivPermission("users/auspex")))
                        match = InspIRCd::Match(user->server->GetName(), matchtext);
 
                return match;
@@ -199,8 +199,8 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms,
        Numeric::Numeric wholine(RPL_WHOREPLY);
        wholine.push(memb ? memb->chan->name : "*").push(u->ident);
        wholine.push(u->GetHost(opt_showrealhost));
-       if (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex"))
-               wholine.push(ServerInstance->Config->HideWhoisServer);
+       if (!ServerInstance->Config->HideServer.empty() && !user->HasPrivPermission("servers/auspex"))
+               wholine.push(ServerInstance->Config->HideServer);
        else
                wholine.push(u->server->GetName());
 
@@ -305,11 +305,11 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                        opt_away = true;
                                        break;
                                case 'l':
-                                       if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideWhoisServer.empty())
+                                       if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideServer.empty())
                                                opt_local = true;
                                        break;
                                case 'f':
-                                       if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideWhoisServer.empty())
+                                       if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideServer.empty())
                                                opt_far = true;
                                        break;
                                case 't':
index 19f5a862be608529767b8648b5084895700aa437..b5191dabd692b724452374bd363532c766407732 100644 (file)
@@ -201,9 +201,9 @@ void CommandWhois::DoWhois(LocalUser* user, User* dest, time_t signon, unsigned
 
        SendChanList(whois);
 
-       if (!whois.IsSelfWhois() && !ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex"))
+       if (!whois.IsSelfWhois() && !ServerInstance->Config->HideServer.empty() && !user->HasPrivPermission("servers/auspex"))
        {
-               whois.SendLine(RPL_WHOISSERVER, ServerInstance->Config->HideWhoisServer, ServerInstance->Config->Network);
+               whois.SendLine(RPL_WHOISSERVER, ServerInstance->Config->HideServer, ServerInstance->Config->Network);
        }
        else
        {
@@ -238,7 +238,7 @@ void CommandWhois::DoWhois(LocalUser* user, User* dest, time_t signon, unsigned
        FOREACH_MOD_CUSTOM(evprov, Whois::EventListener, OnWhois, (whois));
 
        /*
-        * We only send these if we've been provided them. That is, if hidewhois is turned off, and user is local, or
+        * We only send these if we've been provided them. That is, if hideserver is turned off, and user is local, or
         * if remote whois is queried, too. This is to keep the user hidden, and also since you can't reliably tell remote time. -- w00t
         */
        if ((idle) || (signon))
@@ -292,14 +292,14 @@ CmdResult CommandWhois::HandleLocal(const std::vector<std::string>& parameters,
        {
                /*
                 * Okay. Umpteenth attempt at doing this, so let's re-comment...
-                * For local users (/w localuser), we show idletime if hidewhois is disabled
+                * For local users (/w localuser), we show idletime if hideserver is disabled
                 * For local users (/w localuser localuser), we always show idletime, hence parameters.size() > 1 check.
                 * For remote users (/w remoteuser), we do NOT show idletime
                 * For remote users (/w remoteuser remoteuser), spanningtree will handle calling do_whois, so we can ignore this case.
                 * Thanks to djGrrr for not being impatient while I have a crap day coding. :p -- w00t
                 */
                LocalUser* localuser = IS_LOCAL(dest);
-               if (localuser && (ServerInstance->Config->HideWhoisServer.empty() || parameters.size() > 1))
+               if (localuser && (ServerInstance->Config->HideServer.empty() || parameters.size() > 1))
                {
                        idle = labs((long)((localuser->idle_lastmsg)-ServerInstance->Time()));
                        signon = dest->signon;
index 1f72fe2d2afb22fd8be9b798675114bdb816e218..f456a57db68dd8a877173166c900f7e63b57aea8 100644 (file)
@@ -67,8 +67,8 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use
                                user->WriteNumeric(RPL_WHOWASIP, parameters[0], InspIRCd::Format("was connecting from *@%s", u->host.c_str()));
 
                        std::string signon = InspIRCd::TimeString(u->signon);
-                       bool hide_server = (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex"));
-                       user->WriteNumeric(RPL_WHOISSERVER, parameters[0], (hide_server ? ServerInstance->Config->HideWhoisServer : u->server), signon);
+                       bool hide_server = (!ServerInstance->Config->HideServer.empty() && !user->HasPrivPermission("servers/auspex"));
+                       user->WriteNumeric(RPL_WHOISSERVER, parameters[0], (hide_server ? ServerInstance->Config->HideServer : u->server), signon);
                }
        }
 
index ead862b7d7fbad402a1995203e4d7c57a18b67a6..b3546a134c9890f6380b71e10d634a301f46e05a 100644 (file)
@@ -1163,15 +1163,15 @@ void User::PurgeEmptyChannels()
 
 const std::string& FakeUser::GetFullHost()
 {
-       if (!ServerInstance->Config->HideWhoisServer.empty())
-               return ServerInstance->Config->HideWhoisServer;
+       if (!ServerInstance->Config->HideServer.empty())
+               return ServerInstance->Config->HideServer;
        return server->GetName();
 }
 
 const std::string& FakeUser::GetFullRealHost()
 {
-       if (!ServerInstance->Config->HideWhoisServer.empty())
-               return ServerInstance->Config->HideWhoisServer;
+       if (!ServerInstance->Config->HideServer.empty())
+               return ServerInstance->Config->HideServer;
        return server->GetName();
 }