fix: don't let moderation ban authorized users

This commit is contained in:
Mike Dilger 2025-02-11 10:01:20 +13:00
parent 5941425799
commit 61d26c0d85
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4

View File

@ -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))