Skip to content

Commit

Permalink
Fix sending to channels with keys
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Jan 14, 2017
1 parent 10c91f3 commit 99c2f56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tcplistener/tcplistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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], ",")
Expand All @@ -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))
}
}
}

0 comments on commit 99c2f56

Please sign in to comment.