Infer room/protected tag from parent event in reactions and deletes

This commit is contained in:
Jon Staab
2024-12-16 13:33:34 -08:00
parent cd8d8b548f
commit fe789c461d
7 changed files with 44 additions and 40 deletions
@@ -1,19 +1,17 @@
<script lang="ts">
import {noop} from "@welshman/lib"
import type {NativeEmoji} from "emoji-picker-element/shared"
import EmojiButton from "@lib/components/EmojiButton.svelte"
import Icon from "@lib/components/Icon.svelte"
import {tagRoom, PROTECTED} from "@app/state"
import {publishReaction} from "@app/commands"
export let url, room, event
// Tell svelte-check to shut up
noop(room)
const onEmoji = (emoji: NativeEmoji) =>
publishReaction({
event,
relays: [url],
content: emoji.unicode,
tags: [tagRoom(room, url), PROTECTED],
})
publishReaction({event, relays: [url], content: emoji.unicode})
</script>
<EmojiButton {onEmoji} class="btn join-item btn-xs">