внес правки

This commit is contained in:
2026-10-23 00:00:08 +03:00
parent 3695ab6dfa
commit 2ebebda388
9 changed files with 217 additions and 44 deletions
+8 -3
View File
@@ -8,6 +8,7 @@ import (
"fmt"
"strconv"
"sync/atomic"
"unicode"
"unicode/utf8"
"github.com/jackc/pgx/v5"
@@ -390,12 +391,16 @@ func validMessageText(s string) bool {
if n == 0 || n > 4000 {
return false
}
hasContent := false
for _, r := range s {
if r != ' ' && r != '\t' && r != '\n' && r != '\r' {
return true
if r == 0 {
return false
}
if !unicode.IsSpace(r) {
hasContent = true
}
}
return false
return hasContent
}
var ErrSessionNotFound = errors.New("session not found or expired")