Remove auto join settings
This commit is contained in:
@@ -46,7 +46,6 @@ Contains policy and access related configuration.
|
||||
Configures NIP 29 support.
|
||||
|
||||
- `enabled` - whether NIP 29 is enabled.
|
||||
- `auto_join` - whether relay members can join groups without approval. Defaults to `false`.
|
||||
|
||||
### `[management]`
|
||||
|
||||
@@ -97,7 +96,6 @@ strip_signatures = false
|
||||
|
||||
[groups]
|
||||
enabled = true
|
||||
auto_join = false
|
||||
|
||||
[management]
|
||||
enabled = true
|
||||
|
||||
+2
-4
@@ -422,8 +422,7 @@ func TestAPIHandler_PatchRelay(t *testing.T) {
|
||||
"strip_signatures": false,
|
||||
},
|
||||
"groups": map[string]interface{}{
|
||||
"enabled": true,
|
||||
"auto_join": false,
|
||||
"enabled": true,
|
||||
},
|
||||
}
|
||||
body, _ := json.Marshal(initialConfig)
|
||||
@@ -701,8 +700,7 @@ func TestAPIHandler_ConfigValidation(t *testing.T) {
|
||||
"strip_signatures": false,
|
||||
},
|
||||
"groups": map[string]interface{}{
|
||||
"enabled": true,
|
||||
"auto_join": true,
|
||||
"enabled": true,
|
||||
},
|
||||
"push": map[string]interface{}{
|
||||
"enabled": true,
|
||||
|
||||
+1
-2
@@ -32,8 +32,7 @@ type Config struct {
|
||||
} `toml:"policy" json:"policy"`
|
||||
|
||||
Groups struct {
|
||||
Enabled bool `toml:"enabled" json:"enabled"`
|
||||
AutoJoin bool `toml:"auto_join" json:"auto_join"`
|
||||
Enabled bool `toml:"enabled" json:"enabled"`
|
||||
} `toml:"groups" json:"groups"`
|
||||
|
||||
Push struct {
|
||||
|
||||
+1
-1
@@ -380,7 +380,7 @@ func (instance *Instance) OnEvent(ctx context.Context, event nostr.Event) (rejec
|
||||
func (instance *Instance) OnEventSaved(ctx context.Context, event nostr.Event) {
|
||||
h := GetGroupIDFromEvent(event)
|
||||
|
||||
if event.Kind == nostr.KindSimpleGroupJoinRequest && instance.Config.Groups.AutoJoin {
|
||||
if event.Kind == nostr.KindSimpleGroupJoinRequest {
|
||||
instance.Groups.AddMember(h, event.PubKey)
|
||||
instance.Groups.UpdateMembersList(h)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user