@ -189,13 +189,14 @@ export class EventPublisher {
|
|||||||
const eb = this.#eb(EventKind.TextNote);
|
const eb = this.#eb(EventKind.TextNote);
|
||||||
eb.content(msg);
|
eb.content(msg);
|
||||||
|
|
||||||
|
const link = NostrLink.fromEvent(replyTo);
|
||||||
const thread = EventExt.extractThread(replyTo);
|
const thread = EventExt.extractThread(replyTo);
|
||||||
if (thread) {
|
if (thread) {
|
||||||
const rootOrReplyAsRoot = thread.root || thread.replyTo;
|
const rootOrReplyAsRoot = thread.root || thread.replyTo;
|
||||||
if (rootOrReplyAsRoot) {
|
if (rootOrReplyAsRoot) {
|
||||||
eb.tag([rootOrReplyAsRoot.key, rootOrReplyAsRoot.value ?? "", rootOrReplyAsRoot.relay ?? "", "root"]);
|
eb.tag([rootOrReplyAsRoot.key, rootOrReplyAsRoot.value ?? "", rootOrReplyAsRoot.relay ?? "", "root"]);
|
||||||
}
|
}
|
||||||
eb.tag([...(NostrLink.fromEvent(replyTo).toEventTag() ?? []), "reply"]);
|
eb.tag([...unwrap(link.toEventTag()), "reply"]);
|
||||||
|
|
||||||
eb.tag(["p", replyTo.pubkey]);
|
eb.tag(["p", replyTo.pubkey]);
|
||||||
for (const pk of thread.pubKeys) {
|
for (const pk of thread.pubKeys) {
|
||||||
@ -205,12 +206,14 @@ export class EventPublisher {
|
|||||||
eb.tag(["p", pk]);
|
eb.tag(["p", pk]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
eb.tag([...(NostrLink.fromEvent(replyTo).toEventTag() ?? []), "root"]);
|
eb.tag([...unwrap(link.toEventTag()), "root"]);
|
||||||
// dont tag self in replies
|
// dont tag self in replies
|
||||||
if (replyTo.pubkey !== this.#pubKey) {
|
if (replyTo.pubkey !== this.#pubKey) {
|
||||||
eb.tag(["p", replyTo.pubkey]);
|
eb.tag(["p", replyTo.pubkey]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Big E/A tag
|
||||||
|
eb.tag(unwrap(link.toEventTag()).map((v, i) => (i === 0 ? v.toUpperCase() : v)));
|
||||||
eb.processContent();
|
eb.processContent();
|
||||||
fnExtra?.(eb);
|
fnExtra?.(eb);
|
||||||
return await this.#sign(eb);
|
return await this.#sign(eb);
|
||||||
|
Reference in New Issue
Block a user