Constructor
new UserData()
Properties:
Name | Type | Description |
---|---|---|
blockedDomains |
Set.<string> | Set of domains the user has blocked. |
favouriteAccounts |
BooleanFilterOptionList | Accounts the user has favourited, retooted, or replied to. |
favouritedTags |
TagList | List of tags the user has favourited. |
followedAccounts |
StringNumberDict | Dictionary of accounts the user follows, keyed by account name. |
followedTags |
TagList | List of tags the user follows. |
isRetooter |
boolean | True if the user is primarily a retooter (retootPct above configured threshold). |
languagesPostedIn |
ObjList | List of languages the user has posted in, with usage counts. |
mutedAccounts |
Record.<string, Account> | Dictionary of accounts the user has muted or blocked, keyed by Account["webfingerURI"]. |
mutedKeywordsRegex |
RegExp | Cached regex for muted keywords, built from server-side filters. |
participatedTags |
TagList | List of tags the user has participated in. |
preferredLanguage |
string | The user's preferred language (ISO code). |
serverSideFilters |
Array.<mastodon.v2.Filter> | Array of server-side filters set by the user. |
Methods
(async) hasNewestApiData() → {Promise.<boolean>}
If there's newer data in the cache the data is not fresh.
Returns:
True if UserData object was created after the last updatedAt in Storage.
- Type
- Promise.<boolean>
(async, static) build() → {Promise.<module:api/user_data~UserData>}
Alternate constructor for the UserData object to build itself from the API (or cache).
Returns:
UserData instance populated with the user's data.
- Type
- Promise.<module:api/user_data~UserData>
(static) buildFromData(data) → {module:api/user_data~UserData}
Alternate constructor to build UserData from API data.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
UserApiData | The raw API data to build the UserData from.
Properties
|
Returns:
A new UserData instance populated with the provided data.
- Type
- module:api/user_data~UserData
(async, static) getMutedKeywords() → {Promise.<Array.<string>>}
Get an array of keywords the user has muted on the server side
Returns:
An array of muted keywords.
- Type
- Promise.<Array.<string>>
(async, static) getMutedKeywordsRegex() → {Promise.<RegExp>}
Build a regex that matches any of the user's muted keywords.
Returns:
A RegExp that matches any of the user's muted keywords.
- Type
- Promise.<RegExp>