From 99c2f56a6cd6f745ce03ea990671b8a3e69075f0 Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Sat, 14 Jan 2017 17:42:36 +0000 Subject: [PATCH] Fix sending to channels with keys --- tcplistener/tcplistener.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tcplistener/tcplistener.go b/tcplistener/tcplistener.go index ed033c1..4b688a6 100644 --- a/tcplistener/tcplistener.go +++ b/tcplistener/tcplistener.go @@ -67,7 +67,8 @@ func (l *TCPListener) parseMessage(msg string) { parts := strings.SplitN(msg, " ", 2) if parts[0] == "#*" { for _, channel := range channels { - l.irc.Privmsg(channel, replaceFormatting(parts[1])) + chan_parts := strings.Split(channel, " ") + l.irc.Privmsg(chan_parts[0], replaceFormatting(parts[1])) } } else { targets := strings.Split(parts[0], ",") @@ -83,7 +84,8 @@ func (l *TCPListener) parseMessage(msg string) { l.irc.SendRawf("TOPIC %s :%s", parts[1], replaceFormatting(parts[2])) } else { if len(channels) > 0 { - l.irc.Privmsg(channels[0], replaceFormatting(msg)) + chan_parts := strings.Split(channels[0], " ") + l.irc.Privmsg(chan_parts[0], replaceFormatting(msg)) } } }