1
0
Fork 0
forked from External/ergo

initial vhosts implementation, #183

This commit is contained in:
Shivaram Lingamneni 2018-04-19 02:48:19 -04:00
parent 40d6cd02da
commit 5e62cc4ebc
15 changed files with 1013 additions and 365 deletions

View file

@ -115,8 +115,8 @@ type Server struct {
name string
nameCasefolded string
networkName string
operators map[string]Oper
operclasses map[string]OperClass
operators map[string]*Oper
operclasses map[string]*OperClass
password []byte
passwords *passwd.SaltedManager
recoverFromErrors bool
@ -653,8 +653,9 @@ func (client *Client) getWhoisOf(target *Client, rb *ResponseBuffer) {
if whoischannels != nil {
rb.Add(nil, client.server.name, RPL_WHOISCHANNELS, client.nick, target.nick, strings.Join(whoischannels, " "))
}
if target.class != nil {
rb.Add(nil, client.server.name, RPL_WHOISOPERATOR, client.nick, target.nick, target.whoisLine)
tOper := target.Oper()
if tOper != nil {
rb.Add(nil, client.server.name, RPL_WHOISOPERATOR, client.nick, target.nick, tOper.WhoisLine)
}
if client.flags[modes.Operator] || client == target {
rb.Add(nil, client.server.name, RPL_WHOISACTUALLY, client.nick, target.nick, fmt.Sprintf("%s@%s", target.username, utils.LookupHostname(target.IPString())), target.IPString(), client.t("Actual user@host, Actual IP"))
@ -857,6 +858,12 @@ func (server *Server) applyConfig(config *Config, initial bool) error {
server.accounts.buildNickToAccountIndex()
}
hsPreviouslyDisabled := oldAccountConfig != nil && !oldAccountConfig.HostServ.Enabled
hsNowEnabled := config.Accounts.HostServ.Enabled
if hsPreviouslyDisabled && hsNowEnabled {
server.accounts.initVHostRequestQueue()
}
// STS
stsValue := config.Server.STS.Value()
var stsDisabled bool
@ -938,7 +945,7 @@ func (server *Server) applyConfig(config *Config, initial bool) error {
ChanListModes: int(config.Limits.ChanListModes),
LineLen: lineLenConfig,
}
server.operclasses = *operclasses
server.operclasses = operclasses
server.operators = opers
server.checkIdent = config.Server.CheckIdent