Merge pull request #169 from v0l/d-tags

fix: send d tags as list
This commit is contained in:
Kieran 2023-01-30 17:46:56 +00:00 committed by GitHub
commit e21494cc2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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]);

View File

@ -43,9 +43,9 @@ export class Subscriptions {
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
@ -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;

View File

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