diff --git a/src/overlord/mod.rs b/src/overlord/mod.rs index 021323b0..469d8b0a 100644 --- a/src/overlord/mod.rs +++ b/src/overlord/mod.rs @@ -1111,9 +1111,19 @@ impl Overlord { // Add an 'e' tag for the note we are replying to add_event_to_tags(&mut tags, parent_id, "reply").await; } else { - // We are replying to the root. - // NIP-10: "A direct reply to the root of a thread should have a single marked "e" tag of type "root"." - add_event_to_tags(&mut tags, parent_id, "root").await; + match parent.replies_to() { + None => { + // If the parent doesn't have any e-tags, then it is the root + // NIP-10: "A direct reply to the root of a thread should have a single marked "e" tag of type "root"." + add_event_to_tags(&mut tags, parent_id, "root").await; + }, + Some((_id, _mayberelay)) => { + // FIXME: we could try to climb up events until we find the root. + + // We don't know the root. We are a reply. + add_event_to_tags(&mut tags, parent_id, "reply").await; + } + } } // Possibly propagate a subject tag