1
0
Fork 0
forked from External/ergo

Merge pull request #247 from slingamn/vhosts.3

initial vhosts implementation, #183
This commit is contained in:
Daniel Oaks 2018-05-19 08:51:16 +10:00 committed by GitHub
commit de7b679fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1069 additions and 375 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
@ -659,8 +659,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.HasMode(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"))
@ -863,6 +864,12 @@ func (server *Server) applyConfig(config *Config, initial bool) error {
server.accounts.buildNickToAccountIndex()
}
hsPreviouslyDisabled := oldAccountConfig != nil && !oldAccountConfig.VHosts.Enabled
hsNowEnabled := config.Accounts.VHosts.Enabled
if hsPreviouslyDisabled && hsNowEnabled {
server.accounts.initVHostRequestQueue()
}
// STS
stsValue := config.Server.STS.Value()
var stsDisabled bool
@ -944,7 +951,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