This commit is contained in:
Shivaram Lingamneni 2020-10-08 16:33:27 -04:00
parent 32f29aca52
commit c470f63daf
6 changed files with 69 additions and 18 deletions

View file

@ -411,6 +411,11 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
lastSeen = map[string]time.Time{"": now}
}
hostname := server.name
if config.Server.Cloaks.EnabledForAlwaysOn {
hostname = config.Server.Cloaks.ComputeAccountCloak(account.Name)
}
client := &Client{
lastSeen: lastSeen,
lastActive: now,
@ -419,9 +424,8 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
languages: server.Languages().Default(),
server: server,
// TODO figure out how to set these on reattach?
username: "~user",
rawHostname: server.name,
rawHostname: hostname,
realIP: utils.IPv4LoopbackAddress,
alwaysOn: true,