diff --git a/packages/app/src/tags.ts b/packages/app/src/tags.ts index c922f0f..3f4a425 100644 --- a/packages/app/src/tags.ts +++ b/packages/app/src/tags.ts @@ -1,4 +1,4 @@ -import {ctx, remove, nthEq} from "@welshman/lib" +import {ctx, uniq, remove, nthEq} from "@welshman/lib" import { getAddress, isReplaceable, @@ -36,7 +36,7 @@ export const tagEvent = (event: TrustedEvent, mark = "") => { } export const tagEventPubkeys = (event: TrustedEvent) => - remove(pubkey.get()!, [event.pubkey, ...getPubkeyTagValues(event.tags)]).map(tagPubkey) + uniq(remove(pubkey.get()!, [event.pubkey, ...getPubkeyTagValues(event.tags)])).map(tagPubkey) export const tagEventForQuote = (event: TrustedEvent) => [ "q", diff --git a/packages/util/src/Tags.ts b/packages/util/src/Tags.ts index ce5ee10..3b57103 100644 --- a/packages/util/src/Tags.ts +++ b/packages/util/src/Tags.ts @@ -103,6 +103,6 @@ export const getReplyTags = (tags: string[][]) => { export const getReplyTagValues = (tags: string[][]) => mapVals(tags => tags.map(nth(1)), getReplyTags(tags)) -export const uniqTags = (tags: string[][]) => uniqBy(t => t.join(":"), tags) +export const uniqTags = (tags: string[][]) => uniqBy(t => t.slice(0, 2).join(":"), tags) export const tagsFromIMeta = (imeta: string[]) => imeta.map((m: string) => m.split(" "))