Added MOTD reply type

This commit is contained in:
Harry Jeffery 2013-09-08 16:06:03 +01:00
parent 94ffe3fff2
commit d569334204
2 changed files with 8 additions and 0 deletions

View File

@ -175,6 +175,13 @@ func (c *Client) reply(code replyCode, args ...string) {
c.outputChan <- fmt.Sprintf(":%s 371 %s :%s", c.server.name, c.nick, args[0])
case rplVersion:
c.outputChan <- fmt.Sprintf(":%s 351 %s %s", c.server.name, c.nick, args[0])
case rplMOTD:
c.outputChan <- fmt.Sprintf(":%s 375 %s", c.server.name, c.nick)
for i := 0; i < len(args[0]); i += 80 {
line := args[0][i : i+80]
c.outputChan <- fmt.Sprintf(":%s 372 %s %s", c.server.name, c.nick, line)
}
c.outputChan <- fmt.Sprintf(":%s 376 %s", c.server.name, c.nick)
case errMoreArgs:
c.outputChan <- fmt.Sprintf(":%s 461 %s :Not enough params", c.server.name, c.nick)
case errNoNick:

View File

@ -115,6 +115,7 @@ const (
rplKick
rplInfo
rplVersion
rplMOTD
errMoreArgs
errNoNick
errInvalidNick