1
0
Fork 1

Short resources are spammy

(cherry picked from commit c85aabf0dbeaddb7fe7b7c210e4da96be3683d6d)
This commit is contained in:
Stephen Paul Weber 2024-11-09 14:20:16 -05:00 committed by Arne
parent 4caeeb8754
commit 2669a43560

View file

@ -1560,6 +1560,13 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
final var locale = java.util.Locale.getDefault();
final var script = locale.getScript();
for (final var m : messages) {
if (getMode() != MODE_MULTI) {
final var resource = m.getCounterpart().getResource();
if (resource != null && resource.length() < 10) {
anyMatchSpam = true;
return;
}
}
final var body = m.getRawBody();
try {
if (!"Cyrl".equals(script) && body.matches(".*\\p{IsCyrillic}.*")) {