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,11 +174,13 @@ function getPronounField(status, accountName) {
for (const field of fields) {
//match fields against fieldNames
if (fieldNames.includes(field.name.toLowerCase())) {
debug(`${account.acct}: ${field.value}`);
for (const searchTerm of fieldNames) {
if (field.name.toLowerCase().includes(searchTerm)) {
debug(`${account.acct}: ${field.value}`);
cachePronouns(accountName, field.value);
return field.value;
cachePronouns(accountName, field.value);
return field.value;
}
}
}