summaryrefslogtreecommitdiff
path: root/app/lib/json
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/json')
-rw-r--r--app/lib/json/nostr.hoon2
-rw-r--r--app/lib/json/nostrill.hoon27
-rw-r--r--app/lib/json/trill.hoon18
3 files changed, 34 insertions, 13 deletions
diff --git a/app/lib/json/nostr.hoon b/app/lib/json/nostr.hoon
index 0b1a79a..05713a5 100644
--- a/app/lib/json/nostr.hoon
+++ b/app/lib/json/nostr.hoon
@@ -42,7 +42,7 @@
|= e=event:sur ^- json
=/ pubkey ?. nostr
(hex:en:common pubkey.e)
- =/ pubkeyt (scow:sr %ux pubkey.e)
+ =/ pubkeyt (scow:parsing:sr %ux pubkey.e)
?~ pubkeyt !!
[%s (crip t.pubkeyt)]
%: pairs
diff --git a/app/lib/json/nostrill.hoon b/app/lib/json/nostrill.hoon
index 01cdb13..e6bfd4c 100644
--- a/app/lib/json/nostrill.hoon
+++ b/app/lib/json/nostrill.hoon
@@ -82,6 +82,7 @@
?- -.f
%nostr (en-nostr +.f)
%post (postfact +.f)
+ %prof (en-profiles +.f)
%enga (enga +.f)
%fols (fols +.f)
%hark (hark +.f)
@@ -228,6 +229,7 @@
%- of :~
add+ui-meta
del+ul
+ fetch+(ar user)
==
++ ui-meta
%- ot :~
@@ -255,25 +257,25 @@
++ reply
%- ot :~
content+so
- host+(se:de:common %p)
- id+de-atom-id
- thread+de-atom-id
+ host+user
+ id+de-post-id
+ id+de-post-id
==
++ quote
%- ot :~
content+so
- host+(se:de:common %p)
- id+de-atom-id
+ host+user
+ id+de-post-id
==
++ pid
%- ot :~
- host+(se:de:common %p)
+ host+user
id+de-atom-id
==
++ reaction
%- ot :~
- host+(se:de:common %p)
- id+de-atom-id
+ host+user
+ id+de-post-id
reaction+so
==
++ rt
@@ -287,6 +289,7 @@
add+so
del+de-atom-id
sync+ul
+ prof+ul
user+hex:de:common
thread+hex:de:common
send+de-relay-send
@@ -296,6 +299,14 @@
id+de-atom-id
relays+(ar so)
==
+
+++ de-post-id
+ |= jon=json ^- (unit @)
+ ?. ?=([%s @t] jon) ~
+ =/ tryatom (rush p.jon dem)
+ ?^ tryatom tryatom
+ ^- (unit @) (hex:de:common jon)
+
++ de-atom-id
|= jon=json ^- (unit @)
?. ?=([%s @t] jon) ~
diff --git a/app/lib/json/trill.hoon b/app/lib/json/trill.hoon
index 415d2f4..c3ef3b6 100644
--- a/app/lib/json/trill.hoon
+++ b/app/lib/json/trill.hoon
@@ -1,4 +1,4 @@
-/- feed=trill-feed, post=trill-post
+/- feed=trill-feed, post=trill-post, sur=nostrill
/+ common=json-common, sr=sortug
|%
++ en
@@ -23,16 +23,26 @@
:- (crip (scow:sr %ud `@ud`post-id))
(poast p)
+ ++ branch-user |= p=@p ^- user:sur
+ =/ bitsize (met 3 p)
+ :: TODO surely there's proper verification methods
+ ?: .=(32 bitsize) [%nostr `@ux`p] [%urbit p]
+ ++ user |= u=user:sur ^- json
+ ?- -.u
+ %urbit (patp:en:common +.u)
+ %nostr (hex:en:common +.u)
+ ==
++ poast
|= p=post:post ^- json
%- pairs
:~ id+(ud:en:common id.p)
- host+(patp:en:common host.p)
- author+(patp:en:common author.p)
+ host+(user (branch-user host.p))
+ author+(user (branch-user author.p))
thread+(ud:en:common thread.p)
parent+?~(parent.p ~ (ud:en:common u.parent.p))
contents+(content contents.p)
- hash+(b64:en:common hash.p)
+ :: hash+(b64:en:common hash.p)
+ hash+(hex:en:common `@ux`hash.p)
engagement+(engagement engagement.p)
children+a+(turn ~(tap in children.p) ud:en:common)
time+(time id.p)