mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 08:21:47 +00:00
Implement apply_spam_filter_on_incoming_events
This commit is contained in:
parent
354f0bcf22
commit
ca41373ac5
@ -5,7 +5,6 @@ use crate::globals::GLOBALS;
|
||||
use crate::misc::{Freshness, Private};
|
||||
use crate::people::{People, PersonList, PersonListMetadata};
|
||||
use crate::relationship::{RelationshipByAddr, RelationshipById};
|
||||
use crate::spam_filter::EventFilterAction;
|
||||
use crate::storage::{PersonTable, Table};
|
||||
use heed::RwTxn;
|
||||
use nostr_types::{
|
||||
@ -76,6 +75,12 @@ pub fn process_new_event(
|
||||
)?;
|
||||
}
|
||||
|
||||
if GLOBALS
|
||||
.db()
|
||||
.read_setting_apply_spam_filter_on_incoming_events()
|
||||
{
|
||||
use crate::spam_filter::EventFilterAction;
|
||||
|
||||
// Spam filter (displayable and author is not followed)
|
||||
if (event.kind.is_feed_displayable() || event.kind == EventKind::GiftWrap)
|
||||
&& !GLOBALS
|
||||
@ -106,6 +111,7 @@ pub fn process_new_event(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Invalidate the note itself (due to seen_on probably changing)
|
||||
GLOBALS.ui_notes_to_invalidate.write().push(event.id);
|
||||
|
Loading…
Reference in New Issue
Block a user