diff --git a/plugins/events.go b/policies/events.go similarity index 99% rename from plugins/events.go rename to policies/events.go index bc3de0a..3bcb32e 100644 --- a/plugins/events.go +++ b/policies/events.go @@ -1,4 +1,4 @@ -package plugins +package policies import ( "context" diff --git a/plugins/filters.go b/policies/filters.go similarity index 99% rename from plugins/filters.go rename to policies/filters.go index 7fdd5e1..72ed356 100644 --- a/plugins/filters.go +++ b/policies/filters.go @@ -1,4 +1,4 @@ -package plugins +package policies import ( "context" diff --git a/plugins/nip04.go b/policies/nip04.go similarity index 86% rename from plugins/nip04.go rename to policies/nip04.go index d76bbd3..5103697 100644 --- a/plugins/nip04.go +++ b/policies/nip04.go @@ -1,4 +1,4 @@ -package plugins +package policies import ( "context" @@ -8,7 +8,8 @@ import ( "golang.org/x/exp/slices" ) -func rejectKind04Snoopers(ctx context.Context, filter nostr.Filter) (bool, string) { +// RejectKind04Snoopers prevents reading NIP-04 messages from people not involved in the conversation. +func RejectKind04Snoopers(ctx context.Context, filter nostr.Filter) (bool, string) { // prevent kind-4 events from being returned to unauthed users, // only when authentication is a thing if !slices.Contains(filter.Kinds, 4) {