mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 03:02:48 +01:00
commit
d4dd161c45
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user