mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-15 00:19:29 +01:00
parent
d97e964b35
commit
921651f664
@ -820,6 +820,9 @@ limits:
|
||||
# identlen is the max ident length allowed
|
||||
identlen: 20
|
||||
|
||||
# realnamelen is the maximum realname length allowed
|
||||
realnamelen: 150
|
||||
|
||||
# channellen is the max channel length allowed
|
||||
channellen: 64
|
||||
|
||||
|
@ -484,6 +484,7 @@ type Limits struct {
|
||||
ChanListModes int `yaml:"chan-list-modes"`
|
||||
ChannelLen int `yaml:"channellen"`
|
||||
IdentLen int `yaml:"identlen"`
|
||||
RealnameLen int `yaml:"realnamelen"`
|
||||
KickLen int `yaml:"kicklen"`
|
||||
MonitorEntries int `yaml:"monitor-entries"`
|
||||
NickLen int `yaml:"nicklen"`
|
||||
|
@ -3334,6 +3334,10 @@ func userHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons
|
||||
rb.Add(nil, server.name, ERR_NEEDMOREPARAMS, client.Nick(), "USER", client.t("Not enough parameters"))
|
||||
return false
|
||||
}
|
||||
config := server.Config()
|
||||
if config.Limits.RealnameLen > 0 && len(realname) > config.Limits.RealnameLen {
|
||||
realname = ircmsg.TruncateUTF8Safe(realname, config.Limits.RealnameLen)
|
||||
}
|
||||
|
||||
// #843: we accept either: `USER user:pass@clientid` or `USER user@clientid`
|
||||
if strudelIndex := strings.IndexByte(username, '@'); strudelIndex != -1 {
|
||||
|
@ -792,6 +792,9 @@ limits:
|
||||
# identlen is the max ident length allowed
|
||||
identlen: 20
|
||||
|
||||
# realnamelen is the maximum realname length allowed
|
||||
realnamelen: 150
|
||||
|
||||
# channellen is the max channel length allowed
|
||||
channellen: 64
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user