summaryrefslogtreecommitdiff
path: root/desk/lib/nostrill.hoon
diff options
context:
space:
mode:
Diffstat (limited to 'desk/lib/nostrill.hoon')
-rw-r--r--desk/lib/nostrill.hoon35
1 files changed, 33 insertions, 2 deletions
diff --git a/desk/lib/nostrill.hoon b/desk/lib/nostrill.hoon
index c7e940c..0570dbc 100644
--- a/desk/lib/nostrill.hoon
+++ b/desk/lib/nostrill.hoon
@@ -1,5 +1,5 @@
-/- post=trill-post, nsur=nostr, sur=nostrill
-/+ trill=trill-post, nostr, sr=sortug
+/- post=trill-post, nsur=nostr, sur=nostrill, gate=trill-gate
+/+ trill=trill-post, nostr, sr=sortug, jsonlib=json-nostrill
|%
::
++ default-state |= =bowl:gall ^- state:sur
@@ -47,9 +47,40 @@
signature
==
event
+
+++ event-to-post
+ |= [=event:nsur profile=(unit user-meta:nsur) relay=(unit @t)]
+ ^- post-wrapper:sur
+
+ =/ cl (tokenize:trill content.event)
+ =/ ts (from-unix:jikan:sr created-at.event)
+ =/ cm=content-map:post (init-content-map:trill cl ts)
+
+ :: TODO more about @ps and stuff
+ =/ p=post:post :*
+ id=ts
+ host=`@p`pubkey.event
+ author=`@p`pubkey.event
+ thread=ts
+ parent=~
+ children=~
+ contents=cm
+ read=*lock:gate
+ write=*lock:gate
+ *engagement:post
+ 0v0
+ *signature:post
+ tags=~
+ ==
+ =/ meta [(some pubkey.event) (some id.event) relay profile]
+ [p meta]
+
++ cards
|_ =bowl:gall
++ shim-binding ^- card:agent:gall
[%pass /binding %arvo %e %connect [~ /nostr-shim] dap.bowl]
+ ++ update-ui |= =fact:ui:sur ^- card:agent:gall
+ =/ jon (fact:en:jsonlib fact)
+ [%give %fact ~[/ui] %json !>(jon)]
--
--