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:
Claude
2026-05-14 15:05:04 +00:00
parent f7f4107ad7
commit a690777ef6
5 changed files with 117 additions and 3 deletions
@@ -773,15 +773,20 @@ open class Note(
return author?.reportsOrNull()?.hasReportNewerThan(dayAgo) ?: false
}
fun isNewThread(): Boolean =
(
fun isNewThread(): Boolean {
val event = event
return (
event is RepostEvent ||
event is GenericRepostEvent ||
replyTo == null ||
replyTo?.size == 0
) &&
// A comment scoped to an external identifier (`I` tag) is a reply to that
// scope, even though there is no in-cache parent note to populate replyTo.
!(event is CommentEvent && event.hasRootScopeIdentifier()) &&
event !is ChannelMessageEvent &&
event !is LiveActivitiesChatMessageEvent
}
fun hasZapped(loggedIn: User): Boolean = zaps.any { it.key.author == loggedIn }