Suppress first name with initials only

This commit is contained in:
M66B
2021-04-05 11:14:02 +02:00
parent 22de68038c
commit 0b63c18846

View File

@@ -94,6 +94,20 @@ public class EntityAnswer implements Serializable {
}
}
if (fullName != null && !fullName.equals(first)) {
String[] parts = first.split("\\.");
if (parts != null && parts.length > 0) {
boolean initials = true;
for (String part : parts)
if (part.trim().length() > 1) {
initials = false;
break;
}
if (initials)
first = null;
}
}
text = text.replace("$name$", fullName == null ? "" : fullName);
text = text.replace("$firstname$", first == null ? "" : first);
text = text.replace("$lastname$", last == null ? "" : last);