Only colour IRC nicks if there is one. (#1161)
This commit is contained in:
parent
bce736993e
commit
5847f7758c
|
@ -206,7 +206,7 @@ func (b *Birc) doSend() {
|
||||||
for msg := range b.Local {
|
for msg := range b.Local {
|
||||||
<-throttle.C
|
<-throttle.C
|
||||||
username := msg.Username
|
username := msg.Username
|
||||||
if b.GetBool("Colornicks") {
|
if b.GetBool("Colornicks") && len(username) > 1 {
|
||||||
checksum := crc32.ChecksumIEEE([]byte(msg.Username))
|
checksum := crc32.ChecksumIEEE([]byte(msg.Username))
|
||||||
colorCode := checksum%14 + 2 // quick fix - prevent white or black color codes
|
colorCode := checksum%14 + 2 // quick fix - prevent white or black color codes
|
||||||
username = fmt.Sprintf("\x03%02d%s\x0F", colorCode, msg.Username)
|
username = fmt.Sprintf("\x03%02d%s\x0F", colorCode, msg.Username)
|
||||||
|
|
Loading…
Reference in New Issue