Add support for nip 22 tags

This commit is contained in:
Ticruz
2025-01-17 16:53:16 +01:00
committed by Jon Staab
parent b440fdc84a
commit 856055f99c
11 changed files with 148 additions and 58 deletions
+9 -2
View File
@@ -25,12 +25,14 @@ import {
isLocalUrl,
isIPAddress,
isShareableRelayUrl,
COMMENT,
PROFILE,
RELAYS,
INBOX_RELAYS,
FOLLOWS,
WRAP,
getAncestorTags,
getReplyTags,
getCommentTags,
getPubkeyTagValues,
normalizeRelayUrl,
} from "@welshman/util"
@@ -191,8 +193,13 @@ export class Router {
}
EventAncestors = (event: TrustedEvent, type: "mentions" | "replies" | "roots") => {
const ancestorTags =
event.kind === COMMENT ? getCommentTags(event.tags) : getReplyTags(event.tags)
const tags: string[][] = (ancestorTags as any)[type] || []
return this.scenario(
getAncestorTags(event.tags)[type].flatMap(([_, value, relay, pubkey]) => {
tags.flatMap(([_, value, relay, pubkey]) => {
const selections = [makeSelection(this.ForUser().getUrls(), 0.5)]
if (pubkey) {