From 76f99af3c98a689441315b5ed087c4b83c083191 Mon Sep 17 00:00:00 2001 From: polwex Date: Tue, 18 Nov 2025 16:58:46 +0700 Subject: refactooooring --- app/lib/json/nostr.hoon | 11 +++++------ app/lib/json/nostrill.hoon | 13 ++++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'app/lib/json') diff --git a/app/lib/json/nostr.hoon b/app/lib/json/nostr.hoon index ca4ed43..0b1a79a 100644 --- a/app/lib/json/nostr.hoon +++ b/app/lib/json/nostr.hoon @@ -77,10 +77,10 @@ ++ tags - |= tm=(map @t (set @t)) ^- (list [@t json]) :: entries to the filter obeject - %+ turn ~(tap by tm) |= [key=@t values=(set @t)] + |= tm=(map @t (list @t)) ^- (list [@t json]) :: entries to the filter obeject + %+ turn ~(tap by tm) |= [key=@t values=(list @t)] =/ nkey (cat 3 '#' key) - [nkey %a (turn ~(tap in values) cord:en:common)] + [nkey %a (turn values cord:en:common)] ++ user-meta |= meta=user-meta:sur @@ -212,9 +212,8 @@ :: :: anything else is a tag =/ vl ((ar so) +.entry) ?~ vl f - =/ ctags ?~ tags.f *(map @t (set @t)) u.tags.f - =/ values (silt u.vl) - =/ ntags (~(put by ctags) -.entry values) + =/ ctags ?~ tags.f *(map @t (list @t)) u.tags.f + =/ ntags (~(put by ctags) -.entry u.vl) f(tags `ntags) $(entries t.entries) diff --git a/app/lib/json/nostrill.hoon b/app/lib/json/nostrill.hoon index ed8f0a8..01cdb13 100644 --- a/app/lib/json/nostrill.hoon +++ b/app/lib/json/nostrill.hoon @@ -80,12 +80,21 @@ %+ frond %fact %+ frond -.f ?- -.f - %nostr (en-nostr-feed +.f) + %nostr (en-nostr +.f) %post (postfact +.f) %enga (enga +.f) %fols (fols +.f) %hark (hark +.f) == + ++ en-nostr |= nf=nostr-fact:ui:sur ^- json + %+ frond -.nf + ?- -.nf + %feed (en-nostr-feed +.nf) + %user (en-nostr-feed +.nf) + %thread (en-nostr-feed +.nf) + %event (event:en:nostr +.nf) + %relays (en-relays +.nf) + == ++ fols |= ff=fols-fact:ui:sur ^- json %+ frond -.ff ?- -.ff @@ -278,6 +287,8 @@ add+so del+de-atom-id sync+ul + user+hex:de:common + thread+hex:de:common send+de-relay-send == ++ de-relay-send %- ot :~ -- cgit v1.2.3