3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +01:00

Merge pull request #1316 from slingamn/alwayson_cloak_followup

separate rawHostname and cloakedHostname for always-on clients
This commit is contained in:
Shivaram Lingamneni 2020-10-09 11:08:24 -07:00 committed by GitHub
commit 2121f17de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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{
@ -424,9 +424,10 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
languages: server.Languages().Default(),
server: server,
username: "~user",
rawHostname: hostname,
realIP: utils.IPv4LoopbackAddress,
username: "~user",
cloakedHostname: cloakedHostname,
rawHostname: rawHostname,
realIP: utils.IPv4LoopbackAddress,
alwaysOn: true,
realname: realname,