Skip to content

Commit

Permalink
Sanitise usernames (close #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Jan 7, 2018
1 parent 2eb64af commit 17536c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bridge/irc_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ func sanitiseNickname(nick string) string {
}

func (m *IRCManager) generateNickname(discord DiscordUser) string {
username := discord.Username
discriminator := discord.Discriminator

nick := sanitiseNickname(discord.Nick)
suffix := m.bridge.Config.Suffix
newNick := nick + suffix
Expand Down Expand Up @@ -188,6 +185,8 @@ func (m *IRCManager) generateNickname(discord DiscordUser) string {
}

if useFallback {
discriminator := discord.Discriminator
username := sanitiseNickname(discord.Username)
suffix = "~" + discriminator + suffix

// Maximum length of a username but without the suffix
Expand Down

0 comments on commit 17536c1

Please sign in to comment.