From c2e8f1f9fa30402f12d8dd32915067ec79b17cc4 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Fri, 31 Oct 2025 12:02:50 -0700 Subject: [PATCH] Tweak auto join behavior --- README.md | 2 +- zooid/instance.go | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 405fd00..2e56c66 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Contains policy and access related configuration. Configures NIP 29 support. - `enabled` - whether NIP 29 is enabled. -- `auto_join` - whether relay members can join `open` groups without approval. Defaults to `true`. +- `auto_join` - whether relay members can join groups without approval. Defaults to `false`. ### `[management]` diff --git a/zooid/instance.go b/zooid/instance.go index a875c77..9652ee7 100644 --- a/zooid/instance.go +++ b/zooid/instance.go @@ -373,25 +373,11 @@ func (instance *Instance) OnEvent(ctx context.Context, event nostr.Event) (rejec } func (instance *Instance) OnEventSaved(ctx context.Context, event nostr.Event) { - var groupMeta nostr.Event - var groupFound bool - h := GetGroupIDFromEvent(event) - if h != "" { - groupMeta, groupFound = instance.Groups.GetMetadata(h) - - if !groupFound && event.Kind != nostr.KindSimpleGroupCreateGroup { - log.Printf("Attempted to process event for nonexistent group %s", h) - return - } - } - if event.Kind == nostr.KindSimpleGroupJoinRequest && instance.Config.Groups.AutoJoin { - if !HasTag(groupMeta.Tags, "closed") { - instance.Groups.AddMember(h, event.PubKey) - instance.Groups.UpdateMembersList(h) - } + instance.Groups.AddMember(h, event.PubKey) + instance.Groups.UpdateMembersList(h) } if event.Kind == nostr.KindSimpleGroupLeaveRequest {