diff --git a/package.json b/package.json index 778d8aa..d562772 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paravel", - "version": "0.4.5", + "version": "0.4.6", "description": "Yet another toolkit for nostr", "author": "hodlbod", "license": "MIT", diff --git a/src/util/nostr.ts b/src/util/nostr.ts index 7039f30..f4bde79 100644 --- a/src/util/nostr.ts +++ b/src/util/nostr.ts @@ -180,13 +180,16 @@ export class Tags extends Fluent { // Support the deprecated version where tags are not marked as replies normalize() { - const tags = this.type(["a", "e"]) + let tags = this.type(["a", "e"]) // If we have a mark, we're not using the legacy format if (tags.any(t => t.length === 4 && ["reply", "root", "mention"].includes(last(t)))) { return this } + // Legacy only supports e tags + tags = tags.type("e") + const reply = tags.values().last() const root = tags.count() > 1 ? tags.values().first() : null