Hide all PINGs and PONGs

This commit is contained in:
Trevor Slocum 2016-09-18 00:53:39 -07:00
parent 691aa1c1ba
commit fc5fd4192f
1 changed files with 2 additions and 2 deletions

View File

@ -372,7 +372,7 @@ func (s *Server) handleRead(c *Client) {
s.partAllChannels(c.identifier)
return
}
if msg.Command != irc.PING && msg.Command != irc.PONG {
if len(msg.Command) >= 4 && msg.Command[0:4] != irc.PING && msg.Command[0:4] != irc.PONG {
log.Println(c.identifier, "<-", fmt.Sprintf("%s", msg))
}
if msg.Command == irc.CAP && len(msg.Params) > 0 && len(msg.Params[0]) > 0 && msg.Params[0] == irc.CAP_LS {
@ -489,7 +489,7 @@ func (s *Server) handleWrite(c *Client) {
msg.Params = append([]string{c.nick}, msg.Params...)
}
if msg.Command != irc.PING && msg.Command != irc.PONG {
if len(msg.Command) >= 4 && msg.Command[0:4] != irc.PING && msg.Command[0:4] != irc.PONG {
log.Println(c.identifier, "->", msg)
}
c.writer.Encode(msg)