This commit is contained in:
KMY 2023-11-04 10:11:06 +09:00
parent 52dac50826
commit 7e088863b4
5 changed files with 29 additions and 15 deletions

View file

@ -6,6 +6,7 @@ import escapeTextContentForBrowser from 'escape-html';
import type {
ApiAccountFieldJSON,
ApiAccountRoleJSON,
ApiAccountOtherSettingsJSON,
ApiAccountJSON,
} from 'mastodon/api_types/accounts';
import type { ApiCustomEmojiJSON } from 'mastodon/api_types/custom_emoji';
@ -43,6 +44,23 @@ const AccountRoleFactory = ImmutableRecord<AccountRoleShape>({
name: '',
});
// AccountOtherSettings
export type AccountOtherSettingsShape = ApiAccountOtherSettingsJSON;
export type AccountOtherSettings = RecordOf<AccountOtherSettingsShape>;
const AccountOtherSettingsFactory = ImmutableRecord<AccountOtherSettingsShape>({
noindex: false,
noai: true,
hide_network: false,
hide_followers_count: false,
hide_following_count: false,
hide_statuses_count: false,
translatable_private: false,
link_preview: true,
allow_quote: true,
emoji_reaction_policy: 'allow',
});
// Account
export interface AccountShape
extends Required<
@ -93,6 +111,8 @@ export const accountDefaultValues: AccountShape = {
memorial: false,
limited: false,
moved: null,
other_settings: AccountOtherSettingsFactory(),
subscribable: true,
};
const AccountFactory = ImmutableRecord<AccountShape>(accountDefaultValues);