| 1 | /** |
| 2 | * A chat thread's link, to copy and to cite. Pure, so it is tested on its |
| 3 | * own. |
| 4 | */ |
| 5 | |
| 6 | /** A thread's link, to cite and to share: the conversation's path (lib/chat.ts `channelPath`) with `?thread=`. */ |
| 7 | export function threadLink(origin: string, conversationPath: string, rootId: string): string { |
| 8 | return `${origin.replace(/\/+$/, "")}${conversationPath}?thread=${encodeURIComponent(rootId)}`; |
| 9 | } |