diff options
author | polwex <polwex@sortug.com> | 2025-09-17 15:56:00 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-17 15:56:00 +0700 |
commit | f0df4c7297a05bd592d8717b8997284c80fd0500 (patch) | |
tree | 2d38e079e971a2e98e78a0f7a3104f2bd3c5daeb /front/src/logic/nostril.ts | |
parent | 387af8fc1603805b02ce03f8adba4fa73a954f7c (diff) |
argh
Diffstat (limited to 'front/src/logic/nostril.ts')
-rw-r--r-- | front/src/logic/nostril.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/front/src/logic/nostril.ts b/front/src/logic/nostril.ts deleted file mode 100644 index 4e5549d..0000000 --- a/front/src/logic/nostril.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { Event } from "@/types/nostr"; -import type { FC, FlatFeed, Poast } from "@/types/trill"; -import { engagementBunt, openLock } from "./bunts"; -export function eventsToFc(relayData: Record<string, Event[]>): FC { - const start = null; - const end = null; - const feed = Object.values(relayData).reduce((acc: FlatFeed, events) => { - const poasts = events.map(eventToPoast); - for (const p of poasts) { - if (p) acc[p.id] = p; - } - return acc; - }, {}); - return { feed, start, end }; -} -export function eventToPoast(event: Event): Poast | null { - if (event.kind !== 1) return null; - const contents = [{ paragraph: [{ text: event.content }] }]; - const ts = event.created_at * 1000; - const id = `${ts}`; - const poast: Poast = { - id, - host: event.pubkey, - author: event.pubkey, - contents, - thread: id, - parent: null, - read: openLock, - write: openLock, - tags: [], - time: ts, - engagement: engagementBunt, - children: [], - }; - return poast; -} |