diff --git a/src/content_scripts/protoots.js b/src/content_scripts/protoots.js index 39aa062..008d55a 100644 --- a/src/content_scripts/protoots.js +++ b/src/content_scripts/protoots.js @@ -32,7 +32,7 @@ checkSite(); * If so creates an 'readystatechange' EventListener, with callback to main() */ async function checkSite() { - await getSettings(); + getSettings(); const requestDest = location.protocol + "//" + hostName + "/api/v1/instance"; const response = await fetch(requestDest); diff --git a/src/libs/fetchPronouns.js b/src/libs/fetchPronouns.js index aa4d09b..f8f7527 100644 --- a/src/libs/fetchPronouns.js +++ b/src/libs/fetchPronouns.js @@ -4,6 +4,7 @@ import { normaliseAccountName } from "./protootshelpers"; const cacheMaxAge = 24 * 60 * 60 * 1000; // time after which cached pronouns should be checked again: 24h let conversationsCache; +const fieldNames = ["pronouns", "pronoun", "professional nouns", "pronomen"]; /** * Fetches pronouns associated with account name. @@ -172,10 +173,8 @@ function getPronounField(status, accountName) { const fields = account.fields; for (const field of fields) { - //match fields against "pronouns" - //TODO: multiple languages -> match against list - if (field.name.toLowerCase().includes("pronouns")) { - //TODO: see https://github.com/ItsVipra/ProToots/issues/28 + //match fields against fieldNames + if (fieldNames.includes(field.name.toLowerCase())) { debug(`${account.acct}: ${field.value}`); cachePronouns(accountName, field.value); diff --git a/src/libs/platforms/mastodon.js b/src/libs/platforms/mastodon.js new file mode 100644 index 0000000..e69de29