From d9b56c3e05d25520b58753e28a5bd6cfcc516383 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 19 Mar 2016 02:07:18 -0400 Subject: [PATCH] Use Client.key for channel clientMap and modeMap lookups and insertions --- client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index bdd8f74..3b734ac 100644 --- a/client.go +++ b/client.go @@ -60,7 +60,7 @@ func (c *Client) joinChannel(channelName string) { newChannel = true } - if _, inChannel := channel.clientMap[c.nick]; inChannel { + if _, inChannel := channel.clientMap[c.key]; inChannel { //Client is already in the channel, do nothing return } @@ -71,8 +71,8 @@ func (c *Client) joinChannel(channelName string) { mode.operator = true } - channel.clientMap[c.nick] = c - channel.modeMap[c.nick] = mode + channel.clientMap[c.key] = c + channel.modeMap[c.key] = mode c.channelMap[channelKey] = channel for _, client := range channel.clientMap { @@ -91,7 +91,7 @@ func (c *Client) joinChannel(channelName string) { for _, client := range channel.clientMap { prefix := "" - if mode, exists := channel.modeMap[client.nick]; exists { + if mode, exists := channel.modeMap[client.key]; exists { prefix = mode.Prefix() }