Browse Source

Fix sending to channels with keys

tags/v0.1.2
Russ Garrett 7 years ago
parent
commit
99c2f56a6c
No account linked to committer's email address
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      tcplistener/tcplistener.go

+ 4
- 2
tcplistener/tcplistener.go View File

67
 		parts := strings.SplitN(msg, " ", 2)
67
 		parts := strings.SplitN(msg, " ", 2)
68
 		if parts[0] == "#*" {
68
 		if parts[0] == "#*" {
69
 			for _, channel := range channels {
69
 			for _, channel := range channels {
70
-				l.irc.Privmsg(channel, replaceFormatting(parts[1]))
70
+				chan_parts := strings.Split(channel, " ")
71
+				l.irc.Privmsg(chan_parts[0], replaceFormatting(parts[1]))
71
 			}
72
 			}
72
 		} else {
73
 		} else {
73
 			targets := strings.Split(parts[0], ",")
74
 			targets := strings.Split(parts[0], ",")
83
 		l.irc.SendRawf("TOPIC %s :%s", parts[1], replaceFormatting(parts[2]))
84
 		l.irc.SendRawf("TOPIC %s :%s", parts[1], replaceFormatting(parts[2]))
84
 	} else {
85
 	} else {
85
 		if len(channels) > 0 {
86
 		if len(channels) > 0 {
86
-			l.irc.Privmsg(channels[0], replaceFormatting(msg))
87
+			chan_parts := strings.Split(channels[0], " ")
88
+			l.irc.Privmsg(chan_parts[0], replaceFormatting(msg))
87
 		}
89
 		}
88
 	}
90
 	}
89
 }
91
 }

Loading…
Cancel
Save