mirror of
https://github.com/42wim/matterbridge.git
synced 2024-12-18 17:12:37 +01:00
Prevent white or black color codes (irc) (#434)
This commit is contained in:
parent
045cb2058c
commit
6576409d60
@ -250,7 +250,8 @@ func (b *Birc) doSend() {
|
|||||||
username := msg.Username
|
username := msg.Username
|
||||||
if b.GetBool("Colornicks") {
|
if b.GetBool("Colornicks") {
|
||||||
checksum := crc32.ChecksumIEEE([]byte(msg.Username))
|
checksum := crc32.ChecksumIEEE([]byte(msg.Username))
|
||||||
username = fmt.Sprintf("\x03%02d%s\x0F", checksum%0x10, msg.Username)
|
colorCode := checksum%14 + 2 // quick fix - prevent white or black color codes
|
||||||
|
username = fmt.Sprintf("\x03%02d%s\x0F", colorCode, msg.Username)
|
||||||
}
|
}
|
||||||
if msg.Event == config.EVENT_USER_ACTION {
|
if msg.Event == config.EVENT_USER_ACTION {
|
||||||
b.i.Cmd.Action(msg.Channel, username+msg.Text)
|
b.i.Cmd.Action(msg.Channel, username+msg.Text)
|
||||||
|
Loading…
Reference in New Issue
Block a user