Remove sexually explicit typos rule and add migration for masked call participants

This commit is contained in:
2025-08-23 13:22:35 -03:00
parent 7d47a9eb35
commit 6c72c27911
7 changed files with 6 additions and 46 deletions
Generated
+1 -1
View File
@@ -1437,7 +1437,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
[[package]]
name = "payphone"
version = "4.2.15"
version = "4.2.17"
dependencies = [
"async-trait",
"axum",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "payphone"
version = "4.2.15"
version = "4.2.17"
edition = "2024"
default-run = "payphone"
@@ -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);
@@ -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
paki
hoe
ho
@@ -1 +0,0 @@
ho
@@ -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
-38
View File
@@ -559,43 +559,6 @@ impl Rule for ExplicitSexualLanguageRule {
}
}
#[derive(Debug)]
struct ExplicitSexualLanguageTypoRule {
pattern: Regex,
exceptions: Vec<String>,
}
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<String>, Vec<String>) {
(
vec![],
find_with_exceptions(normalized, &self.pattern, &self.exceptions),
)
}
}
#[derive(Debug)]
struct SuggestiveLanguageRule {
pattern: Regex,
@@ -805,7 +768,6 @@ pub static RULES: Lazy<Vec<Arc<dyn Rule>>> = 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()),