separate rawHostname and cloakedHostname for always-on clients

This affects RPL_WHOISACTUALLY and possibly others.
This commit is contained in:
Shivaram Lingamneni 2020-10-09 11:11:06 -04:00
parent f5374c014b
commit 8cd7085d0b
1 changed files with 6 additions and 5 deletions

View File

@ -411,9 +411,9 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
lastSeen = map[string]time.Time{"": now}
}
hostname := server.name
rawHostname, cloakedHostname := server.name, ""
if config.Server.Cloaks.EnabledForAlwaysOn {
hostname = config.Server.Cloaks.ComputeAccountCloak(account.Name)
cloakedHostname = config.Server.Cloaks.ComputeAccountCloak(account.Name)
}
client := &Client{
@ -425,7 +425,8 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
server: server,
username: "~user",
rawHostname: hostname,
cloakedHostname: cloakedHostname,
rawHostname: rawHostname,
realIP: utils.IPv4LoopbackAddress,
alwaysOn: true,