mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-26 13:59:44 +01:00
commit
a06b4d5e88
@ -491,6 +491,10 @@ channels:
|
|||||||
# how many channels can each account register?
|
# how many channels can each account register?
|
||||||
max-channels-per-account: 15
|
max-channels-per-account: 15
|
||||||
|
|
||||||
|
# as a crude countermeasure against spambots, anonymous connections younger
|
||||||
|
# than this value will get an empty response to /LIST (a time period of 0 disables)
|
||||||
|
list-delay: 0s
|
||||||
|
|
||||||
# operator classes
|
# operator classes
|
||||||
oper-classes:
|
oper-classes:
|
||||||
# local operator
|
# local operator
|
||||||
|
@ -550,6 +550,7 @@ type Config struct {
|
|||||||
OperatorOnly bool `yaml:"operator-only"`
|
OperatorOnly bool `yaml:"operator-only"`
|
||||||
MaxChannelsPerAccount int `yaml:"max-channels-per-account"`
|
MaxChannelsPerAccount int `yaml:"max-channels-per-account"`
|
||||||
}
|
}
|
||||||
|
ListDelay time.Duration `yaml:"list-delay"`
|
||||||
}
|
}
|
||||||
|
|
||||||
OperClasses map[string]*OperClassConfig `yaml:"oper-classes"`
|
OperClasses map[string]*OperClassConfig `yaml:"oper-classes"`
|
||||||
|
@ -1408,6 +1408,14 @@ func languageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *
|
|||||||
|
|
||||||
// LIST [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]
|
// LIST [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]
|
||||||
func listHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
func listHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
||||||
|
config := server.Config()
|
||||||
|
if time.Since(client.ctime) < config.Channels.ListDelay && client.Account() == "" && !client.HasMode(modes.Operator) {
|
||||||
|
remaining := time.Until(client.ctime.Add(config.Channels.ListDelay))
|
||||||
|
csNotice(rb, fmt.Sprintf(client.t("This server requires that you wait %v after connecting before you can use /LIST. You have %v left."), config.Channels.ListDelay, remaining))
|
||||||
|
rb.Add(nil, server.name, RPL_LISTEND, client.Nick(), client.t("End of LIST"))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// get channels
|
// get channels
|
||||||
var channels []string
|
var channels []string
|
||||||
for _, param := range msg.Params {
|
for _, param := range msg.Params {
|
||||||
|
@ -512,6 +512,10 @@ channels:
|
|||||||
# how many channels can each account register?
|
# how many channels can each account register?
|
||||||
max-channels-per-account: 15
|
max-channels-per-account: 15
|
||||||
|
|
||||||
|
# as a crude countermeasure against spambots, anonymous connections younger
|
||||||
|
# than this value will get an empty response to /LIST (a time period of 0 disables)
|
||||||
|
list-delay: 0s
|
||||||
|
|
||||||
# operator classes
|
# operator classes
|
||||||
oper-classes:
|
oper-classes:
|
||||||
# local operator
|
# local operator
|
||||||
|
Loading…
Reference in New Issue
Block a user