mirror of
https://github.com/wassname/talk.git
synced 2026-09-11 12:51:33 +08:00
fix: rename wordlist to wordList
This commit is contained in:
@@ -92,7 +92,6 @@ export async function create(
|
||||
|
||||
// Insert and handle creating the actions.
|
||||
comment = await addCommentActions(mongo, tenant, comment, inputs);
|
||||
// asse
|
||||
}
|
||||
|
||||
if (input.parent_id) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { IntermediateModerationPhase } from "talk-server/services/comments/moderation";
|
||||
|
||||
import { premod } from "talk-server/services/comments/moderation/phases/premod";
|
||||
import { toxic } from "talk-server/services/comments/moderation/phases/toxic";
|
||||
import { assetClosed } from "./assetClosed";
|
||||
import { commentingDisabled } from "./commentingDisabled";
|
||||
import { commentLength } from "./commentLength";
|
||||
import { karma } from "./karma";
|
||||
import { links } from "./links";
|
||||
import { preModerate } from "./preModerate";
|
||||
import { spam } from "./spam";
|
||||
import { staff } from "./staff";
|
||||
import { wordlist } from "./wordlist";
|
||||
import { toxic } from "./toxic";
|
||||
import { wordList } from "./wordList";
|
||||
|
||||
/**
|
||||
* The moderation phases to apply for each comment being processed.
|
||||
@@ -18,11 +18,11 @@ export const moderationPhases: IntermediateModerationPhase[] = [
|
||||
commentLength,
|
||||
assetClosed,
|
||||
commentingDisabled,
|
||||
wordlist,
|
||||
wordList,
|
||||
staff,
|
||||
links,
|
||||
karma,
|
||||
spam,
|
||||
toxic,
|
||||
premod,
|
||||
preModerate,
|
||||
];
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ const testModerationMode = (settings: Partial<ModerationSettings>) =>
|
||||
|
||||
// This phase checks to see if the settings have premod enabled, if they do,
|
||||
// the comment is premod, otherwise, it's just none.
|
||||
export const premod: IntermediateModerationPhase = ({
|
||||
export const preModerate: IntermediateModerationPhase = ({
|
||||
asset,
|
||||
tenant,
|
||||
}): IntermediatePhaseResult | void => {
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
} from "talk-server/services/comments/moderation";
|
||||
import { containsMatchingPhrase } from "talk-server/services/comments/moderation/wordlist";
|
||||
|
||||
// This phase checks the comment against the wordlist.
|
||||
export const wordlist: IntermediateModerationPhase = ({
|
||||
// This phase checks the comment against the wordList.
|
||||
export const wordList: IntermediateModerationPhase = ({
|
||||
tenant,
|
||||
comment,
|
||||
}): IntermediatePhaseResult | void => {
|
||||
@@ -21,9 +21,9 @@ export const wordlist: IntermediateModerationPhase = ({
|
||||
|
||||
// Decide the status based on whether or not the current asset/settings
|
||||
// has pre-mod enabled or not. If the comment was rejected based on the
|
||||
// wordlist, then reject it, otherwise if the moderation setting is
|
||||
// wordList, then reject it, otherwise if the moderation setting is
|
||||
// premod, set it to `premod`.
|
||||
if (containsMatchingPhrase(tenant.wordlist.banned, comment.body)) {
|
||||
if (containsMatchingPhrase(tenant.wordList.banned, comment.body)) {
|
||||
// Add the flag related to Trust to the comment.
|
||||
return {
|
||||
status: GQLCOMMENT_STATUS.REJECTED,
|
||||
@@ -42,7 +42,7 @@ export const wordlist: IntermediateModerationPhase = ({
|
||||
|
||||
// If the wordlist has matched the suspect word filter and we haven't disabled
|
||||
// auto-flagging suspect words, then we should flag the comment!
|
||||
if (containsMatchingPhrase(tenant.wordlist.suspect, comment.body)) {
|
||||
if (containsMatchingPhrase(tenant.wordList.suspect, comment.body)) {
|
||||
return {
|
||||
actions: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user