rename plugins to policies.

This commit is contained in:
fiatjaf
2023-11-22 17:11:05 -03:00
parent d592bd95a9
commit 194ec994d7
3 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
package plugins
package policies
import (
"context"

View File

@@ -1,4 +1,4 @@
package plugins
package policies
import (
"context"

View File

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