Skip to content

Commit

Permalink
preliminarily add copy for illegal rejection notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-funk committed Nov 14, 2023
1 parent 391959e commit 8288277
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 23 deletions.
27 changes: 27 additions & 0 deletions server/src/core/server/locales/en-US/common.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@ notifications-illegalContentReportReviewed-description =
containing illegal content. After reviewing your report, our moderation
team has decided this comment { $decision }.
notifications-commentRejected-title =
Your comment has been rejected and removed from our site
notifications-commentRejected-description =
Our moderators have reviewed your comment and determined your comment contains content that violates our community guidelines or terms of service.
<br/>
<br/>
{ $details }
notifications-commentRejected-details-general =
<b>REASON FOR REMOVAL</b><br/>
{ $reason }<br/>
<b>ADDITIONAL EXPLANATION</b><br/>
{ $explanation }
notifications-commentRejected-details-illegalContent =
<b>REASON FOR REMOVAL</b><br/>
<descriptItem>{ $reason }</descriptItem><br/>
<b>LEGAL GROUNDS</b><br/>
{ $grounds }<br/>
<b>ADDITIONAL EXPLANATION</b><br/>
{ $explanation }
notification-reasonForRemoval-illegal = Illegal content
notifications-commentRejected-details-notFound =
Details for this rejection cannot be found.
# Notifications (old)

notifications-commentWasFeatured-title = Comment was featured
Expand Down
57 changes: 34 additions & 23 deletions server/src/core/server/services/notifications/internal/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,34 +310,49 @@ export class InternalNotificationContext {
legal: DSALegality | undefined,
now: Date
) {
const reason = legal
const title = this.translatePhrase(
lang,
"notifications-commentRejected-title",
"Your comment has been rejected and removed from our site"
);

const reasonForRemoval = this.translatePhrase(
lang,
"notification-reasonForRemoval-illegal",
"Illegal content"
);

const details = legal
? this.translatePhrase(
lang,
"notifications-dsaIllegalRejectedReason-information",
`Grounds:
${legal?.grounds}
Explanation:
${legal?.explanation}`,
"notifications-commentRejected-details-illegalContent",
`<b>REASON FOR REMOVAL</b><br/>
${reasonForRemoval}<br/>
<b>LEGAL GROUNDS</b><br/>
${legal.grounds}<br/>
<b>ADDITIONAL EXPLANATION</b><br/>
${legal.explanation}`,
{
grounds: legal.grounds,
explanation: legal.explanation,
reason: reasonForRemoval,
grounds: legal.grounds ?? "",
explanation: legal.explanation ?? "",
}
)
: this.translatePhrase(
lang,
"notifications-dsaIllegalRejectedReason-informationNotFound",
"The reasoning for this decision cannot be found."
"notifications-commentRejected-details-notFound",
"Details for this rejection cannot be found."
);

const body = this.translatePhrase(
const description = this.translatePhrase(
lang,
"notifications-commentWasRejectedAndIllegal-body",
`The comment ${comment.id} was rejected for containing illegal content.
The reason of which was: ${reason}
`,
"notifications-commentRejected-description",
`Our moderators have reviewed your comment determined your comment contains
violates our community guidelines or terms of service.<br/>
<br/>
${details}`,
{
commentID: comment.id,
reason,
details,
}
).replace("\n", "<br/>");

Expand All @@ -347,12 +362,8 @@ export class InternalNotificationContext {
type,
createdAt: now,
ownerID: targetUserID,
title: this.translatePhrase(
lang,
"notifications-commentWasRejectedAndIllegal-title",
"Comment was deemed to contain illegal content and was rejected"
),
body,
title,
body: description,
commentID: comment.id,
commentStatus: comment.status,
});
Expand Down

0 comments on commit 8288277

Please sign in to comment.