replace invalid utf8 chars in text messages

This commit is contained in:
2022-12-22 02:52:39 +01:00
parent cb8185e5bb
commit f6f73096e0

View File

@@ -17,6 +17,7 @@ import (
log "github.com/sirupsen/logrus"
"io"
"net/http"
"strings"
"time"
)
@@ -563,7 +564,7 @@ workloop:
var bulk []*ent.MessagesCreate
for _, msg := range tMatchPlayer.Edges.Messages {
bulk = append(bulk, tx.Messages.Create().
SetMessage(msg.Message).
SetMessage(strings.ToValidUTF8(msg.Message, "")).
SetAllChat(msg.AllChat).
SetTick(msg.Tick).
SetMatchPlayer(tMatchPlayer))