MCPcopy
hub / github.com/ergochat/ergo / Lusers

Method Lusers

irc/server.go:553–572  ·  view source on GitHub ↗
(client *Client, rb *ResponseBuffer)

Source from the content-addressed store, hash-verified

551}
552
553func (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.
575func (server *Server) MOTD(client *Client, rb *ResponseBuffer) {

Callers 2

playRegistrationBurstMethod · 0.95
lusersHandlerFunction · 0.80

Calls 7

ConfigMethod · 0.95
NickMethod · 0.80
HasRoleCapabsMethod · 0.80
GetValuesMethod · 0.80
tMethod · 0.80
LenMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected