Dont tag own pubkey in replies

This commit is contained in:
Kieran 2023-01-11 11:37:27 +00:00
parent 85a65580f2
commit 357937b403
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -64,7 +64,6 @@ export default function useEventPublisher() {
let thread = replyTo.Thread;
if (thread) {
console.debug(replyTo);
if (thread.Root) {
ev.Tags.push(new Tag(["e", thread.Root.Event, "", "root"], ev.Tags.length));
} else {
@ -73,6 +72,9 @@ export default function useEventPublisher() {
ev.Tags.push(new Tag(["e", replyTo.Id, "", "reply"], ev.Tags.length));
ev.Tags.push(new Tag(["p", replyTo.PubKey], ev.Tags.length));
for (let pk of thread.PubKeys) {
if(pk === pubKey) {
continue; // dont tag self in replies
}
ev.Tags.push(new Tag(["p", pk], ev.Tags.length));
}
} else {