mirror of
https://github.com/mikedilger/chorus.git
synced 2026-04-03 06:41:16 +00:00
fix: don't let moderation ban authorized users
This commit is contained in:
parent
5941425799
commit
61d26c0d85
11
src/nostr.rs
11
src/nostr.rs
@ -707,6 +707,12 @@ async fn screen_incoming_event(
|
||||
event_flags: EventFlags,
|
||||
authorized_user: bool,
|
||||
) -> Result<bool, Error> {
|
||||
// Accept anything from authenticated authorized users
|
||||
// We do this before checking moderation since authorized overrides moderation
|
||||
if authorized_user {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// Reject if event approval is false
|
||||
if let Some(false) = crate::get_event_approval(GLOBALS.store.get().unwrap(), event.id())? {
|
||||
return Err(ChorusError::BannedEvent.into());
|
||||
@ -733,11 +739,6 @@ async fn screen_incoming_event(
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// Accept anything from authenticated authorized users
|
||||
if authorized_user {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// Accept relay lists from anybody
|
||||
if GLOBALS.config.read().serve_relay_lists
|
||||
&& (event.kind() == Kind::from(10002) || event.kind() == Kind::from(10050))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user