diff --git a/client.go b/client.go index b70d84b..293c7c1 100644 --- a/client.go +++ b/client.go @@ -3,6 +3,7 @@ package main import ( "fmt" "net" + "strings" "time" ) @@ -101,8 +102,9 @@ func (c *Client) reply(code replyCode, args ...string) { case rplKill: c.write(fmt.Sprintf(":%s KILL %s A %s", args[0], c.nick, args[1])) case rplMsg: - // FIXME escape newlines in message!! - c.write(fmt.Sprintf(":%s PRIVMSG %s %s", args[0], args[1], args[2])) + for _, itm := range strings.Split(args[2], "\n") { + c.write(fmt.Sprintf(":%s PRIVMSG %s %s", args[0], args[1], itm)) + } case rplList: c.write(fmt.Sprintf(":%s 322 %s %s", c.server.name, c.nick, args[0])) case rplListEnd: