diff --git a/server/routes/profile.js b/server/routes/profile.js index 38a895f60..f08626419 100644 --- a/server/routes/profile.js +++ b/server/routes/profile.js @@ -302,6 +302,14 @@ function* isSuspicious(profile) { } } +const mildSus = [ + 'fag', + 'faggot', + 'tranny', + 'phobic', + 'kys', +] + const hasAutomatedReports = async (db, id) => { return (await db.get(SQL`SELECT COUNT(*) AS c FROM reports WHERE userId = ${id} AND isAutomatic = 1`)).c > 0; } @@ -696,7 +704,11 @@ router.post('/profile/save', handleErrorAsync(async (req, res) => { await req.db.get(SQL`INSERT INTO links (url) VALUES (${url}) ON CONFLICT (url) DO UPDATE SET expiresAt = null`); } - const sus = [...isSuspicious(req.body)]; + let sus = [...isSuspicious(req.body)]; + // keywords with a lot of false positives should only trigger when accompanied by at least one other keyword + if (sus.length === 1 && mildSus.filter(k => sus[0].startsWith(k + ' (')).length > 0) { + sus = []; + } if (sus.length && !await hasAutomatedReports(req.db, req.user.id)) { await req.db.get(SQL` INSERT INTO reports (id, userId, reporterId, isAutomatic, comment, isHandled, snapshot)