Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderation 2025-01-07 #600

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions antiabuse/antispam/urldetector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
'discordapp.com',
'instagram.com',
'onlyfans.com',
'paypal.com',
'paypal.me',
'throne.com',
'twitch.tv',
}
Expand Down
14 changes: 10 additions & 4 deletions antiabuse/normalize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"fvcked": "fucked",
"fvck": "fuck",
"fvcking": "fucking",
"h[@a4]rm": "harm",
"l0licon": "lolicon",
"l0li": "loli",
"ngger": "nigger",
"nggr": "nigger",
Expand All @@ -37,12 +39,16 @@
"p0rn": "porn",
"p[e3]d[o0]": "pedo",
"pissin": "pissing",
"r[a4]p[e3]-?able": "rapeable",
"r[a4]p[e3]": "rape",
"r[@a4]p[e3]-?able": "rapeable",
"r[@a4]p[e3]": "rape",
"r": "are",
"raype": "rape",
"s[e3]lf": "self",
"sxy": "sexy",
"un-?r[a4]p[e3]-?able": "unrapeable",
"un-?r[a4]p[e3]": "unrape",
"tr[@a4]nnies": "trannies",
"tr[@a4]nny": "tranny",
"un-?r[@a4]p[e3]-?able": "unrapeable",
"un-?r[@a4]p[e3]": "unrape",
"urself": "yourself",
"ur": "your",
"u": "you",
Expand Down
8 changes: 8 additions & 0 deletions antiabuse/normalize/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def test_normalize_string(self):

self.assertEqual(normalize_string("r4p3"), "rape")

self.assertEqual(normalize_string("raype"), "rape")

self.assertEqual(normalize_string("a55"), "ass")

self.assertEqual(normalize_string("𝖓𝖎𝖌𝖌𝖊𝖗"), "nigger")
Expand All @@ -18,6 +20,12 @@ def test_normalize_string(self):

self.assertEqual(normalize_string("unr4pe-able"), "unrapeable")

self.assertEqual(normalize_string("s3lf h4rm"), "self harm")

self.assertEqual(normalize_string("tr@nnies"), "trannies")

self.assertEqual(normalize_string("tr@nny"), "tranny")


if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion service/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

class IntroRateLimit(Enum):
NONE = 0
UNVERIFIED = 20
UNVERIFIED = 15
BASICS = 40
PHOTOS = 100

Expand Down
48 changes: 15 additions & 33 deletions service/search/sql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
coordinates,
personality,
gender_id,
verification_level_id,
COALESCE(
(
SELECT
Expand Down Expand Up @@ -531,21 +530,13 @@
500
), do_promote_verified AS (
SELECT
has_minimum_count.x
AND
searcher.verification_level_id > 1 AS x
count(*) >= 250 AS x
FROM
searcher,
(
SELECT
count(*) >= 250 AS x
FROM
prospects_fourth_pass
WHERE
profile_photo_uuid IS NOT NULL
AND
verified
) AS has_minimum_count
prospects_fourth_pass
WHERE
profile_photo_uuid IS NOT NULL
AND
verified
)
INSERT INTO search_cache (
searcher_person_id,
Expand Down Expand Up @@ -706,32 +697,23 @@
Q_QUIZ_SEARCH = """
WITH searcher AS (
SELECT
personality,
verification_level_id
personality
FROM
person
WHERE
person.id = %(searcher_person_id)s
LIMIT 1
), do_promote_verified AS (
SELECT
has_minimum_count.x
AND
searcher.verification_level_id > 1 AS x
count(*) >= 250 AS x
FROM
searcher,
(
SELECT
count(*) >= 250 AS x
FROM
search_cache
WHERE
searcher_person_id = %(searcher_person_id)s
AND
profile_photo_uuid IS NOT NULL
AND
verified
) AS has_minimum_count
search_cache
WHERE
searcher_person_id = %(searcher_person_id)s
AND
profile_photo_uuid IS NOT NULL
AND
verified
), page AS (
SELECT
prospect_person_id,
Expand Down
14 changes: 0 additions & 14 deletions test/functionality1/search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -397,20 +397,6 @@ test_verified_promoted () {

local response=$(c GET '/search?n=5&o=0' | jq -r '[.[].name] | join(" ")')
[[ "$response" = 'user2 extrauser1 extrauser2 extrauser4 extrauser5' ]]

# If the searcher isn't verified, they don't necessarily see verified members
# first
q "
update
person
set
verification_level_id = 1
where
name = 'searcher'
"

local response=$(c GET '/search?n=5&o=0' | jq -r '[.[].name] | join(" ")')
[[ "$response" = 'user1 user2 extrauser1 extrauser2 extrauser3' ]]
}

test_quiz_filters () {
Expand Down
2 changes: 1 addition & 1 deletion test/functionality4/xmpp-rate-limit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ test_rate_limit () {
}

test_rate_limit \
20 \
15 \
1 \
'<duo_message_blocked id="id999" reason="rate-limited-1day" subreason="unverified-basics"/>'

Expand Down
Loading