mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-24 19:24:16 +01:00
commit
24ac3b68b4
@ -820,6 +820,9 @@ limits:
|
|||||||
# identlen is the max ident length allowed
|
# identlen is the max ident length allowed
|
||||||
identlen: 20
|
identlen: 20
|
||||||
|
|
||||||
|
# realnamelen is the maximum realname length allowed
|
||||||
|
realnamelen: 150
|
||||||
|
|
||||||
# channellen is the max channel length allowed
|
# channellen is the max channel length allowed
|
||||||
channellen: 64
|
channellen: 64
|
||||||
|
|
||||||
|
@ -484,6 +484,7 @@ type Limits struct {
|
|||||||
ChanListModes int `yaml:"chan-list-modes"`
|
ChanListModes int `yaml:"chan-list-modes"`
|
||||||
ChannelLen int `yaml:"channellen"`
|
ChannelLen int `yaml:"channellen"`
|
||||||
IdentLen int `yaml:"identlen"`
|
IdentLen int `yaml:"identlen"`
|
||||||
|
RealnameLen int `yaml:"realnamelen"`
|
||||||
KickLen int `yaml:"kicklen"`
|
KickLen int `yaml:"kicklen"`
|
||||||
MonitorEntries int `yaml:"monitor-entries"`
|
MonitorEntries int `yaml:"monitor-entries"`
|
||||||
NickLen int `yaml:"nicklen"`
|
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"))
|
rb.Add(nil, server.name, ERR_NEEDMOREPARAMS, client.Nick(), "USER", client.t("Not enough parameters"))
|
||||||
return false
|
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`
|
// #843: we accept either: `USER user:pass@clientid` or `USER user@clientid`
|
||||||
if strudelIndex := strings.IndexByte(username, '@'); strudelIndex != -1 {
|
if strudelIndex := strings.IndexByte(username, '@'); strudelIndex != -1 {
|
||||||
|
@ -792,6 +792,9 @@ limits:
|
|||||||
# identlen is the max ident length allowed
|
# identlen is the max ident length allowed
|
||||||
identlen: 20
|
identlen: 20
|
||||||
|
|
||||||
|
# realnamelen is the maximum realname length allowed
|
||||||
|
realnamelen: 150
|
||||||
|
|
||||||
# channellen is the max channel length allowed
|
# channellen is the max channel length allowed
|
||||||
channellen: 64
|
channellen: 64
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user