diff --git a/irc/handlers.go b/irc/handlers.go index 52991d62..8bf96e35 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -3262,11 +3262,16 @@ func whoisHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Res handleService := func(nick string) bool { cfnick, _ := CasefoldName(nick) service, ok := OragonoServices[cfnick] + hostname := "localhost" + config := server.Config() + if config.Server.OverrideServicesHostname != "" { + hostname = config.Server.OverrideServicesHostname + } if !ok { return false } clientNick := client.Nick() - rb.Add(nil, client.server.name, RPL_WHOISUSER, clientNick, service.Name, service.Name, "localhost", "*", fmt.Sprintf(client.t("Network service, for more info /msg %s HELP"), service.Name)) + rb.Add(nil, client.server.name, RPL_WHOISUSER, clientNick, service.Name, service.Name, hostname, "*", fmt.Sprintf(client.t("Network service, for more info /msg %s HELP"), service.Name)) // #1080: rb.Add(nil, client.server.name, RPL_WHOISOPERATOR, clientNick, service.Name, client.t("is a network service")) // hehe diff --git a/irc/import.go b/irc/import.go index 033c714a..c70ec738 100644 --- a/irc/import.go +++ b/irc/import.go @@ -113,7 +113,16 @@ func doImportDBGeneric(config *Config, dbImport databaseImport, credsType Creden tx.Set(fmt.Sprintf(keyAccountCredentials, cfUsername), string(marshaledCredentials), nil) tx.Set(fmt.Sprintf(keyAccountRegTime, cfUsername), strconv.FormatInt(userInfo.RegisteredAt, 10), nil) if userInfo.Vhost != "" { - tx.Set(fmt.Sprintf(keyAccountVHost, cfUsername), userInfo.Vhost, nil) + vhinfo := VHostInfo{ + Enabled: true, + ApprovedVHost: userInfo.Vhost, + } + vhBytes, err := json.Marshal(vhinfo) + if err == nil { + tx.Set(fmt.Sprintf(keyAccountVHost, cfUsername), string(vhBytes), nil) + } else { + log.Printf("couldn't serialize vhost for %s: %v\n", username, err) + } } if len(userInfo.AdditionalNicks) != 0 { tx.Set(fmt.Sprintf(keyAccountAdditionalNicks, cfUsername), marshalReservedNicks(userInfo.AdditionalNicks), nil)