fix: use semantic author for reaction relay selection

Use getSemanticAuthor() to determine the target pubkey for relay
selection. This ensures reactions to zaps notify the zapper (not the
lightning service) and reactions to streams notify the host.
This commit is contained in:
Claude
2026-01-21 18:58:58 +00:00
parent e4390c73a5
commit b42e4e7efc

View File

@@ -552,7 +552,9 @@ export function BaseEventContainer({
const signed = await factory.sign(draft);
// Select relays per NIP-65: author's outbox + target's inbox
const relays = await selectRelaysForInteraction(pubkey, event.pubkey);
// Use semantic author (e.g., zapper for zaps, host for streams)
const targetPubkey = getSemanticAuthor(event);
const relays = await selectRelaysForInteraction(pubkey, targetPubkey);
await publishEventToRelays(signed, relays);
} catch (err) {
console.error("[BaseEventContainer] Failed to send reaction:", err);