Trim trailing whitespace off RPL_NAMREPLY, this fixes usercount sometimes being 1 too high

This commit is contained in:
Ken-Håvard Lieng 2016-02-01 00:14:24 +01:00
parent e2fbac7f38
commit 58fe1c630a

View File

@ -183,7 +183,7 @@ func (i *ircHandler) topic(msg *irc.Message) {
}
func (i *ircHandler) names(msg *irc.Message) {
users := strings.Split(msg.Trailing, " ")
users := strings.Split(strings.TrimSuffix(msg.Trailing, " "), " ")
userBuffer := i.userBuffers[msg.Params[2]]
i.userBuffers[msg.Params[2]] = append(userBuffer, users...)
}