summaryrefslogtreecommitdiff
path: root/app/lib/json
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-11-18 16:58:46 +0700
committerpolwex <polwex@sortug.com>2025-11-18 16:58:46 +0700
commit76f99af3c98a689441315b5ed087c4b83c083191 (patch)
treeb51182eda47f4b3311c352a86d8256e417af4db5 /app/lib/json
parenta465c73178dc621578d10312f263355f0f2d5309 (diff)
refactooooring
Diffstat (limited to 'app/lib/json')
-rw-r--r--app/lib/json/nostr.hoon11
-rw-r--r--app/lib/json/nostrill.hoon13
2 files changed, 17 insertions, 7 deletions
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 :~