Only protect events if the relay will authenticate with the user

This commit is contained in:
Jon Staab
2025-07-30 16:30:03 -07:00
parent 03b42c8276
commit 069904f07a
23 changed files with 159 additions and 87 deletions
+5 -4
View File
@@ -4,7 +4,7 @@
import ThunkStatusOrDeleted from "@app/components/ThunkStatusOrDeleted.svelte"
import EventActivity from "@app/components/EventActivity.svelte"
import EventActions from "@app/components/EventActions.svelte"
import {publishDelete, publishReaction} from "@app/commands"
import {publishDelete, publishReaction, canEnforceNip70} from "@app/commands"
import {makeThreadPath} from "@app/routes"
interface Props {
@@ -17,10 +17,11 @@
const path = makeThreadPath(url, event.id)
const deleteReaction = (event: TrustedEvent) => publishDelete({relays: [url], event})
const deleteReaction = async (event: TrustedEvent) =>
publishDelete({relays: [url], event, protect: await canEnforceNip70(url)})
const createReaction = (template: EventContent) =>
publishReaction({...template, event, relays: [url]})
const createReaction = async (template: EventContent) =>
publishReaction({...template, event, relays: [url], protect: await canEnforceNip70(url)})
</script>
<div class="flex flex-wrap items-center justify-between gap-2">