mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 03:02:48 +01:00
commit
adeaa5440b
@ -127,6 +127,10 @@ server:
|
|||||||
# use ident protocol to get usernames
|
# use ident protocol to get usernames
|
||||||
check-ident: true
|
check-ident: true
|
||||||
|
|
||||||
|
# ignore the supplied user/ident string from the USER command; always set the value to
|
||||||
|
# `~user` (literally) instead. this can potentially reduce confusion and simplify bans.
|
||||||
|
suppress-ident: false
|
||||||
|
|
||||||
# password to login to the server
|
# password to login to the server
|
||||||
# generated using "oragono genpasswd"
|
# generated using "oragono genpasswd"
|
||||||
#password: ""
|
#password: ""
|
||||||
|
@ -154,6 +154,10 @@ server:
|
|||||||
# use ident protocol to get usernames
|
# use ident protocol to get usernames
|
||||||
check-ident: false
|
check-ident: false
|
||||||
|
|
||||||
|
# ignore the supplied user/ident string from the USER command; always set the value to
|
||||||
|
# `~user` (literally) instead. this can potentially reduce confusion and simplify bans.
|
||||||
|
suppress-ident: false
|
||||||
|
|
||||||
# password to login to the server
|
# password to login to the server
|
||||||
# generated using "oragono genpasswd"
|
# generated using "oragono genpasswd"
|
||||||
#password: ""
|
#password: ""
|
||||||
|
@ -1083,7 +1083,8 @@ func (client *Client) IdleSeconds() uint64 {
|
|||||||
|
|
||||||
// SetNames sets the client's ident and realname.
|
// SetNames sets the client's ident and realname.
|
||||||
func (client *Client) SetNames(username, realname string, fromIdent bool) error {
|
func (client *Client) SetNames(username, realname string, fromIdent bool) error {
|
||||||
limit := client.server.Config().Limits.IdentLen
|
config := client.server.Config()
|
||||||
|
limit := config.Limits.IdentLen
|
||||||
if !fromIdent {
|
if !fromIdent {
|
||||||
limit -= 1 // leave room for the prepended ~
|
limit -= 1 // leave room for the prepended ~
|
||||||
}
|
}
|
||||||
@ -1095,7 +1096,9 @@ func (client *Client) SetNames(username, realname string, fromIdent bool) error
|
|||||||
return errInvalidUsername
|
return errInvalidUsername
|
||||||
}
|
}
|
||||||
|
|
||||||
if !fromIdent {
|
if config.Server.SuppressIdent {
|
||||||
|
username = "~user"
|
||||||
|
} else if !fromIdent {
|
||||||
username = "~" + username
|
username = "~" + username
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,6 +498,7 @@ type Config struct {
|
|||||||
lookupHostnames bool
|
lookupHostnames bool
|
||||||
ForwardConfirmHostnames bool `yaml:"forward-confirm-hostnames"`
|
ForwardConfirmHostnames bool `yaml:"forward-confirm-hostnames"`
|
||||||
CheckIdent bool `yaml:"check-ident"`
|
CheckIdent bool `yaml:"check-ident"`
|
||||||
|
SuppressIdent bool `yaml:"suppress-ident"`
|
||||||
MOTD string
|
MOTD string
|
||||||
motdLines []string
|
motdLines []string
|
||||||
MOTDFormatting bool `yaml:"motd-formatting"`
|
MOTDFormatting bool `yaml:"motd-formatting"`
|
||||||
@ -896,6 +897,10 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.Server.CheckIdent && config.Server.SuppressIdent {
|
||||||
|
return nil, errors.New("Can't configure both check-ident and suppress-ident")
|
||||||
|
}
|
||||||
|
|
||||||
config.Server.supportedCaps = caps.NewCompleteSet()
|
config.Server.supportedCaps = caps.NewCompleteSet()
|
||||||
config.Server.capValues = make(caps.Values)
|
config.Server.capValues = make(caps.Values)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user