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
@@ -9,7 +9,7 @@
import EventInfo from "@app/components/EventInfo.svelte"
import EventDeleteConfirm from "@app/components/EventDeleteConfirm.svelte"
import {ENABLE_ZAPS} from "@app/state"
import {publishReaction} from "@app/commands"
import {publishReaction, canEnforceNip70} from "@app/commands"
import {pushModal} from "@app/modal"
type Props = {
@@ -20,9 +20,14 @@
const {url, event, reply}: Props = $props()
const onEmoji = ((event: TrustedEvent, url: string, emoji: NativeEmoji) => {
const onEmoji = (async (event: TrustedEvent, url: string, emoji: NativeEmoji) => {
history.back()
publishReaction({event, relays: [url], content: emoji.unicode})
publishReaction({
event,
relays: [url],
content: emoji.unicode,
protect: await canEnforceNip70(url),
})
}).bind(undefined, event, url)
const showEmojiPicker = () => pushModal(EmojiPicker, {onClick: onEmoji}, {replaceState: true})