1
0
Fork 0
forked from External/ergo

Merge pull request #583 from slingamn/stats.4

fix #526
This commit is contained in:
Daniel Oaks 2019-07-12 23:39:50 +10:00 committed by GitHub
commit dc87ae7ef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 109 additions and 67 deletions

View file

@ -1638,14 +1638,7 @@ func listHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
// LUSERS [<mask> [<server>]]
func lusersHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
//TODO(vegax87) Fix network statistics and additional parameters
totalCount, invisibleCount, operCount := server.stats.GetStats()
rb.Add(nil, server.name, RPL_LUSERCLIENT, client.nick, fmt.Sprintf(client.t("There are %[1]d users and %[2]d invisible on %[3]d server(s)"), totalCount-invisibleCount, invisibleCount, 1))
rb.Add(nil, server.name, RPL_LUSEROP, client.nick, strconv.Itoa(operCount), client.t("IRC Operators online"))
rb.Add(nil, server.name, RPL_LUSERCHANNELS, client.nick, strconv.Itoa(server.channels.Len()), client.t("channels formed"))
rb.Add(nil, server.name, RPL_LUSERME, client.nick, fmt.Sprintf(client.t("I have %[1]d clients and %[2]d servers"), totalCount, 1))
server.Lusers(client, rb)
return false
}
@ -2583,7 +2576,7 @@ func userhostHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *
// VERSION
func versionHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
rb.Add(nil, server.name, RPL_VERSION, client.nick, Ver, server.name)
client.RplISupport(rb)
server.RplISupport(client, rb)
return false
}