only send if we have a resp
This commit is contained in:
parent
55a587e952
commit
a57627fa00
6
irc.go
6
irc.go
@ -39,6 +39,7 @@ func ircConnect(store *FStore, plugins *plugins.Plugins) error {
|
||||
switch m.Command {
|
||||
case "001":
|
||||
for _, r := range strings.Split(ircRooms, ",") {
|
||||
log.Printf("IRC: joining %q\n", r)
|
||||
c.Write(fmt.Sprintf("JOIN %s", r))
|
||||
}
|
||||
case "PRIVMSG":
|
||||
@ -66,8 +67,8 @@ func ircConnect(store *FStore, plugins *plugins.Plugins) error {
|
||||
|
||||
}
|
||||
|
||||
if resp != "" {
|
||||
log.Printf("IRC: sending: %q to %q\n", resp, to)
|
||||
|
||||
c.WriteMessage(&irc.Message{
|
||||
Command: "PRIVMSG",
|
||||
Params: []string{
|
||||
@ -76,6 +77,9 @@ func ircConnect(store *FStore, plugins *plugins.Plugins) error {
|
||||
},
|
||||
})
|
||||
}
|
||||
default:
|
||||
log.Printf("IRC: unhandled - %q", m.String())
|
||||
}
|
||||
}),
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user