transparently handle newlines in message
--HG-- branch : nmdc-ircfrontend
This commit is contained in:
parent
e97f344f00
commit
07f01a1d92
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user