Skip to content

Commit

Permalink
fix: downgrade blurifadult
Browse files Browse the repository at this point in the history
  • Loading branch information
mary-ext committed Mar 27, 2024
1 parent 173a598 commit bc515b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/api/moderation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ContextProfileList = 5;
export type ModerationContext = 0 | 1 | 2 | 3 | 4 | 5;

const BehaviorBlur = 0;
const BehaviorBlurIfAdult = 1;
const BehaviorBlurIfAdultOrAlert = 1;
const BehaviorAlertOrInform = 2;

type ModerationBehavior = 0 | 1 | 2;
Expand Down Expand Up @@ -151,15 +151,15 @@ const LABEL_BEHAVIORAL_MAPPING: LabelBehavioralMapping = {
[ContextProfileList]: BehaviorAlertOrInform,
[ContextProfileView]: BehaviorAlertOrInform,
[ContextContentList]: BehaviorBlur,
[ContextContentView]: BehaviorBlurIfAdult,
[ContextContentView]: BehaviorBlurIfAdultOrAlert,
},
[TargetProfile]: {
[ContextProfileList]: BehaviorAlertOrInform,
[ContextProfileView]: BehaviorAlertOrInform,
},
[TargetContent]: {
[ContextContentList]: BehaviorBlur,
[ContextContentView]: BehaviorBlurIfAdult,
[ContextContentView]: BehaviorBlurIfAdultOrAlert,
},
},
[BlurMedia]: {
Expand Down Expand Up @@ -518,13 +518,13 @@ export const getModerationUI = (causes: ModerationCause[], context: ModerationCo
}
}

if (behavior === BehaviorBlur || (behavior === BehaviorBlurIfAdult && flags & FlagsAdultOnly)) {
if (behavior === BehaviorBlur || (behavior === BehaviorBlurIfAdultOrAlert && flags & FlagsAdultOnly)) {
blurs.push(cause);

if (flags & FlagsForced) {
overridable = false;
}
} else if (behavior === BehaviorAlertOrInform) {
} else if (behavior === BehaviorAlertOrInform || behavior === BehaviorBlurIfAdultOrAlert) {
if (severity === SeverityAlert) {
alerts.push(cause);
} else if (severity === SeverityInform) {
Expand Down

0 comments on commit bc515b9

Please sign in to comment.