feat(message): store messages in Postgres
This commit is contained in:
@@ -27,8 +27,9 @@ type MessagePageResponse struct {
|
||||
}
|
||||
|
||||
func (r CreateMessageRequest) Validate() bool {
|
||||
textLen := utf8.RuneCountInString(r.Text)
|
||||
if strings.TrimSpace(r.Text) == "" || textLen > 4000 {
|
||||
if strings.TrimSpace(r.Text) == "" ||
|
||||
strings.ContainsRune(r.Text, 0) ||
|
||||
utf8.RuneCountInString(r.Text) > 4000 {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user