about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/ngircd/client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 92262b5d..2f8d771c 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -702,9 +702,16 @@ Client_HostnameCloaked(CLIENT *Client)
 
 	assert(Client != NULL);
 
+	/* Client isn't cloaked at all, return real hostname: */
 	if (!Client_HasMode(Client, 'x'))
 		return Client_Hostname(Client);
 
+	/* Client has received METADATA command, so it got the eventually
+	 * cloaked hostname set correctly and this server doesn't need
+	 * to cloak it on its own: */
+	if (strchr(Client_Flags(Client), 'M'))
+		return Client_Hostname(Client);
+
 	/* Do simple mapping to the server ID? */
 	if (!*Conf_CloakHostModeX)
 		return Client_ID(Client->introducer);