aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-10-25 22:40:13 +0100
committerGravatar Sadie Powell2021-10-25 23:02:28 +0100
commitbeaae760bd7fb0afa05bc3fd7682e085b14b2930 (patch)
tree0b24ff90cc345b6869840dd610ae47935c094cfe /include
parentRespect <security:hideserver> in the 005 numeric. (diff)
Add Server::GetPublicName(), fix not respecting <security:hideserver>.
Diffstat (limited to 'include')
-rw-r--r--include/clientprotocolmsg.h4
-rw-r--r--include/server.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/include/clientprotocolmsg.h b/include/clientprotocolmsg.h
index ad3ca65c2..987c14415 100644
--- a/include/clientprotocolmsg.h
+++ b/include/clientprotocolmsg.h
@@ -68,7 +68,7 @@ class ClientProtocol::Messages::Numeric : public ClientProtocol::Message
* @param user User to send the numeric to. May be unregistered, must remain valid as long as this object is alive.
*/
Numeric(const ::Numeric::Numeric& num, User* user)
- : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer() : ServerInstance->FakeClient->server)->GetName())
+ : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer() : ServerInstance->FakeClient->server)->GetPublicName())
{
if (user->registered & REG_NICK)
PushParamRef(user->nick);
@@ -82,7 +82,7 @@ class ClientProtocol::Messages::Numeric : public ClientProtocol::Message
* @param target Target string, must stay valid as long as this object is alive.
*/
Numeric(const ::Numeric::Numeric& num, const std::string& target)
- : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer() : ServerInstance->FakeClient->server)->GetName())
+ : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer() : ServerInstance->FakeClient->server)->GetPublicName())
{
PushParamRef(target);
InitFromNumeric(num);
diff --git a/include/server.h b/include/server.h
index 1aacdc2d9..d8c81d99b 100644
--- a/include/server.h
+++ b/include/server.h
@@ -75,6 +75,9 @@ class CoreExport Server : public classbase
*/
const std::string& GetName() const { return name; }
+ /** Returns the public name of this server respecting <security:hideserver> if set. */
+ const std::string& GetPublicName() const;
+
/** Returns the description of this server
* @return The description of this server
*/