mirror of
https://github.com/wassname/talk.git
synced 2026-08-06 13:41:02 +08:00
[next] Perspective API Integration (#1797)
* feat: initial toxic comments impl * feat: improved logging * feat: tenant cache adapter * feat: move more types into graphql
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { get } from "lodash";
|
||||
|
||||
import { KarmaThresholds } from "talk-server/models/settings";
|
||||
import { GQLKarmaThresholds } from "talk-server/graph/tenant/schema/__generated__/types";
|
||||
import { User } from "talk-server/models/user";
|
||||
|
||||
export const getCommentTrustScore = (user: User): number =>
|
||||
get(user, "metadata.trust.comment.karma", 0);
|
||||
|
||||
export const isReliableCommenter = (
|
||||
thresholds: KarmaThresholds,
|
||||
thresholds: GQLKarmaThresholds,
|
||||
user: User
|
||||
): boolean | null => {
|
||||
const score = getCommentTrustScore(user);
|
||||
|
||||
Reference in New Issue
Block a user