mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-28 18:51:52 +01:00
policy to reject events with base64 media.
This commit is contained in:
parent
f1f54a7bf3
commit
8557c7a8dc
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"slices"
|
"slices"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
)
|
)
|
||||||
@ -116,3 +117,7 @@ func PreventTimestampsInTheFuture(thresholdSeconds nostr.Timestamp) func(context
|
|||||||
return false, ""
|
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