3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

Fixed WHOIS Command

This commit is contained in:
vegax87 2017-01-13 02:05:58 +01:00
parent 36525bdcd3
commit a54dcb9057

View File

@ -952,9 +952,10 @@ func whoisHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
func (client *Client) getWhoisOf(target *Client) {
client.Send(nil, client.server.name, RPL_WHOISUSER, client.nick, target.nick, target.username, target.hostname, "*", target.realname)
//TODO(dan): ...one channel per reply? really?
for _, line := range client.WhoisChannelsNames(target) {
client.Send(nil, client.server.name, RPL_WHOISCHANNELS, client.nick, target.nick, line)
whoischannels := client.WhoisChannelsNames(target)
if whoischannels != nil {
client.Send(nil, client.server.name, RPL_WHOISCHANNELS, client.nick, target.nick, fmt.Sprintf(": %s", strings.Join(whoischannels, " ")))
}
if target.class != nil {
client.Send(nil, client.server.name, RPL_WHOISOPERATOR, client.nick, target.nick, target.whoisLine)