(value string, maxLen int)
| 6330 | } |
| 6331 | |
| 6332 | func truncateRunes(value string, maxLen int) string { |
| 6333 | if maxLen <= 0 { |
| 6334 | return "" |
| 6335 | } |
| 6336 | |
| 6337 | runes := []rune(value) |
| 6338 | if len(runes) <= maxLen { |
| 6339 | return value |
| 6340 | } |
| 6341 | |
| 6342 | return string(runes[:maxLen]) |
| 6343 | } |
| 6344 | |
| 6345 | // linkFilesToChat inserts file-link rows into the chat_file_links |
| 6346 | // join table. Cap enforcement and dedup are handled atomically in |
no outgoing calls
no test coverage detected