From 8ceea92416dd430fef3140cf8a2fd6ca832cf834 Mon Sep 17 00:00:00 2001 From: blackbeard420 Date: Thu, 3 Sep 2020 20:15:08 -0400 Subject: [PATCH] lower case channel names in user list map for issue #1 --- irc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irc.go b/irc.go index dad801a..e57a502 100644 --- a/irc.go +++ b/irc.go @@ -161,6 +161,7 @@ func (c *Connection) updateNicks(channel string, names []string) { } func (c *Connection) addNick(channel string, nick string) { + channel = strings.ToLower(channel) if !hasNick(nick, c.userList[channel]) { if hasOpSymbol(nick) { nick = nick[1:] @@ -171,6 +172,7 @@ func (c *Connection) addNick(channel string, nick string) { } func (c *Connection) removeNick(channel string, nick string) { + channel = strings.ToLower(channel) nicks := []string{} for _, i := range c.userList[channel] { @@ -212,7 +214,7 @@ func (c *Connection) parseMessage(line string) { if cmd == "353" { idx := strings.Index(args, "=") + 2 s := strings.Split(args[idx:], ":") - target := strings.TrimSpace(strings.ToLower(s[0])) + target := strings.TrimSpace(s[0]) c.updateNicks(target, strings.Split(s[1], " ")) }