fix: send d tags as list

This commit is contained in:
Alejandro Gomez 2023-01-30 08:43:46 +01:00
parent 6e34d101c9
commit 57616758c1
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817
4 changed files with 8 additions and 8 deletions

View File

@ -55,7 +55,7 @@ export default function useLoginFeed() {
sub.Id = "login:muted"; sub.Id = "login:muted";
sub.Kinds = new Set([EventKind.Lists]); sub.Kinds = new Set([EventKind.Lists]);
sub.Authors = new Set([pubKey]); sub.Authors = new Set([pubKey]);
sub.DTag = Lists.Muted; sub.DTags = new Set([Lists.Muted]);
sub.Limit = 1; sub.Limit = 1;
return sub; return sub;

View File

@ -11,7 +11,7 @@ export default function useMutedFeed(pubkey: HexKey) {
sub.Id = `muted:${pubkey.slice(0, 12)}`; sub.Id = `muted:${pubkey.slice(0, 12)}`;
sub.Kinds = new Set([EventKind.Lists]); sub.Kinds = new Set([EventKind.Lists]);
sub.Authors = new Set([pubkey]); sub.Authors = new Set([pubkey]);
sub.DTag = Lists.Muted; sub.DTags = new Set([Lists.Muted]);
sub.Limit = 1; sub.Limit = 1;
return sub; return sub;
}, [pubkey]); }, [pubkey]);

View File

@ -43,9 +43,9 @@ export class Subscriptions {
HashTags?: Set<string>; HashTags?: Set<string>;
/** /**
* A "d" tag to search * A litst of "d" tags to search
*/ */
DTag?: string; DTags?: Set<string>;
/** /**
* A list of search terms * A list of search terms
@ -99,7 +99,7 @@ export class Subscriptions {
this.Kinds = sub?.kinds ? new Set(sub.kinds) : undefined; this.Kinds = sub?.kinds ? new Set(sub.kinds) : undefined;
this.ETags = sub?.["#e"] ? new Set(sub["#e"]) : undefined; this.ETags = sub?.["#e"] ? new Set(sub["#e"]) : undefined;
this.PTags = sub?.["#p"] ? new Set(sub["#p"]) : 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.Search = sub?.search ?? undefined;
this.Since = sub?.since ?? undefined; this.Since = sub?.since ?? undefined;
this.Until = sub?.until ?? undefined; this.Until = sub?.until ?? undefined;
@ -145,8 +145,8 @@ export class Subscriptions {
if (this.HashTags) { if (this.HashTags) {
ret["#t"] = Array.from(this.HashTags); ret["#t"] = Array.from(this.HashTags);
} }
if (this.DTag) { if (this.DTags) {
ret["#d"] = this.DTag; ret["#d"] = Array.from(this.DTags);
} }
if (this.Search) { if (this.Search) {
ret.search = this.Search; ret.search = this.Search;

View File

@ -35,7 +35,7 @@ export type RawReqFilter = {
"#e"?: u256[], "#e"?: u256[],
"#p"?: u256[], "#p"?: u256[],
"#t"?: string[], "#t"?: string[],
"#d"?: string, "#d"?: string[],
search?: string, search?: string,
since?: number, since?: number,
until?: number, until?: number,