From 425a521d27d176c7f81d443c16d9a1a01e8fbb71 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 16 Oct 2016 21:28:59 +1000 Subject: [PATCH] channel: Fix MODE and WHO --- irc/client.go | 2 +- irc/modes.go | 2 +- irc/server.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/irc/client.go b/irc/client.go index 6e4469ae..dfea9e3f 100644 --- a/irc/client.go +++ b/irc/client.go @@ -42,7 +42,7 @@ type Client struct { isDestroyed bool isQuitting bool hasQuit bool - hops uint + hops int hostname string idleTimer *time.Timer monitoring map[string]bool diff --git a/irc/modes.go b/irc/modes.go index 012fae0c..431c238c 100644 --- a/irc/modes.go +++ b/irc/modes.go @@ -209,7 +209,7 @@ var ( func modeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { _, errChan := CasefoldChannel(msg.Params[0]) - if errChan != nil { + if errChan == nil { return cmodeHandler(server, client, msg) } else { return umodeHandler(server, client, msg) diff --git a/irc/server.go b/irc/server.go index d3044590..85c483d7 100644 --- a/irc/server.go +++ b/irc/server.go @@ -699,7 +699,7 @@ func (target *Client) RplWhoReply(channel *Channel, client *Client) { flags += channel.members[client].Prefixes(target.capabilities[MultiPrefix]) channelName = channel.name } - target.Send(nil, target.server.name, RPL_WHOREPLY, target.nick, channelName, client.username, client.hostname, client.server.name, client.nick, flags, string(client.hops), client.realname) + target.Send(nil, target.server.name, RPL_WHOREPLY, target.nick, channelName, client.username, client.hostname, client.server.name, client.nick, flags, strconv.Itoa(client.hops)+" "+client.realname) } func whoChannel(client *Client, channel *Channel, friends ClientSet) {