make sure partial strings are also matched

This commit is contained in:
ItsVipra 2023-07-09 14:51:26 +02:00
parent 2c0dc6be78
commit 8d5e157312

View file

@ -174,13 +174,15 @@ function getPronounField(status, accountName) {
for (const field of fields) {
//match fields against fieldNames
if (fieldNames.includes(field.name.toLowerCase())) {
for (const searchTerm of fieldNames) {
if (field.name.toLowerCase().includes(searchTerm)) {
debug(`${account.acct}: ${field.value}`);
cachePronouns(accountName, field.value);
return field.value;
}
}
}
//if not returned by this point no field with pronouns was found