|
@@ -419,12 +419,18 @@ func (server *Server) RplISupport(client *Client, rb *ResponseBuffer) {
|
419
|
419
|
|
420
|
420
|
func (server *Server) Lusers(client *Client, rb *ResponseBuffer) {
|
421
|
421
|
nick := client.Nick()
|
422
|
|
- stats := server.stats.GetValues()
|
|
422
|
+ config := server.Config()
|
|
423
|
+ var stats StatsValues
|
|
424
|
+ var numChannels int
|
|
425
|
+ if !config.Server.SuppressLusers || client.HasRoleCapabs("ban") {
|
|
426
|
+ stats = server.stats.GetValues()
|
|
427
|
+ numChannels = server.channels.Len()
|
|
428
|
+ }
|
423
|
429
|
|
424
|
430
|
rb.Add(nil, server.name, RPL_LUSERCLIENT, nick, fmt.Sprintf(client.t("There are %[1]d users and %[2]d invisible on %[3]d server(s)"), stats.Total-stats.Invisible, stats.Invisible, 1))
|
425
|
431
|
rb.Add(nil, server.name, RPL_LUSEROP, nick, strconv.Itoa(stats.Operators), client.t("IRC Operators online"))
|
426
|
432
|
rb.Add(nil, server.name, RPL_LUSERUNKNOWN, nick, strconv.Itoa(stats.Unknown), client.t("unregistered connections"))
|
427
|
|
- rb.Add(nil, server.name, RPL_LUSERCHANNELS, nick, strconv.Itoa(server.channels.Len()), client.t("channels formed"))
|
|
433
|
+ rb.Add(nil, server.name, RPL_LUSERCHANNELS, nick, strconv.Itoa(numChannels), client.t("channels formed"))
|
428
|
434
|
rb.Add(nil, server.name, RPL_LUSERME, nick, fmt.Sprintf(client.t("I have %[1]d clients and %[2]d servers"), stats.Total, 0))
|
429
|
435
|
total := strconv.Itoa(stats.Total)
|
430
|
436
|
max := strconv.Itoa(stats.Max)
|