Skip to content

Commit

Permalink
fix nick rendering: adjust nick slice if has mod sigil
Browse files Browse the repository at this point in the history
  • Loading branch information
cblgh committed Jul 30, 2020
1 parent 61c57fd commit 635dedb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions views.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ function renderNicks (state, width, height) {
// Duplicate nick count
const duplicates = user.online ? onlineNickCount[name] : offlineNickCount[name]
const dupecountStr = `(${duplicates})`
outputName = util.sanitizeString(name).slice(0, width)
if (duplicates > 1) outputName = outputName.slice(0, width - dupecountStr.length - 2)
const modSigilLength = (user.isAdmin() || user.isModerator() || user.isHidden()) ? 1 : 0
outputName = util.sanitizeString(name).slice(0, width - modSigilLength)
if (duplicates > 1) outputName = outputName.slice(0, width - dupecountStr.length - 2 - modSigilLength)

// Colorize
let colorizedName = outputName.slice()
Expand Down

0 comments on commit 635dedb

Please sign in to comment.