feat: show external-id scope as reply context for NIP-22 comments
A Comment event (kind 1111) scoped to an external identifier (`I` tag) previously rendered as a bare text post and landed in the Home "New Threads" feed. Treat it as a reply to that external scope: it now shows in the conversations feed and renders a typed chip (hashtag, geohash, url, or generic) above the comment text. https://claude.ai/code/session_01ArHkNXu1ANrVGZAyMWg4Xu
This commit is contained in:
@@ -181,6 +181,9 @@ class CommentEvent(
|
||||
|
||||
fun isScoped(scopeTest: (String) -> Boolean) = tags.any { RootIdentifierTag.isTagged(it, scopeTest) || ReplyIdentifierTag.isTagged(it, scopeTest) }
|
||||
|
||||
/** True when the comment points at an external identifier (`I` tag), e.g. a hashtag, geohash or url. */
|
||||
fun hasRootScopeIdentifier() = tags.any(RootIdentifierTag::match)
|
||||
|
||||
fun hasRootScopeKind(kind: String) = tags.any(RootKindTag::isKind, kind)
|
||||
|
||||
fun hasReplyScopeKind(kind: String) = tags.any(ReplyKindTag::isKind, kind)
|
||||
|
||||
Reference in New Issue
Block a user