From 393070b7d9832f584ae2fd6f0261e951bdf434fd Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Fri, 20 Apr 2018 14:13:25 -0400 Subject: [PATCH] fix #249 --- irc/client.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/irc/client.go b/irc/client.go index 0cafce83..0ac9bddc 100644 --- a/irc/client.go +++ b/irc/client.go @@ -627,10 +627,14 @@ func (client *Client) LoggedIntoAccount() bool { // RplISupport outputs our ISUPPORT lines to the client. This is used on connection and in VERSION responses. func (client *Client) RplISupport(rb *ResponseBuffer) { translatedISupport := client.t("are supported by this server") - for _, tokenline := range client.server.ISupport().CachedReply { - // ugly trickery ahead - tokenline = append(tokenline, translatedISupport) - rb.Add(nil, client.server.name, RPL_ISUPPORT, append([]string{client.nick}, tokenline...)...) + nick := client.Nick() + for _, cachedTokenLine := range client.server.ISupport().CachedReply { + length := len(cachedTokenLine) + 2 + tokenline := make([]string, length) + tokenline[0] = nick + copy(tokenline[1:], cachedTokenLine) + tokenline[length-1] = translatedISupport + rb.Add(nil, client.server.name, RPL_ISUPPORT, tokenline...) } }