| 551 | } |
| 552 | |
| 553 | func (server *Server) Lusers(client *Client, rb *ResponseBuffer) { |
| 554 | nick := client.Nick() |
| 555 | config := server.Config() |
| 556 | var stats StatsValues |
| 557 | var numChannels int |
| 558 | if !config.Server.SuppressLusers || client.HasRoleCapabs("ban") { |
| 559 | stats = server.stats.GetValues() |
| 560 | numChannels = server.channels.Len() |
| 561 | } |
| 562 | |
| 563 | 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)) |
| 564 | rb.Add(nil, server.name, RPL_LUSEROP, nick, strconv.Itoa(stats.Operators), client.t("IRC Operators online")) |
| 565 | rb.Add(nil, server.name, RPL_LUSERUNKNOWN, nick, strconv.Itoa(stats.Unknown), client.t("unregistered connections")) |
| 566 | rb.Add(nil, server.name, RPL_LUSERCHANNELS, nick, strconv.Itoa(numChannels), client.t("channels formed")) |
| 567 | rb.Add(nil, server.name, RPL_LUSERME, nick, fmt.Sprintf(client.t("I have %[1]d clients and %[2]d servers"), stats.Total, 0)) |
| 568 | total := strconv.Itoa(stats.Total) |
| 569 | max := strconv.Itoa(stats.Max) |
| 570 | rb.Add(nil, server.name, RPL_LOCALUSERS, nick, total, max, fmt.Sprintf(client.t("Current local users %[1]s, max %[2]s"), total, max)) |
| 571 | rb.Add(nil, server.name, RPL_GLOBALUSERS, nick, total, max, fmt.Sprintf(client.t("Current global users %[1]s, max %[2]s"), total, max)) |
| 572 | } |
| 573 | |
| 574 | // MOTD serves the Message of the Day. |
| 575 | func (server *Server) MOTD(client *Client, rb *ResponseBuffer) { |