Short resources are spammy
(cherry picked from commit c85aabf0dbeaddb7fe7b7c210e4da96be3683d6d)
This commit is contained in:
parent
4caeeb8754
commit
2669a43560
1 changed files with 7 additions and 0 deletions
|
@ -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}.*")) {
|
||||
|
|
Loading…
Reference in a new issue