From 57616758c132099d14102c9b48f19911f054f10d Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Mon, 30 Jan 2023 08:43:46 +0100 Subject: [PATCH] fix: send d tags as list --- src/Feed/LoginFeed.ts | 2 +- src/Feed/MuteList.ts | 2 +- src/Nostr/Subscriptions.ts | 10 +++++----- src/Nostr/index.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Feed/LoginFeed.ts b/src/Feed/LoginFeed.ts index d7b5e46a..847dbc61 100644 --- a/src/Feed/LoginFeed.ts +++ b/src/Feed/LoginFeed.ts @@ -55,7 +55,7 @@ export default function useLoginFeed() { sub.Id = "login:muted"; sub.Kinds = new Set([EventKind.Lists]); sub.Authors = new Set([pubKey]); - sub.DTag = Lists.Muted; + sub.DTags = new Set([Lists.Muted]); sub.Limit = 1; return sub; diff --git a/src/Feed/MuteList.ts b/src/Feed/MuteList.ts index 79eb14d2..7a2bb822 100644 --- a/src/Feed/MuteList.ts +++ b/src/Feed/MuteList.ts @@ -11,7 +11,7 @@ export default function useMutedFeed(pubkey: HexKey) { sub.Id = `muted:${pubkey.slice(0, 12)}`; sub.Kinds = new Set([EventKind.Lists]); sub.Authors = new Set([pubkey]); - sub.DTag = Lists.Muted; + sub.DTags = new Set([Lists.Muted]); sub.Limit = 1; return sub; }, [pubkey]); diff --git a/src/Nostr/Subscriptions.ts b/src/Nostr/Subscriptions.ts index b3448667..d923780a 100644 --- a/src/Nostr/Subscriptions.ts +++ b/src/Nostr/Subscriptions.ts @@ -43,9 +43,9 @@ export class Subscriptions { HashTags?: Set; /** - * A "d" tag to search + * A litst of "d" tags to search */ - DTag?: string; + DTags?: Set; /** * A list of search terms @@ -99,7 +99,7 @@ export class Subscriptions { this.Kinds = sub?.kinds ? new Set(sub.kinds) : undefined; this.ETags = sub?.["#e"] ? new Set(sub["#e"]) : undefined; this.PTags = sub?.["#p"] ? new Set(sub["#p"]) : undefined; - this.DTag = sub?.["#d"] ? sub["#d"] : undefined; + this.DTags = sub?.["#d"] ? new Set(["#d"]) : undefined; this.Search = sub?.search ?? undefined; this.Since = sub?.since ?? undefined; this.Until = sub?.until ?? undefined; @@ -145,8 +145,8 @@ export class Subscriptions { if (this.HashTags) { ret["#t"] = Array.from(this.HashTags); } - if (this.DTag) { - ret["#d"] = this.DTag; + if (this.DTags) { + ret["#d"] = Array.from(this.DTags); } if (this.Search) { ret.search = this.Search; diff --git a/src/Nostr/index.ts b/src/Nostr/index.ts index f8128c16..52df0fdd 100644 --- a/src/Nostr/index.ts +++ b/src/Nostr/index.ts @@ -35,7 +35,7 @@ export type RawReqFilter = { "#e"?: u256[], "#p"?: u256[], "#t"?: string[], - "#d"?: string, + "#d"?: string[], search?: string, since?: number, until?: number,