chore: redesign threads as a linear phpBB-style forum view (#300)

Co-authored-by: userAdityaa <aditya.chaudhary1558@gmail.com>
Co-committed-by: userAdityaa <aditya.chaudhary1558@gmail.com>
This commit was merged in pull request #300.
This commit is contained in:
2026-06-17 16:08:58 +00:00
committed by hodlbod
parent b86632e86e
commit deb2b31466
9 changed files with 438 additions and 64 deletions
+12 -1
View File
@@ -20,7 +20,7 @@ import {
getRelaysFromList,
} from "@welshman/util"
import {makeChatId} from "@app/chats"
import {entityLink} from "@app/env"
import {entityLink, PLATFORM_URL} from "@app/env"
import {encodeRelay, hasNip29} from "@app/relays"
import {DM_KINDS} from "@app/content"
import {ROOM} from "@app/groups"
@@ -211,6 +211,17 @@ export const getEventPath = (event: TrustedEvent, urls: string[]) => {
return entityLink(nip19.neventEncode({id: event.id, relays: urls}))
}
export const makeEventPermalink = (event: TrustedEvent, url?: string) => {
const urls = url ? [url] : Array.from(tracker.getRelays(event.id))
const path = getEventPath(event, urls)
if (path.includes("://")) {
return path
}
return `${PLATFORM_URL}${path}#${nip19.neventEncode({id: event.id, relays: urls})}`
}
export const getRoomItemPath = (url: string, event: TrustedEvent) => {
switch (event.kind) {
case THREAD: