Hi, thank you for replying.
It's actually relatively simple.
Yes, the spec does contradict itself about how to quote a note. You are right.
Some clients include both the "q" tag and the "e" tag with "mention" mark when quoting a note. I think, for now, that is the right choice.
When posting a reply, there was an old standard without marks. The new standard, which should be used, does have marks. Clients should still support the old one when parsing a note.
There is no ambiguity when writing a reply: the reply should contain two "e" tags: one with "root" mark pointing to the root and one with "reply" mark pointing to the parent, except when the parent is also the root: in that case only one tag with the "root" mark is included.
The correct behavior is to not include other ancestors at all.
To sum up, my suggestion is:
- Assume some clients will use the mark semantic and some the positional semantic. Your client should parse both.
- When writing a note, always use the mark semantic and assume other clients will parse it. The positional semantic is deprecated.
- Only include parent and root as "e" tags in a reply, with corresponding marks.
- Include, for now, both "q" tag and "e" tag with "mention" mark when another note is being quoted/mentioned. Never use either of these in any other case, especially not for an ancestor.