From 0e81643c1b9ed0e0ee95223e08c0593159e958c4 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Wed, 30 Oct 2024 15:52:25 -0700 Subject: [PATCH] Add hints to notification parents, fix address bug on note actions --- src/app/shared/NoteActions.svelte | 4 ++-- src/app/views/NotificationReplies.svelte | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/shared/NoteActions.svelte b/src/app/shared/NoteActions.svelte index b50b714c..c1ecd4e9 100644 --- a/src/app/shared/NoteActions.svelte +++ b/src/app/shared/NoteActions.svelte @@ -23,7 +23,7 @@ isSignedEvent, createEvent, getAddress, - getAddressTagValues, + getContextTagValues, getPubkeyTagValues, } from "@welshman/util" import {tweened} from "svelte/motion" @@ -77,7 +77,7 @@ export let zapper const signedEvent = asSignedEvent(note as any) - const address = contextAddress || first(getAddressTagValues(note.tags)) + const address = contextAddress || first(getContextTagValues(note.tags)) const addresses = [address].filter(identity) const nevent = nip19.neventEncode({ id: note.id, diff --git a/src/app/views/NotificationReplies.svelte b/src/app/views/NotificationReplies.svelte index de48b5be..70696d66 100644 --- a/src/app/views/NotificationReplies.svelte +++ b/src/app/views/NotificationReplies.svelte @@ -2,6 +2,7 @@ import {pluck} from "ramda" import {uniq} from "@welshman/lib" import {pubkey} from "@welshman/app" + import {isShareableRelayUrl} from "@welshman/util" import {formatTimestamp} from "src/util/misc" import Spinner from "src/partials/Spinner.svelte" import PeopleAction from "src/app/shared/PeopleAction.svelte" @@ -12,7 +13,10 @@ export let notification: Notification const {root, interactions, timestamp} = notification - const event = deriveEvent(root) + const relays = uniq(interactions.flatMap(e => + e.tags.flatMap(t => t.slice(2).filter(isShareableRelayUrl)), + )) + const event = deriveEvent(root, {relays}) $: actionText = $event?.pubkey === $pubkey ? "replied to your note" : "mentioned you"