Use propagation message ID to query instead of materialized view
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user