diff --git a/policies/events.go b/policies/events.go index 3269473..f76febc 100644 --- a/policies/events.go +++ b/policies/events.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "slices" + "strings" "github.com/nbd-wtf/go-nostr" ) @@ -116,3 +117,7 @@ func PreventTimestampsInTheFuture(thresholdSeconds nostr.Timestamp) func(context return false, "" } } + +func RejectEventsWithBase64Media(ctx context.Context, evt *nostr.Event) (bool, string) { + return strings.Contains(evt.Content, "data:image/") || strings.Contains(evt.Content, "data:video/"), "event with base64 media" +}