From 1d50ddb378d5c6954d4cf8a6145b4486b9497107 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 27 Apr 2023 12:38:23 -0500 Subject: Refactor moderation to apply to accounts, profiles, and posts correctly (#548) * Add ScreenHider component * Add blur attribute to UserAvatar and UserBanner * Remove dead suggested posts component and model * Bump @atproto/api@0.2.10 * Rework moderation tooling to give a more precise DSL * Add label mocks * Apply finer grained moderation controls * Refactor ProfileCard to just take the profile object * Apply moderation to user listings and banner * Apply moderation to notifications * Fix lint * Tune avatar & banner blur settings per platform * 1.24 --- src/lib/labeling/types.ts | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/lib/labeling/types.ts (limited to 'src/lib/labeling/types.ts') diff --git a/src/lib/labeling/types.ts b/src/lib/labeling/types.ts new file mode 100644 index 000000000..d4efb499a --- /dev/null +++ b/src/lib/labeling/types.ts @@ -0,0 +1,58 @@ +import {ComAtprotoLabelDefs} from '@atproto/api' +import {LabelPreferencesModel} from 'state/models/ui/preferences' + +export type Label = ComAtprotoLabelDefs.Label + +export interface LabelValGroup { + id: keyof LabelPreferencesModel | 'illegal' | 'unknown' + title: string + imagesOnly: boolean + subtitle?: string + warning: string + values: string[] +} + +export interface PostLabelInfo { + postLabels: Label[] + accountLabels: Label[] + profileLabels: Label[] + isMuted: boolean +} + +export interface ProfileLabelInfo { + accountLabels: Label[] + profileLabels: Label[] + isMuted: boolean +} + +export enum ModerationBehaviorCode { + Show, + Hide, + Warn, + WarnContent, + WarnImages, +} + +export interface ModerationBehavior { + behavior: ModerationBehaviorCode + noOverride?: boolean + reason?: string +} + +export interface AvatarModeration { + warn: boolean + blur: boolean +} + +export interface PostModeration { + avatar: AvatarModeration + list: ModerationBehavior + thread: ModerationBehavior + view: ModerationBehavior +} + +export interface ProfileModeration { + avatar: AvatarModeration + list: ModerationBehavior + view: ModerationBehavior +} -- cgit 1.4.1