forked from External/ergo
Merge pull request #352 from slingamn/chanreglimit.1
track channel registrations per account
This commit is contained in:
commit
7cf8aaccf6
10 changed files with 154 additions and 14 deletions
|
|
@ -1159,7 +1159,13 @@ func joinHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
|||
keys = strings.Split(msg.Params[1], ",")
|
||||
}
|
||||
|
||||
config := server.Config()
|
||||
oper := client.Oper()
|
||||
for i, name := range channels {
|
||||
if config.Channels.MaxChannelsPerClient <= client.NumChannels() && oper == nil {
|
||||
rb.Add(nil, server.name, ERR_TOOMANYCHANNELS, client.Nick(), name, client.t("You have joined too many channels"))
|
||||
return false
|
||||
}
|
||||
var key string
|
||||
if len(keys) > i {
|
||||
key = keys[i]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue