mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 21:32:55 +01:00
policy to reject events with base64 media.
This commit is contained in:
parent
f1f54a7bf3
commit
8557c7a8dc
@ -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"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user