Only colour IRC nicks if there is one.

This commit is contained in:
TheHolyRoger
2020-06-18 20:40:25 +01:00
committed by GitHub
parent 2f0f2ee40d
commit 4fcb5ad510

View File

@@ -206,7 +206,7 @@ func (b *Birc) doSend() {
for msg := range b.Local {
<-throttle.C
username := msg.Username
if b.GetBool("Colornicks") {
if b.GetBool("Colornicks") && len(username) > 1 {
checksum := crc32.ChecksumIEEE([]byte(msg.Username))
colorCode := checksum%14 + 2 // quick fix - prevent white or black color codes
username = fmt.Sprintf("\x03%02d%s\x0F", colorCode, msg.Username)