diff --git a/Cargo.lock b/Cargo.lock index bb62111..6ad9b30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1437,7 +1437,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "payphone" -version = "4.2.15" +version = "4.2.17" dependencies = [ "async-trait", "axum", diff --git a/Cargo.toml b/Cargo.toml index 80bea1f..cf3753d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "payphone" -version = "4.2.15" +version = "4.2.17" edition = "2024" default-run = "payphone" diff --git a/src/database/migrations/0004_participant_is_masked.cql b/src/database/migrations/0004_participant_is_masked.cql index 8fb02b5..728a22c 100644 --- a/src/database/migrations/0004_participant_is_masked.cql +++ b/src/database/migrations/0004_participant_is_masked.cql @@ -3,4 +3,4 @@ ALTER TABLE payphone.participants ADD is_masked BOOLEAN; CREATE MATERIALIZED VIEW IF NOT EXISTS payphone.participants_by_user_id AS SELECT user_id, call_id, channel_id FROM payphone.participants WHERE user_id IS NOT NULL AND call_id IS NOT NULL AND channel_id IS NOT NULL - PRIMARY KEY (user_id, call_id); + PRIMARY KEY (user_id, call_id, channel_id); diff --git a/src/groups/calls/lists/casual-insults-and-teasing.txt b/src/groups/calls/lists/casual-insults-and-teasing.txt index 7e99681..d4d664f 100644 --- a/src/groups/calls/lists/casual-insults-and-teasing.txt +++ b/src/groups/calls/lists/casual-insults-and-teasing.txt @@ -12,4 +12,6 @@ gtfo // and other stuff. keys // Many people not knowing paki is a slur, it's better to keep it here. -paki \ No newline at end of file +paki +hoe +ho \ No newline at end of file diff --git a/src/groups/calls/lists/explicit-sexual-language-typos.txt b/src/groups/calls/lists/explicit-sexual-language-typos.txt deleted file mode 100644 index 7d13c43..0000000 --- a/src/groups/calls/lists/explicit-sexual-language-typos.txt +++ /dev/null @@ -1 +0,0 @@ -ho \ No newline at end of file diff --git a/src/groups/calls/lists/explicit-sexual-language.txt b/src/groups/calls/lists/explicit-sexual-language.txt index 786cef7..aa76e18 100644 --- a/src/groups/calls/lists/explicit-sexual-language.txt +++ b/src/groups/calls/lists/explicit-sexual-language.txt @@ -56,9 +56,6 @@ gang bang squirt squirting squirts -hoe -// ho is in "explicit sexual language typos" because it's usually also a typo of "hi". it gets -// censored instead of banned. slut dldo dildo diff --git a/src/groups/calls/moderation.rs b/src/groups/calls/moderation.rs index 1775181..78546a7 100644 --- a/src/groups/calls/moderation.rs +++ b/src/groups/calls/moderation.rs @@ -559,43 +559,6 @@ impl Rule for ExplicitSexualLanguageRule { } } -#[derive(Debug)] -struct ExplicitSexualLanguageTypoRule { - pattern: Regex, - exceptions: Vec, -} - -impl ExplicitSexualLanguageTypoRule { - fn new() -> Self { - let (phrases, exceptions) = - parse_phrases_file(include_str!("lists/explicit-sexual-language-typos.txt")); - - let regex = regex_from_phrases_list(&phrases); - - Self { - pattern: regex, - exceptions, - } - } -} - -impl Rule for ExplicitSexualLanguageTypoRule { - fn action(&self) -> &'static Action { - &Action::SoftCensorAndWarn - } - - fn name(&self) -> &'static str { - "Explicit Sexual Language Typo" - } - - fn detect(&self, _original: &str, normalized: &str) -> (Vec, Vec) { - ( - vec![], - find_with_exceptions(normalized, &self.pattern, &self.exceptions), - ) - } -} - #[derive(Debug)] struct SuggestiveLanguageRule { pattern: Regex, @@ -805,7 +768,6 @@ pub static RULES: Lazy>> = Lazy::new(|| { Arc::new(HateSpeechAndSlursRule::new()), Arc::new(ThreatsAndSelfHarmRule::new()), Arc::new(ExplicitSexualLanguageRule::new()), - Arc::new(ExplicitSexualLanguageTypoRule::new()), Arc::new(SuggestiveLanguageRule::new()), Arc::new(AdvertisingRule), Arc::new(SensitiveTopicsAndTriggeringContentRule::new()),