From 61d26c0d854c75dae9e9d31668a8642c1f08481e Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Tue, 11 Feb 2025 10:01:20 +1300 Subject: [PATCH] fix: don't let moderation ban authorized users --- src/nostr.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/nostr.rs b/src/nostr.rs index 446ac27..67acaa7 100644 --- a/src/nostr.rs +++ b/src/nostr.rs @@ -707,6 +707,12 @@ async fn screen_incoming_event( event_flags: EventFlags, authorized_user: bool, ) -> Result { + // 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))