replace invalid utf8 chars in text messages
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -563,7 +564,7 @@ workloop:
|
|||||||
var bulk []*ent.MessagesCreate
|
var bulk []*ent.MessagesCreate
|
||||||
for _, msg := range tMatchPlayer.Edges.Messages {
|
for _, msg := range tMatchPlayer.Edges.Messages {
|
||||||
bulk = append(bulk, tx.Messages.Create().
|
bulk = append(bulk, tx.Messages.Create().
|
||||||
SetMessage(msg.Message).
|
SetMessage(strings.ToValidUTF8(msg.Message, "")).
|
||||||
SetAllChat(msg.AllChat).
|
SetAllChat(msg.AllChat).
|
||||||
SetTick(msg.Tick).
|
SetTick(msg.Tick).
|
||||||
SetMatchPlayer(tMatchPlayer))
|
SetMatchPlayer(tMatchPlayer))
|
||||||
|
Reference in New Issue
Block a user