global badge/class fix

This commit is contained in:
Luxferre
2024-09-20 13:44:13 +03:00
parent b6200db5de
commit 9f298cba52
6 changed files with 18 additions and 21 deletions
+3 -4
View File
@@ -74,7 +74,6 @@ func oc_process_message(rawmsg map[string]interface{}) {
author["displayName"] = "System"
}
/* convert the timestamp */
sent_dt, _ := time.Parse("2006-01-02T15:04:05.000000000Z", rawmsg["timestamp"].(string))
@@ -93,19 +92,19 @@ func oc_process_message(rawmsg map[string]interface{}) {
/* check for authenticated role */
if _, ok := author["authenticated"]; ok && author["authenticated"].(bool) == true {
out_message.Type += "-authenticated"
out_message.Type += "^authenticated"
}
/* check for bot role */
if _, ok := author["isBot"]; ok && author["isBot"].(bool) == true {
out_message.Type += "-bot"
out_message.Type += "^bot"
}
/* add display color hint */
if _, ok := author["displayColor"]; ok {
dcolor := int(author["displayColor"].(float64))
if dcolor > 0 {
out_message.Type += fmt.Sprintf("-occolor%d", dcolor)
out_message.Type += fmt.Sprintf("^occolor%d", dcolor)
}
}