From a623d8ef1e90e8a38dfce134ddb134a396ed83ab Mon Sep 17 00:00:00 2001 From: vegax87 Date: Mon, 23 Jan 2017 21:20:42 +0100 Subject: [PATCH] Solved! RPL_USERHOST must use trailing --- irc/client.go | 1 + irc/server.go | 4 ++-- irc/util.go | 17 ----------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/irc/client.go b/irc/client.go index 983b36bf..c2e16d91 100644 --- a/irc/client.go +++ b/irc/client.go @@ -543,6 +543,7 @@ var ( "NOTICE": true, RPL_WHOISCHANNELS: true, + RPL_USERHOST: true, } ) diff --git a/irc/server.go b/irc/server.go index e0f26b8e..a1b71af1 100644 --- a/irc/server.go +++ b/irc/server.go @@ -1861,9 +1861,9 @@ func userhostHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool } if target.flags[Away] { - client.Send(nil, client.server.name, RPL_USERHOST, client.nick, fmt.Sprintf("%s =- %s @ %s", target.nick, target.username, target.hostname)) + client.Send(nil, client.server.name, RPL_USERHOST, client.nick, fmt.Sprintf("%s=-%s@%s", target.nick, target.username, target.hostname)) } else { - client.Send(nil, client.server.name, RPL_USERHOST, client.nick, fmt.Sprintf("%s =+ %s @ %s", target.nick, target.username, target.hostname)) + client.Send(nil, client.server.name, RPL_USERHOST, client.nick, fmt.Sprintf("%s=+%s@%s", target.nick, target.username, target.hostname)) } return false } diff --git a/irc/util.go b/irc/util.go index 1d9bc114..03f806c2 100644 --- a/irc/util.go +++ b/irc/util.go @@ -3,11 +3,6 @@ package irc -import ( - "strings" - "unicode" -) - // argsToStrings takes the arguments and splits them into a series of strings, // each argument separated by delim and each string bounded by maxLength. func argsToStrings(maxLength int, arguments []string, delim string) []string { @@ -38,15 +33,3 @@ func argsToStrings(maxLength int, arguments []string, delim string) []string { return messages } - -// stripSpaces removes all whitespaces inside a string -func stripSpaces(str string) string { - return strings.Map(func(r rune) rune { - if unicode.IsSpace(r) { - // if the character is a space, drop it - return -1 - } - // else keep it in the string - return r - }, str) -}