Use propagation message ID to query instead of materialized view

This commit is contained in:
2026-02-25 19:35:54 -03:00
parent e7aa3247e5
commit 6aee4f39b0
8 changed files with 123 additions and 167 deletions
+18
View File
@@ -399,6 +399,16 @@ pub trait Rule: Send + Sync + Debug {
/// [`(Vec<String>, Vec<String>)`] - The list of detected rule violations in the original
/// (first vector) and normalized (second vector) message.
fn detect(&self, original: &str, normalized: &str) -> (Vec<String>, Vec<String>);
/// Whether this rule should be ignored for moderators. This is used to avoid censoring
/// messages from moderators, while still allowing them to be detected and logged from regular
/// users.
///
/// Returns:
/// [`bool`] - Whether this rule should be ignored for moderators.
fn ignore_for_moderators(&self) -> bool {
false
}
}
/// Parses a file containing phrases to be detected by rules.
@@ -624,6 +634,10 @@ impl Rule for AdvertisingRule {
(detections, vec![])
}
fn ignore_for_moderators(&self) -> bool {
true
}
}
#[derive(Debug)]
@@ -760,6 +774,10 @@ impl Rule for LinksRule {
(detections, vec![])
}
fn ignore_for_moderators(&self) -> bool {
true
}
}
/// The list of moderation rules.