feat: add RelayUrlSegment for ws:// and wss:// relay URIs

Adds a new RelayUrlSegment type to RichTextParser that detects and
labels relay URIs (ws:// and wss:// schemes) as a distinct segment
type, separate from generic LinkSegments.

https://claude.ai/code/session_01U21sGdEEMLo4hY8dwxNzPr
This commit is contained in:
Claude
2026-03-01 16:33:58 +00:00
parent 678a97d01b
commit 304c348736
2 changed files with 7 additions and 0 deletions
@@ -245,6 +245,8 @@ class RichTextParser {
if (videos.contains(word)) return VideoSegment(word)
if (word.startsWith("ws://", ignoreCase = true) || word.startsWith("wss://", ignoreCase = true)) return RelayUrlSegment(word)
if (urls.contains(word)) return LinkSegment(word)
if (CustomEmoji.fastMightContainEmoji(word, emojis) && emojis.any { word.contains(it.key) }) return EmojiSegment(word)
@@ -146,6 +146,11 @@ class SchemelessUrlSegment(
val extras: String?,
) : Segment(segment)
@Immutable
class RelayUrlSegment(
segment: String,
) : Segment(segment)
@Immutable
class RegularTextSegment(
segment: String,