mirror of
https://github.com/wassname/talk.git
synced 2026-10-04 13:10:23 +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 parent
d2106b3de5
commit
0b3aead1d2
33 files changed
+1088
-417
No files matched your search
@@ -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