diff --git a/README.md b/README.md index 151416f..b0da160 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,6 @@ The config file is a yaml formatted file with the following fields: | `nickserv_identify` | No | | Yes | on connect this message will be sent: `PRIVMSG nickserv IDENTIFY `, you can provide both a username and password if your ircd supports it | | `cooldown_duration` | No | 86400 (24 hours) | Yes | time in seconds for a discord user to be offline before it's puppet disconnects from irc | | `show_joinquit` | No | false | yes | displays JOIN, PART, QUIT, KICK on discord | -| `max_nick_length` | No | 30 | yes | Maximum allowed nick length | | `ignored_irc_hostmasks` | No | | Yes | A list of IRC users identified by hostmask to not relay to Discord, uses matching syntax as in [glob](https://github.com/gobwas/glob) | | `connection_limit` | Yes | 0 | Yes | How many connections to IRC (including our listener) to spawn (limit of 0 or less means unlimited) | diff --git a/bridge/bridge.go b/bridge/bridge.go index 17373f4..37be64c 100644 --- a/bridge/bridge.go +++ b/bridge/bridge.go @@ -68,9 +68,6 @@ type Config struct { // ShowJoinQuit determines whether or not to show JOIN, QUIT, KICK messages on Discord ShowJoinQuit bool - // Maximum Nicklength for irc server - MaxNickLength int - Debug bool DebugPresence bool } diff --git a/bridge/irc_manager.go b/bridge/irc_manager.go index d948565..0faeee9 100644 --- a/bridge/irc_manager.go +++ b/bridge/irc_manager.go @@ -302,7 +302,7 @@ func (m *IRCManager) generateNickname(discord DiscordUser) string { suffix := m.bridge.Config.Suffix newNick := nick + suffix - useFallback := len(newNick) > m.bridge.Config.MaxNickLength || m.bridge.ircListener.DoesUserExist(newNick) + useFallback := len(newNick) > int(m.bridge.ircListener.NickLength()) || m.bridge.ircListener.DoesUserExist(newNick) // log.WithFields(log.Fields{ // "length": len(newNick) > ircnick.MAXLENGTH, // "useFallback": useFallback, diff --git a/config.yml b/config.yml index 7b4a751..9983a44 100644 --- a/config.yml +++ b/config.yml @@ -25,7 +25,6 @@ webirc_pass: abcdef.ghijk.lmnop show_joinquit: false # displays JOIN, PART, QUIT, KICK on discord cooldown_duration: 86400 # optional, default 86400 (24 hours), time in seconds for a discord user to be offline before it's puppet disconnects from irc -max_nick_length: 30 # Maximum Length of a nick allowed # You definitely should restart the bridge after changing the following: insecure: true diff --git a/main.go b/main.go index 1d0d11d..3f48279 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,6 @@ import ( "github.com/gobwas/glob" "github.com/pkg/errors" "github.com/qaisjp/go-discord-irc/bridge" - ircnick "github.com/qaisjp/go-discord-irc/irc/nick" log "github.com/sirupsen/logrus" "github.com/spf13/viper" ) @@ -117,9 +116,6 @@ func main() { // viper.SetDefault("show_joinquit", false) showJoinQuit := viper.GetBool("show_joinquit") - // Maximum length of user nicks aloud - viper.SetDefault("max_nick_length", ircnick.MAXLENGTH) - maxNickLength := viper.GetInt("max_nick_length") if webIRCPass == "" { log.Warnln("webirc_pass is empty") @@ -167,7 +163,6 @@ func main() { WebhookPrefix: webhookPrefix, CooldownDuration: time.Second * time.Duration(cooldownDuration), ShowJoinQuit: showJoinQuit, - MaxNickLength: maxNickLength, Debug: *debugMode, DebugPresence: *debugPresence,