whois: better output format

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
. 2016-08-27 15:27:50 +12:00
parent 3cffacaa45
commit 0ec1c20d7e

View File

@ -675,7 +675,7 @@ func (s *Server) handleJoinedCommand(command string, args []string) {
s.upstream.Users(func(u *map[string]libnmdc.UserInfo) error {
for nick, nickinfo := range *u {
if nick == targetnick {
s.reply(rplWhoisUser, nick, nickinfo.Description+" <"+nickinfo.ClientVersion+">")
s.reply(rplWhoisUser, nick, nickinfo.Description+" <"+nickinfo.ClientTag+" V:"+nickinfo.ClientVersion+">")
if nickinfo.IsOperator {
s.reply(rplWhoisOperator, nick)
}
@ -845,7 +845,7 @@ func (s *Server) reply(code replyCode, args ...string) {
s.writeClient(fmt.Sprintf(":%s PONG %s %s", s.name, s.clientNick(), args[0]))
case rplWhoisUser:
s.writeClient(fmt.Sprintf(":%s 311 %s %s %s * :%s", s.name, args[0], args[0], args[0], args[1])) // caller should supply nick,description
s.writeClient(fmt.Sprintf(":%s 311 %s %s %s %s * :%s", s.name, args[0], args[0], args[0], s.name, args[1])) // caller should supply nick,description
case rplWhoisOperator:
s.writeClient(fmt.Sprintf(":%s 313 %s :is an IRC operator", s.name, args[0]))
case rplEndOfWhois: